diff options
| author | Ingo Molnar <mingo@kernel.org> | 2013-04-21 05:05:47 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2013-04-21 05:05:47 -0400 |
| commit | a166fcf04d848ffa09f0e831805553089f190cf4 (patch) | |
| tree | 1fc97c397238692375f1ebf7a39746188f6424db /kernel/time | |
| parent | 2727872dfe5d273f313f8a0c0dd0fcc58e96cde7 (diff) | |
| parent | 555347f6c080d2f25265f981c963605b4dd3610d (diff) | |
Merge branch 'timers/nohz-posix-timers-v2' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks into timers/nohz
Pull posix cpu timers handling on full dynticks from Frederic Weisbecker.
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/time')
| -rw-r--r-- | kernel/time/Kconfig | 1 | ||||
| -rw-r--r-- | kernel/time/tick-sched.c | 51 |
2 files changed, 52 insertions, 0 deletions
diff --git a/kernel/time/Kconfig b/kernel/time/Kconfig index 99c3f13dd478..f6a792ab4983 100644 --- a/kernel/time/Kconfig +++ b/kernel/time/Kconfig | |||
| @@ -111,6 +111,7 @@ config NO_HZ_FULL | |||
| 111 | select RCU_USER_QS | 111 | select RCU_USER_QS |
| 112 | select RCU_NOCB_CPU | 112 | select RCU_NOCB_CPU |
| 113 | select CONTEXT_TRACKING_FORCE | 113 | select CONTEXT_TRACKING_FORCE |
| 114 | select IRQ_WORK | ||
| 114 | help | 115 | help |
| 115 | Adaptively try to shutdown the tick whenever possible, even when | 116 | Adaptively try to shutdown the tick whenever possible, even when |
| 116 | the CPU is running tasks. Typically this requires running a single | 117 | the CPU is running tasks. Typically this requires running a single |
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index a76e09044f9f..884a9f302a06 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c | |||
| @@ -147,6 +147,57 @@ static void tick_sched_handle(struct tick_sched *ts, struct pt_regs *regs) | |||
| 147 | static cpumask_var_t nohz_full_mask; | 147 | static cpumask_var_t nohz_full_mask; |
| 148 | bool have_nohz_full_mask; | 148 | bool have_nohz_full_mask; |
| 149 | 149 | ||
| 150 | /* | ||
| 151 | * Re-evaluate the need for the tick on the current CPU | ||
| 152 | * and restart it if necessary. | ||
| 153 | */ | ||
| 154 | static void tick_nohz_full_check(void) | ||
| 155 | { | ||
| 156 | /* | ||
| 157 | * STUB for now, will be filled with the full tick stop/restart | ||
| 158 | * infrastructure patches | ||
| 159 | */ | ||
| 160 | } | ||
| 161 | |||
| 162 | static void nohz_full_kick_work_func(struct irq_work *work) | ||
| 163 | { | ||
| 164 | tick_nohz_full_check(); | ||
| 165 | } | ||
| 166 | |||
| 167 | static DEFINE_PER_CPU(struct irq_work, nohz_full_kick_work) = { | ||
| 168 | .func = nohz_full_kick_work_func, | ||
| 169 | }; | ||
| 170 | |||
| 171 | /* | ||
| 172 | * Kick the current CPU if it's full dynticks in order to force it to | ||
| 173 | * re-evaluate its dependency on the tick and restart it if necessary. | ||
| 174 | */ | ||
| 175 | void tick_nohz_full_kick(void) | ||
| 176 | { | ||
| 177 | if (tick_nohz_full_cpu(smp_processor_id())) | ||
| 178 | irq_work_queue(&__get_cpu_var(nohz_full_kick_work)); | ||
| 179 | } | ||
| 180 | |||
| 181 | static void nohz_full_kick_ipi(void *info) | ||
| 182 | { | ||
| 183 | tick_nohz_full_check(); | ||
| 184 | } | ||
| 185 | |||
| 186 | /* | ||
| 187 | * Kick all full dynticks CPUs in order to force these to re-evaluate | ||
| 188 | * their dependency on the tick and restart it if necessary. | ||
| 189 | */ | ||
| 190 | void tick_nohz_full_kick_all(void) | ||
| 191 | { | ||
| 192 | if (!have_nohz_full_mask) | ||
| 193 | return; | ||
| 194 | |||
| 195 | preempt_disable(); | ||
| 196 | smp_call_function_many(nohz_full_mask, | ||
| 197 | nohz_full_kick_ipi, NULL, false); | ||
| 198 | preempt_enable(); | ||
| 199 | } | ||
| 200 | |||
| 150 | int tick_nohz_full_cpu(int cpu) | 201 | int tick_nohz_full_cpu(int cpu) |
| 151 | { | 202 | { |
| 152 | if (!have_nohz_full_mask) | 203 | if (!have_nohz_full_mask) |
