Messages in this thread Patch in this message | | | Date | Sun, 12 Dec 2004 22:32:49 -0800 | From | Andrew Morton <> | Subject | Re: [PATCH] Remove RCU abuse in cpu_idle() |
| |
Zwane Mwaikambo <zwane@arm.linux.org.uk> wrote: > > The idle thread is special in the sense that it can't get migrated so the > cached values of smp_processor_id are fine.
duh, knew that.
We can use the cached value throughout, no?
--- 25/arch/i386/kernel/process.c~remove-rcu-abuse-in-cpu_idle-warning-fix 2004-12-12 22:30:10.200626944 -0800 +++ 25-akpm/arch/i386/kernel/process.c 2004-12-12 22:31:22.417648288 -0800 @@ -146,7 +146,7 @@ static void poll_idle (void) */ void cpu_idle (void) { - int cpu = smp_processor_id(); + int cpu = _smp_processor_id(); /* endless idle loop with no priority at all */ while (1) { @@ -161,7 +161,7 @@ void cpu_idle (void) if (!idle) idle = default_idle; - irq_stat[smp_processor_id()].idle_timestamp = jiffies; + irq_stat[cpu].idle_timestamp = jiffies; idle(); } schedule(); _ - 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/
| |