Re: BUG: using smp_processor_id() in preemptible code: s2disk

From: Sergey Senozhatsky
Date: Mon Jun 14 2010 - 10:06:20 EST


Hello,
Not sure if this simple solution is the correct one.

---

diff --git a/kernel/sched.c b/kernel/sched.c
index f8b8996..cfb262b 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -2866,7 +2866,10 @@ unsigned long nr_iowait(void)

unsigned long nr_iowait_cpu(void)
{
- struct rq *this = this_rq();
+ int cpu = get_cpu();
+ struct rq *this = cpu_rq(cpu);
+ put_cpu();
+
return atomic_read(&this->nr_iowait);
}

--
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/