diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2011-03-21 08:32:17 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2012-03-01 04:28:04 -0500 |
commit | ba74c1448f127649046615ec017bded7b2a76f29 (patch) | |
tree | 33eceaf0c4b35aca095e3e1a678bdbab23006650 | |
parent | bd2f55361f18347e890d52ff9cfd8895455ec11b (diff) |
sched/rt: Document scheduler related skip-resched-check sites
Create a distinction between scheduler related preempt_enable_no_resched()
calls and the nearly one hundred other places in the kernel that do not
want to reschedule, for one reason or another.
This distinction matters for -rt, where the scheduler and the non-scheduler
preempt models (and checks) are different. For upstream it's purely
documentational.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/n/tip-gs88fvx2mdv5psnzxnv575ke@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | arch/powerpc/kernel/idle.c | 2 | ||||
-rw-r--r-- | arch/sparc/kernel/process_64.c | 2 | ||||
-rw-r--r-- | include/linux/preempt.h | 5 | ||||
-rw-r--r-- | kernel/sched/core.c | 6 | ||||
-rw-r--r-- | kernel/softirq.c | 4 |
5 files changed, 11 insertions, 8 deletions
diff --git a/arch/powerpc/kernel/idle.c b/arch/powerpc/kernel/idle.c index 65035141552b..c97fc60c790c 100644 --- a/arch/powerpc/kernel/idle.c +++ b/arch/powerpc/kernel/idle.c | |||
@@ -102,7 +102,7 @@ void cpu_idle(void) | |||
102 | rcu_idle_exit(); | 102 | rcu_idle_exit(); |
103 | tick_nohz_idle_exit(); | 103 | tick_nohz_idle_exit(); |
104 | if (cpu_should_die()) { | 104 | if (cpu_should_die()) { |
105 | preempt_enable_no_resched(); | 105 | sched_preempt_enable_no_resched(); |
106 | cpu_die(); | 106 | cpu_die(); |
107 | } | 107 | } |
108 | schedule_preempt_disabled(); | 108 | schedule_preempt_disabled(); |
diff --git a/arch/sparc/kernel/process_64.c b/arch/sparc/kernel/process_64.c index ab9a29268213..06b5b5fc20c7 100644 --- a/arch/sparc/kernel/process_64.c +++ b/arch/sparc/kernel/process_64.c | |||
@@ -106,7 +106,7 @@ void cpu_idle(void) | |||
106 | 106 | ||
107 | #ifdef CONFIG_HOTPLUG_CPU | 107 | #ifdef CONFIG_HOTPLUG_CPU |
108 | if (cpu_is_offline(cpu)) { | 108 | if (cpu_is_offline(cpu)) { |
109 | preempt_enable_no_resched(); | 109 | sched_preempt_enable_no_resched(); |
110 | cpu_play_dead(); | 110 | cpu_play_dead(); |
111 | } | 111 | } |
112 | #endif | 112 | #endif |
diff --git a/include/linux/preempt.h b/include/linux/preempt.h index 58969b2a8a82..5a710b9c578e 100644 --- a/include/linux/preempt.h +++ b/include/linux/preempt.h | |||
@@ -48,12 +48,14 @@ do { \ | |||
48 | barrier(); \ | 48 | barrier(); \ |
49 | } while (0) | 49 | } while (0) |
50 | 50 | ||
51 | #define preempt_enable_no_resched() \ | 51 | #define sched_preempt_enable_no_resched() \ |
52 | do { \ | 52 | do { \ |
53 | barrier(); \ | 53 | barrier(); \ |
54 | dec_preempt_count(); \ | 54 | dec_preempt_count(); \ |
55 | } while (0) | 55 | } while (0) |
56 | 56 | ||
57 | #define preempt_enable_no_resched() sched_preempt_enable_no_resched() | ||
58 | |||
57 | #define preempt_enable() \ | 59 | #define preempt_enable() \ |
58 | do { \ | 60 | do { \ |
59 | preempt_enable_no_resched(); \ | 61 | preempt_enable_no_resched(); \ |
@@ -92,6 +94,7 @@ do { \ | |||
92 | #else /* !CONFIG_PREEMPT_COUNT */ | 94 | #else /* !CONFIG_PREEMPT_COUNT */ |
93 | 95 | ||
94 | #define preempt_disable() do { } while (0) | 96 | #define preempt_disable() do { } while (0) |
97 | #define sched_preempt_enable_no_resched() do { } while (0) | ||
95 | #define preempt_enable_no_resched() do { } while (0) | 98 | #define preempt_enable_no_resched() do { } while (0) |
96 | #define preempt_enable() do { } while (0) | 99 | #define preempt_enable() do { } while (0) |
97 | 100 | ||
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 73022395c00e..643cc37fcb23 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
@@ -3220,7 +3220,7 @@ need_resched: | |||
3220 | 3220 | ||
3221 | post_schedule(rq); | 3221 | post_schedule(rq); |
3222 | 3222 | ||
3223 | preempt_enable_no_resched(); | 3223 | sched_preempt_enable_no_resched(); |
3224 | if (need_resched()) | 3224 | if (need_resched()) |
3225 | goto need_resched; | 3225 | goto need_resched; |
3226 | } | 3226 | } |
@@ -3253,7 +3253,7 @@ EXPORT_SYMBOL(schedule); | |||
3253 | */ | 3253 | */ |
3254 | void __sched schedule_preempt_disabled(void) | 3254 | void __sched schedule_preempt_disabled(void) |
3255 | { | 3255 | { |
3256 | preempt_enable_no_resched(); | 3256 | sched_preempt_enable_no_resched(); |
3257 | schedule(); | 3257 | schedule(); |
3258 | preempt_disable(); | 3258 | preempt_disable(); |
3259 | } | 3259 | } |
@@ -4486,7 +4486,7 @@ SYSCALL_DEFINE0(sched_yield) | |||
4486 | __release(rq->lock); | 4486 | __release(rq->lock); |
4487 | spin_release(&rq->lock.dep_map, 1, _THIS_IP_); | 4487 | spin_release(&rq->lock.dep_map, 1, _THIS_IP_); |
4488 | do_raw_spin_unlock(&rq->lock); | 4488 | do_raw_spin_unlock(&rq->lock); |
4489 | preempt_enable_no_resched(); | 4489 | sched_preempt_enable_no_resched(); |
4490 | 4490 | ||
4491 | schedule(); | 4491 | schedule(); |
4492 | 4492 | ||
diff --git a/kernel/softirq.c b/kernel/softirq.c index 79b524767a24..f268369ebe1f 100644 --- a/kernel/softirq.c +++ b/kernel/softirq.c | |||
@@ -353,7 +353,7 @@ void irq_exit(void) | |||
353 | tick_nohz_irq_exit(); | 353 | tick_nohz_irq_exit(); |
354 | #endif | 354 | #endif |
355 | rcu_irq_exit(); | 355 | rcu_irq_exit(); |
356 | preempt_enable_no_resched(); | 356 | sched_preempt_enable_no_resched(); |
357 | } | 357 | } |
358 | 358 | ||
359 | /* | 359 | /* |
@@ -759,7 +759,7 @@ static int run_ksoftirqd(void * __bind_cpu) | |||
759 | if (local_softirq_pending()) | 759 | if (local_softirq_pending()) |
760 | __do_softirq(); | 760 | __do_softirq(); |
761 | local_irq_enable(); | 761 | local_irq_enable(); |
762 | preempt_enable_no_resched(); | 762 | sched_preempt_enable_no_resched(); |
763 | cond_resched(); | 763 | cond_resched(); |
764 | preempt_disable(); | 764 | preempt_disable(); |
765 | rcu_note_context_switch((long)__bind_cpu); | 765 | rcu_note_context_switch((long)__bind_cpu); |