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
8787 */
8888 void __sched notrace preempt_schedule_context(void)
8989 {
90− struct thread_info *ti = current_thread_info();
9190 enum ctx_state prev_ctx;
9291
93− if (likely(ti->preempt_count || irqs_disabled()))
92+ if (likely(!preemptible()))
9493 return;
9594
9695 /*
kernel/sched/core.c+1−3
@@ -2510,13 +2510,11 @@ void __sched schedule_preempt_disabled(void) · 2509 unmodified lines
25102510 */
25112511 asmlinkage void __sched notrace preempt_schedule(void)
25122512 {
2513− struct thread_info *ti = current_thread_info();
2514−
25152513 /*
25162514 * If there is a non-zero preempt_count or interrupts are disabled,
25172515 * we do not want to preempt the current task. Just return..
25182516 */
2519− if (likely(ti->preempt_count || irqs_disabled()))
2517+ if (likely(!preemptible()))
25202518 return;
25212519
25222520 do {