sched/core: Avoid _cond_resched() for PREEMPT=y
On fully preemptible kernels _cond_resched() is pointless, so avoid emitting any code for it. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mikulas Patocka <mpatocka@redhat.com> Cc: Oleg Nesterov <oleg@redhat.com> 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>
This commit is contained in:

committed by
Ingo Molnar

parent
9af6528ee9
commit
35a773a079
@@ -4883,6 +4883,7 @@ SYSCALL_DEFINE0(sched_yield)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifndef CONFIG_PREEMPT
|
||||
int __sched _cond_resched(void)
|
||||
{
|
||||
if (should_resched(0)) {
|
||||
@@ -4892,6 +4893,7 @@ int __sched _cond_resched(void)
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(_cond_resched);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* __cond_resched_lock() - if a reschedule is pending, drop the given lock,
|
||||
|
Reference in New Issue
Block a user