]> git.baikalelectronics.ru Git - kernel.git/commit
percpu: allow pcpu_alloc() to be called with IRQs off
authorJiri Kosina <jkosina@suse.cz>
Wed, 28 Oct 2009 15:25:59 +0000 (00:25 +0900)
committerTejun Heo <tj@kernel.org>
Wed, 28 Oct 2009 15:25:59 +0000 (00:25 +0900)
commit0fb343a1ea43bcc2876dbcd8dbd420bbbaf0d16f
treec953c271057033b5fbc47b8ddb77c78d926c221e
parent7216a623f85875ed81cccffd86b13abf7e580271
percpu: allow pcpu_alloc() to be called with IRQs off

pcpu_alloc() and pcpu_extend_area_map() perform a series of
spin_lock_irq()/spin_unlock_irq() calls, which make them unsafe
with respect to being called from contexts which have IRQs off.

This patch converts the code to perform save/restore of flags instead,
making pcpu_alloc() (or __alloc_percpu() respectively) to be called
from early kernel startup stage, where IRQs are off.

This is needed for proper initialization of per-cpu rq_weight data from
sched_init().

tj: added comment explaining why irqsave/restore is used in alloc path.

Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Tejun Heo <tj@kernel.org>
mm/percpu.c