]> git.baikalelectronics.ru Git - kernel.git/commit
sched: access local runqueue directly in single_task_running
authorDominik Dingel <dingel@linux.vnet.ibm.com>
Fri, 18 Sep 2015 09:27:45 +0000 (11:27 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 18 Sep 2015 11:47:59 +0000 (13:47 +0200)
commit5470f3cb534232bae5bb628f2809ec37bab9c7f4
treee2d7d478433a78a135df3aa575cfad98a34c950a
parentf39daf8a276bd7916f81893c6516ed8b00d4ffd3
sched: access local runqueue directly in single_task_running

Commit e45e69c015b3 ("sched: Add function single_task_running to let a task
check if it is the only task running on a cpu") referenced the current
runqueue with the smp_processor_id.  When CONFIG_DEBUG_PREEMPT is enabled,
that is only allowed if preemption is disabled or the currrent task is
bound to the local cpu (e.g. kernel worker).

With commit c8fe959626af ("kvm: add halt_poll_ns module parameter") KVM
calls single_task_running. If CONFIG_DEBUG_PREEMPT is enabled that
generates a lot of kernel messages.

To avoid adding preemption in that cases, as it would limit the usefulness,
we change single_task_running to access directly the cpu local runqueue.

Cc: Tim Chen <tim.c.chen@linux.intel.com>
Suggested-by: Peter Zijlstra <peterz@infradead.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: <stable@vger.kernel.org>
Fixes: e45e69c015b3acb76dec7e13da51a99f75cccbf2
Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
kernel/sched/core.c