path: root/block/blk-softirq.c
diff options
authorPeter Zijlstra <>2009-02-25 13:59:47 +0100
committerIngo Molnar <>2009-02-25 14:13:43 +0100
commit8969a5ede0f9e17da4b943712429aef2c9bcd82b (patch)
tree73fa99a1f5596429051b65d355694c90b0e15539 /block/blk-softirq.c
parent15d0d3b3371227f846b9f644547fde081c7e1c0c (diff)
generic-ipi: remove kmalloc()
Remove the use of kmalloc() from the smp_call_function_*() calls. Steven's generic-ipi patch (d7240b98: generic-ipi: use per cpu data for single cpu ipi calls) started the discussion on the use of kmalloc() in this code and fixed the smp_call_function_single(.wait=0) fallback case. In this patch we complete this by also providing means for the _many() call, which fully removes the need for kmalloc() in this code. The problem with the _many() call is that other cpus might still be observing our entry when we're done with it. It solved this by dynamically allocating data elements and RCU-freeing it. We solve it by using a single per-cpu entry which provides static storage and solves one half of the problem (avoiding referencing freed data). The other half, ensuring the queue iteration it still possible, is done by placing re-used entries at the head of the list. This means that if someone was still iterating that entry when it got moved, he will now re-visit the entries on the list he had already seen, but avoids skipping over entries like would have happened had we placed the new entry at the end. Furthermore, visiting entries twice is not a problem, since we remove our cpu from the entry's cpumask once its called. Many thanks to Oleg for his suggestions and him poking holes in my earlier attempts. Signed-off-by: Peter Zijlstra <> Cc: Oleg Nesterov <> Cc: Linus Torvalds <> Cc: Nick Piggin <> Cc: Jens Axboe <> Cc: "Paul E. McKenney" <> Cc: Rusty Russell <> Signed-off-by: Ingo Molnar <>
Diffstat (limited to 'block/blk-softirq.c')
0 files changed, 0 insertions, 0 deletions