Re: [PATCH 1/4] task_work: make task_work_add() lockless

2012-09-24 Thread Oleg Nesterov
On 09/24, Geert Uytterhoeven wrote: > > On Sun, Aug 26, 2012 at 9:12 PM, Oleg Nesterov wrote: > > + while ((work = ACCESS_ONCE(*pprev))) { > > + read_barrier_depends(); Hmm. This should be smp_read_barrier_depends(), but this doesn't matter. > Woops, h8300 doesn't have read_b

Re: [PATCH 1/4] task_work: make task_work_add() lockless

2012-09-24 Thread Geert Uytterhoeven
On Sun, Aug 26, 2012 at 9:12 PM, Oleg Nesterov wrote: > Change task_works to use llist-like code to avoid pi_lock > in task_work_add(), this makes it useable under rq->lock. > > task_work_cancel() and task_work_run() still use pi_lock > to synchronize with each other. > > Suggested-by: Peter Zijls

[PATCH 1/4] task_work: make task_work_add() lockless

2012-08-26 Thread Oleg Nesterov
Change task_works to use llist-like code to avoid pi_lock in task_work_add(), this makes it useable under rq->lock. task_work_cancel() and task_work_run() still use pi_lock to synchronize with each other. Suggested-by: Peter Zijlstra Signed-off-by: Oleg Nesterov --- kernel/task_work.c | 95 +