Re: Linux 3.19-rc5

From: Linus Torvalds
Date: Fri Feb 06 2015 - 11:02:46 EST


On Fri, Feb 6, 2015 at 3:50 AM, Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
>
> Also, set_current_state(TASK_RUNNING) is almost always pointless, nobody
> cares about that barrier, so make it go away.

I'd rather not mix this with the patch, and wonder if we should just
do that globally with some preprocessor magic. We do have a fair
number of "set_current_state(TASK_RUNNING)" and at least for the
*documented* reason for the memory barrier, all of them could/should
be barrier-less.

So something like

if (__is_constant_p(state) && state == TASK_RUNNING)
tsk->state = state;
else
set_mb(tsk->state, state);

might be more general solution than randomly doing one at a time when
changing code around it..

Linus
--
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/