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

From: Peter Zijlstra
Date: Tue Oct 09 2012 - 07:05:37 EST


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
> the callbacks (the caller checks ->task_works != NULL), I do not
> think this can add any noticeable speedup.

Yeah, I agree, the patch doesn't seem worth the trouble. It makes tricky
code unreadable at best.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/