Re: [PATCH V2] task_work: avoid unneeded cmpxchg() in task_work_run()

2012-10-10 Thread Peter Zijlstra
On Wed, 2012-10-10 at 19:50 +0200, Oleg Nesterov wrote: > > But you did not answer, and I am curious. What was your original > motivation? Is xchg really faster than cmpxchg? And is this true over multiple architectures? Or are we optimizing for x86_64 (again) ? -- To unsubscribe from this

Re: [PATCH V2] task_work: avoid unneeded cmpxchg() in task_work_run()

2012-10-10 Thread Oleg Nesterov
On 10/10, Lai Jiangshan wrote: > > --- a/kernel/task_work.c > +++ b/kernel/task_work.c > @@ -52,16 +52,7 @@ void task_work_run(void) > struct callback_head *work, *head, *next; > > for (;;) { > - /* > - * work->func() can do task_work_add(), do not set > -

Re: [PATCH V2] task_work: avoid unneeded cmpxchg() in task_work_run()

2012-10-10 Thread Oleg Nesterov
On 10/10, Lai Jiangshan wrote: --- a/kernel/task_work.c +++ b/kernel/task_work.c @@ -52,16 +52,7 @@ void task_work_run(void) struct callback_head *work, *head, *next; for (;;) { - /* - * work-func() can do task_work_add(), do not set - *

Re: [PATCH V2] task_work: avoid unneeded cmpxchg() in task_work_run()

2012-10-10 Thread Peter Zijlstra
On Wed, 2012-10-10 at 19:50 +0200, Oleg Nesterov wrote: But you did not answer, and I am curious. What was your original motivation? Is xchg really faster than cmpxchg? And is this true over multiple architectures? Or are we optimizing for x86_64 (again) ? -- To unsubscribe from this list:

[PATCH V2] task_work: avoid unneeded cmpxchg() in task_work_run()

2012-10-09 Thread Lai Jiangshan
On 10/09/2012 07:04 PM, Peter Zijlstra wrote: > On Mon, 2012-10-08 at 14:38 +0200, Oleg Nesterov wrote: >> But the code looks more complex, and the only advantage is that >> non-exiting task does xchg() instead of cmpxchg(). Not sure this >> worth the trouble, in this case task_work_run() will

[PATCH V2] task_work: avoid unneeded cmpxchg() in task_work_run()

2012-10-09 Thread Lai Jiangshan
On 10/09/2012 07:04 PM, Peter Zijlstra wrote: On Mon, 2012-10-08 at 14:38 +0200, Oleg Nesterov wrote: But the code looks more complex, and the only advantage is that non-exiting task does xchg() instead of cmpxchg(). Not sure this worth the trouble, in this case task_work_run() will likey run