Re: [Linux 2.6.28-rc4] BUG: using smp_processor_id() in preemptible [00000000] code: suspend_to_disk/2934

From: Maciej Rutecki
Date: Wed Nov 12 2008 - 15:35:11 EST


2008/11/12 Ingo Molnar <mingo@xxxxxxx>:

>
> i've queued up the fix below in tip/sched/urgent - Maciej, could you
> please test it? I've build and boot tested it.
>

Suspend to disk works OK now. Thanks.

Tested-by: Maciej Rutecki <maciej.rutecki@xxxxxxxxx>
>
> Reported-by: Maciej Rutecki <maciej.rutecki@xxxxxxxxx>
> Signed-off-by: Ingo Molnar <mingo@xxxxxxx>
> ---
> kernel/sched.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/kernel/sched.c b/kernel/sched.c
> index 3bafbe3..c94baf2 100644
> --- a/kernel/sched.c
> +++ b/kernel/sched.c
> @@ -5870,6 +5870,8 @@ void __cpuinit init_idle(struct task_struct *idle, int cpu)
> struct rq *rq = cpu_rq(cpu);
> unsigned long flags;
>
> + spin_lock_irqsave(&rq->lock, flags);
> +
> __sched_fork(idle);
> idle->se.exec_start = sched_clock();
>
> @@ -5877,7 +5879,6 @@ void __cpuinit init_idle(struct task_struct *idle, int cpu)
> idle->cpus_allowed = cpumask_of_cpu(cpu);
> __set_task_cpu(idle, cpu);
>
> - spin_lock_irqsave(&rq->lock, flags);
> rq->curr = rq->idle = idle;
> #if defined(CONFIG_SMP) && defined(__ARCH_WANT_UNLOCKED_CTXSW)
> idle->oncpu = 1;
>
>

Regards
--
Maciej Rutecki
http://www.maciek.unixy.pl
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/