Messages in this thread | | | Date | Fri, 6 Feb 2015 08:02:41 -0800 | Subject | Re: Linux 3.19-rc5 | From | Linus Torvalds <> |
| |
On Fri, Feb 6, 2015 at 3:50 AM, Peter Zijlstra <peterz@infradead.org> 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
| |