summaryrefslogtreecommitdiff
path: root/arch/score/mm
diff options
context:
space:
mode:
authorXiao Guangrong <xiaoguangrong@cn.fujitsu.com>2009-09-22 16:43:39 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-23 07:39:28 -0700
commit54fdade1c3332391948ec43530c02c4794a38172 (patch)
treea44cfa6888bbe702321e4d4737786e5292d72eaa /arch/score/mm
parent5c725138437837291db5c25f4a076ee852e806e3 (diff)
downloadlwn-54fdade1c3332391948ec43530c02c4794a38172.tar.gz
lwn-54fdade1c3332391948ec43530c02c4794a38172.zip
generic-ipi: make struct call_function_data lockless
This patch can remove spinlock from struct call_function_data, the reasons are below: 1: add a new interface for cpumask named cpumask_test_and_clear_cpu(), it can atomically test and clear specific cpu, we can use it instead of cpumask_test_cpu() and cpumask_clear_cpu() and no need data->lock to protect those in generic_smp_call_function_interrupt(). 2: in smp_call_function_many(), after csd_lock() return, the current's cfd_data is deleted from call_function list, so it not have race between other cpus, then cfs_data is only used in smp_call_function_many() that must disable preemption and not from a hardware interrupthandler or from a bottom half handler to call, only the correspond cpu can use it, so it not have race in current cpu, no need cfs_data->lock to protect it. 3: after 1 and 2, cfs_data->lock is only use to protect cfs_data->refs in generic_smp_call_function_interrupt(), so we can define cfs_data->refs to atomic_t, and no need cfs_data->lock any more. Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Jens Axboe <jens.axboe@oracle.com> Cc: Nick Piggin <nickpiggin@yahoo.com.au> Cc: Peter Zijlstra <peterz@infradead.org> Acked-by: Rusty Russell <rusty@rustcorp.com.au> [akpm@linux-foundation.org: use atomic_dec_return()] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/score/mm')
0 files changed, 0 insertions, 0 deletions