linux.kernel - 26 new messages in 14 topics - digest
linux.kernel
http://groups.google.com/group/linux.kernel?hl=en
Today's topics:
* sched: Mark boot-cpu active before smp_init() - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/4e1adadf9e3fc724?hl=en
* can/at91: don't check platform_get_irq's return value against zero - 1
messages, 1 author
http://groups.google.com/group/linux.kernel/t/b57a909bdadeb960?hl=en
* staging: s5k3e2fx.c: simplify complexity by factoring - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/1f3c9f7a5a5e05cd?hl=en
* sched: cleanup set_task_cpu() issues - 5 messages, 1 author
http://groups.google.com/group/linux.kernel/t/7ac46f3899f9c408?hl=en
* ep93xx_eth.c: general cleanup - 3 messages, 2 authors
http://groups.google.com/group/linux.kernel/t/51e23b31b5757850?hl=en
* InfiniBand/RDMA merge plans for 2.6.33 - 2 messages, 1 author
http://groups.google.com/group/linux.kernel/t/e00712a75fd7dd79?hl=en
* misc: use a proper range for minor number dynamic allocation - 1 messages, 1
author
http://groups.google.com/group/linux.kernel/t/1aeec7911fd30f2d?hl=en
* perf diff: Use fabs instead of, ugh, casting to u64 - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/3e602a9a29c19491?hl=en
* iwmc3200wifi: Fix test of unsigned in iwm_ntf_stop_resume_tx() - 1 messages,
1 author
http://groups.google.com/group/linux.kernel/t/e391533b5cd1f313?hl=en
* synaptics touchpad doesn't click - 3 messages, 3 authors
http://groups.google.com/group/linux.kernel/t/123e107d469cf53d?hl=en
* linux-next: Tree for December 16 (amd64_edac) - 2 messages, 2 authors
http://groups.google.com/group/linux.kernel/t/9ab5c43cf935b675?hl=en
* OMAP: omap3_pm_get_suspend_state() error ignored in pwrdm_suspend_get() - 1
messages, 1 author
http://groups.google.com/group/linux.kernel/t/550d06bf6191fe34?hl=en
* spi_txx9.c: use resource_size() - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/b407d731b07c073d?hl=en
* perf record: Use per-task-per-cpu events for inherited events - 3 messages,
1 author
http://groups.google.com/group/linux.kernel/t/9f42fbfd8255d0fa?hl=en
==============================================================================
TOPIC: sched: Mark boot-cpu active before smp_init()
http://groups.google.com/group/linux.kernel/t/4e1adadf9e3fc724?hl=en
==============================================================================
== 1 of 1 ==
Date: Wed, Dec 16 2009 9:10 am
From: Peter Zijlstra
A UP machine has 1 active cpu, not having the boot-cpu in the active
map when starting the scheduler confuses things.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
---
Index: linux-2.6/init/main.c
===================================================================
--- linux-2.6.orig/init/main.c
+++ linux-2.6/init/main.c
@@ -369,12 +369,6 @@ static void __init smp_init(void)
{
unsigned int cpu;
- /*
- * Set up the current CPU as possible to migrate to.
- * The other ones will be done by cpu_up/cpu_down()
- */
- set_cpu_active(smp_processor_id(), true);
-
/* FIXME: This should be done in userspace --RR */
for_each_present_cpu(cpu) {
if (num_online_cpus() >= setup_max_cpus)
@@ -486,6 +480,7 @@ static void __init boot_cpu_init(void)
int cpu = smp_processor_id();
/* Mark the boot cpu "present", "online" etc for SMP and UP case */
set_cpu_online(cpu, true);
+ set_cpu_active(cpu, true);
set_cpu_present(cpu, true);
set_cpu_possible(cpu, true);
}
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
==============================================================================
TOPIC: can/at91: don't check platform_get_irq's return value against zero
http://groups.google.com/group/linux.kernel/t/b57a909bdadeb960?hl=en
==============================================================================
== 1 of 1 ==
Date: Wed, Dec 16 2009 9:10 am
From: Uwe Kleine-König
On Wed, Dec 16, 2009 at 05:27:03PM +0100, Wolfgang Grandegger wrote:
> Uwe Kleine-König wrote:
> > platform_get_irq returns -ENXIO on failure, so !irq was probably
> > always true. Better use (int)irq <= 0. Note that a return value of
> > zero is still handled as error even though this could mean irq0.
>
> But only on ARM, which is the only platform still using the infamous
> NO_IRQ (=-1). As this is a driver for ARM hardware, using irq == NO_IRQ
> would make sense, though.
This has nothing to do with NO_IRQ. You could do:
- if (!res || !irq) {
+ if (!res || irq <= (int)NO_IRQ) {
but this looks too ugly. (IMHO using NO_IRQ is already ugly.)
Still, before my patch platform_get_irq return 0 was an error and if
this should be handled as irq0 this is a separate issue that should be
fixed in a separate patch.
Best regards
Uwe
PS:
linux-2.6$ git grep -E 'define *NO_IRQ\>' arch/*/include
arch/arm/include/asm/irq.h:#define NO_IRQ ((unsigned int)(-1))
arch/microblaze/include/asm/irq.h:#define NO_IRQ (-1)
arch/mn10300/include/asm/irq.h:#define NO_IRQ INT_MAX
arch/parisc/include/asm/irq.h:#define NO_IRQ (-1)
arch/powerpc/include/asm/irq.h:#define NO_IRQ (0)
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
==============================================================================
TOPIC: staging: s5k3e2fx.c: simplify complexity by factoring
http://groups.google.com/group/linux.kernel/t/1f3c9f7a5a5e05cd?hl=en
==============================================================================
== 1 of 1 ==
Date: Wed, Dec 16 2009 9:20 am
From: Ray Lee
On Tue, Dec 15, 2009 at 12:52 PM, Justin Madru <jdm64@gawab.com> wrote:
> the code was looping, seting s_move[i] to the following calculations
>
> if (actual_step >= 0)
> s_move[i] = ((((i + 1) * gain + 0x200) - (i * gain + 0x200)) / 0x400);
> else
> s_move[i] = ((((i + 1) * gain - 0x200) - (i * gain - 0x200)) / 0x400);
>
> but, this code redues to the expression
> s_move[i] = gain >> 10;
>
> The reason for the complexity was to generate a step function with
> integer division and rounding to land on specific values. But these calculations
> can be simplified to the following code:
>
> gain = ((actual_step << 10) / 5) >> 10;
> for (i = 0; i <= 4; i++)
> s_move[i] = gain;
> ---
> drivers/staging/dream/camera/s5k3e2fx.c | 10 +++-------
> 1 files changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/staging/dream/camera/s5k3e2fx.c b/drivers/staging/dream/camera/s5k3e2fx.c
> index edba198..66582af 100644
> --- a/drivers/staging/dream/camera/s5k3e2fx.c
> +++ b/drivers/staging/dream/camera/s5k3e2fx.c
> @@ -1093,14 +1093,10 @@ static int32_t s5k3e2fx_move_focus(int direction, int32_t num_steps)
>
> actual_step = step_direction * (int16_t)num_steps;
> pos_offset = init_code + s5k3e2fx_ctrl->curr_lens_pos;
> - gain = actual_step * 0x400 / 5;
> + gain = ((actual_step << 10) / 5) >> 10;
>
> - for (i = 0; i <= 4; i++) {
> - if (actual_step >= 0)
> - s_move[i] = ((((i+1)*gain+0x200) - (i*gain+0x200))/0x400);
> - else
> - s_move[i] = ((((i+1)*gain-0x200) - (i*gain-0x200))/0x400);
> - }
> + for (i = 0; i <= 4; i++)
> + s_move[i] = gain;
>
> /* Ring Damping Code */
> for (i = 0; i <= 4; i++) {
> --
> 1.6.5.6
Okay, yes, that now generates the same numbers before and after.
More worryingly, however, it's now even more obvious that there's no
need for a five-element array here to hold the steps. They're all the
same size, so the array could have been removed along with the gain
variable and the expression ((actual_step << 10) / 5) >> 10 can be
used directly in at the top of the loop in the ring damping code
directly below, the only place that uses the s_move[5] array.
(There's no point in having an array of move values unless the
individual values differ, which makes the whole thing look like
there's a bug in the code compared to the original intent of, perhaps,
making large moves in the beginning and smaller toward the end. Dunno.
This is one of those 'ask the author' sorts of things.)
Regardless, that's not your fault, and not something that has to be
rolled into this patch, so feel free to add my
Reviewed-by: Ray Lee <ray-lk@madrabbit.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
==============================================================================
TOPIC: sched: cleanup set_task_cpu() issues
http://groups.google.com/group/linux.kernel/t/7ac46f3899f9c408?hl=en
==============================================================================
== 1 of 5 ==
Date: Wed, Dec 16 2009 9:20 am
From: Peter Zijlstra
A lot more invasive than I would have liked, but at least it seems to cover all
races I spotted.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
== 2 of 5 ==
Date: Wed, Dec 16 2009 9:20 am
From: Peter Zijlstra
As will be apparent in the next patch, we need a pre wakeup hook for
sched_fair task migration, hence rename the post wakeup hook and one pre
wakeup.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
---
include/linux/sched.h | 3 ++-
kernel/sched.c | 12 ++++++++----
kernel/sched_rt.c | 4 ++--
3 files changed, 12 insertions(+), 7 deletions(-)
Index: linux-2.6/include/linux/sched.h
===================================================================
--- linux-2.6.orig/include/linux/sched.h
+++ linux-2.6/include/linux/sched.h
@@ -1091,7 +1091,8 @@ struct sched_class {
enum cpu_idle_type idle);
void (*pre_schedule) (struct rq *this_rq, struct task_struct *task);
void (*post_schedule) (struct rq *this_rq);
- void (*task_wake_up) (struct rq *this_rq, struct task_struct *task);
+ void (*task_waking) (struct rq *this_rq, struct task_struct *task);
+ void (*task_woken) (struct rq *this_rq, struct task_struct *task);
void (*set_cpus_allowed)(struct task_struct *p,
const struct cpumask *newmask);
Index: linux-2.6/kernel/sched.c
===================================================================
--- linux-2.6.orig/kernel/sched.c
+++ linux-2.6/kernel/sched.c
@@ -2380,6 +2380,10 @@ static int try_to_wake_up(struct task_st
if (task_contributes_to_load(p))
rq->nr_uninterruptible--;
p->state = TASK_WAKING;
+
+ if (p->sched_class->task_waking)
+ p->sched_class->task_waking(rq, p);
+
__task_rq_unlock(rq);
cpu = select_task_rq(p, SD_BALANCE_WAKE, wake_flags);
@@ -2443,8 +2447,8 @@ out_running:
p->state = TASK_RUNNING;
#ifdef CONFIG_SMP
- if (p->sched_class->task_wake_up)
- p->sched_class->task_wake_up(rq, p);
+ if (p->sched_class->task_woken)
+ p->sched_class->task_woken(rq, p);
if (unlikely(rq->idle_stamp)) {
u64 delta = rq->clock - rq->idle_stamp;
@@ -2636,8 +2640,8 @@ void wake_up_new_task(struct task_struct
trace_sched_wakeup_new(rq, p, 1);
check_preempt_curr(rq, p, WF_FORK);
#ifdef CONFIG_SMP
- if (p->sched_class->task_wake_up)
- p->sched_class->task_wake_up(rq, p);
+ if (p->sched_class->task_woken)
+ p->sched_class->task_woken(rq, p);
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home