History

sched: Consolidate open coded preemptible() checks

preempt_schedule() and preempt_schedule_context() open code their preemptability checks. Use the standard API instead for consolidation.

Frederic Weisbecker committed 13 years ago

Commit fbb00b51 parent ae920eb2 files · +2 −5Browse files

Unified · Split

2 files
  1. kernel/context_tracking.c +1 −2
  2. kernel/sched/core.c +1 −3
kernel/context_tracking.c+1−2
@@ -87,10 +87,9 @@ void user_enter(void) · 86 unmodified lines
87 */87 */
88void __sched notrace preempt_schedule_context(void)88void __sched notrace preempt_schedule_context(void)
89{89{
90 struct thread_info *ti = current_thread_info();
91 enum ctx_state prev_ctx;90 enum ctx_state prev_ctx;
92 91
93 if (likely(ti->preempt_count || irqs_disabled()))92 if (likely(!preemptible()))
94 return;93 return;
95 94
96 /*95 /*
kernel/sched/core.c+1−3
@@ -2510,13 +2510,11 @@ void __sched schedule_preempt_disabled(void) · 2509 unmodified lines
2510 */2510 */
2511asmlinkage void __sched notrace preempt_schedule(void)2511asmlinkage void __sched notrace preempt_schedule(void)
2512{2512{
2513 struct thread_info *ti = current_thread_info();
2514
2515 /*2513 /*
2516 * If there is a non-zero preempt_count or interrupts are disabled,2514 * If there is a non-zero preempt_count or interrupts are disabled,
2517 * we do not want to preempt the current task. Just return..2515 * we do not want to preempt the current task. Just return..
2518 */2516 */
2519 if (likely(ti->preempt_count || irqs_disabled()))2517 if (likely(!preemptible()))
2520 return;2518 return;
2521 2519
2522 do {2520 do {