sched/core: Fix set_user_nice()
authorPeter Zijlstra <peterz@infradead.org>
Tue, 20 Sep 2016 20:06:01 +0000 (22:06 +0200)
committerIngo Molnar <mingo@kernel.org>
Fri, 30 Sep 2016 09:03:28 +0000 (11:03 +0200)
commit49bd21efe7fc84f9c82c8475b8ff6f8b865b1692
tree93f1620565f6479e5dceb3d1133dba73390edebb
parentb2bf6c314e3a9e227925240d92ecd6e9b0110170
sched/core: Fix set_user_nice()

Almost all scheduler functions update state with the following
pattern:

if (queued)
dequeue_task(rq, p, DEQUEUE_SAVE);
if (running)
put_prev_task(rq, p);

/* update state */

if (queued)
enqueue_task(rq, p, ENQUEUE_RESTORE);
if (running)
set_curr_task(rq, p);

set_user_nice() however misses the running part, cure this.

This was found by asserting we never enqueue 'current'.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/sched/core.c