• Peter Zijlstra's avatar
    sched/core: Fix set_user_nice() · 49bd21ef
    Peter Zijlstra authored
    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: default avatarPeter 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: default avatarIngo Molnar <mingo@kernel.org>
    49bd21ef
core.c 216 KB