public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 00/15] Nohz task support
@ 2010-12-20 15:24 Frederic Weisbecker
  2010-12-20 15:24 ` [RFC PATCH 01/15] nohz_task: New mask for cpus having nohz task Frederic Weisbecker
                   ` (16 more replies)
  0 siblings, 17 replies; 98+ messages in thread
From: Frederic Weisbecker @ 2010-12-20 15:24 UTC (permalink / raw)
  To: LKML
  Cc: LKML, Frederic Weisbecker, Thomas Gleixner, Peter Zijlstra,
	Paul E . McKenney, Steven Rostedt, Lai Jiangshan, Andrew Morton,
	Anton Blanchard, Tim Pepper

The timer interrupt handles several things like preemption,
timekeeping, rcu, etc...

However it appears that sometimes it is simply useless like
when a task runs alone and even more when it is in userspace
as RCU doesn't need it at all in such case.

It appears that HPC workload would get some win of such timer
deactivation, and perhaps also the Real Time world as this
minimizes the critical sections due to way less interrupts to
handle.

It works through the procfs interface:

echo 1 > /proc/self/nohz

With the following constraints:

- A cpu can have only one nohz task
- A nohz task must be affine to a single CPU. That affinity can't
change while the task is in this mode
- This must be written in /proc/self only, however further
plans to allow than to be set from another task should be
possible.

You need to migrate irqs manually from userspace, same
for tasks. If a non nohz task is running on the same cpu
than a nohz task, the tick can't be stopped.

I can provide you the tools I'm using to test it if you
want.

Note this depends on the rcu spurious softirq fixes in Paul's
queue for .38

I'm also using a hack to make init affine to the first CPU
on boot so that all userspace tasks end up to the first CPU
except kernel threads and tasks that change their affinity
explicitly (this is not sched isolation). This avoids any
task to set up timers to random CPUs on which we'll later
want to run a nohz task. But probably this can be fixed
with another way, like unbinding these timers or so. This
probably require a detailed audit.

Any comments are welcome.

You can fetch from:

git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing.git
	sched/nohz-task

Frederic Weisbecker (15):
  nohz_task: New mask for cpus having nohz task
  nohz_task: Avoid nohz task cpu as non-idle timer target
  nohz_task: Make tick stop and restart callable outside idle
  nohz_task: Stop the tick when the nohz task runs alone
  nohz_task: Restart the tick when another task compete on the cpu
  nohz_task: Keep the tick if rcu needs it
  nohz_task: Restart tick when RCU forces nohz task cpu quiescent state
  smp: Don't warn if irq are disabled but we don't wait for the ipi
  rcu: Make rcu_enter,exit_nohz() callable from irq
  nohz_task: Enter in extended quiescent state when in userspace
  x86: Nohz task support
  clocksource: Ignore nohz task cpu in clocksource watchdog
  sched: Protect nohz task cpu affinity
  nohz_task: Clear nohz task attribute on exit()
  nohz_task: Procfs interface

 arch/Kconfig                       |    7 ++
 arch/x86/Kconfig                   |    1 +
 arch/x86/include/asm/thread_info.h |   10 ++-
 arch/x86/kernel/ptrace.c           |   10 +++
 arch/x86/kernel/traps.c            |   22 ++++--
 arch/x86/mm/fault.c                |   13 +++-
 fs/proc/base.c                     |   80 +++++++++++++++++++++
 include/linux/cpumask.h            |    8 ++
 include/linux/rcupdate.h           |    1 +
 include/linux/sched.h              |    9 +++
 include/linux/tick.h               |   26 +++++++-
 kernel/cpu.c                       |   15 ++++
 kernel/exit.c                      |    3 +
 kernel/rcutree.c                   |  127 +++++++++++++++------------------
 kernel/rcutree.h                   |   12 ++--
 kernel/sched.c                     |  135 ++++++++++++++++++++++++++++++++++-
 kernel/smp.c                       |    2 +-
 kernel/softirq.c                   |    4 +-
 kernel/time/Kconfig                |    7 ++
 kernel/time/clocksource.c          |   10 ++-
 kernel/time/tick-sched.c           |  138 +++++++++++++++++++++++++++++++++--
 21 files changed, 535 insertions(+), 105 deletions(-)

-- 
1.7.3.2


^ permalink raw reply	[flat|nested] 98+ messages in thread

end of thread, other threads:[~2010-12-24 12:29 UTC | newest]

Thread overview: 98+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-20 15:24 [RFC PATCH 00/15] Nohz task support Frederic Weisbecker
2010-12-20 15:24 ` [RFC PATCH 01/15] nohz_task: New mask for cpus having nohz task Frederic Weisbecker
2010-12-24  8:00   ` Lai Jiangshan
2010-12-24  8:19     ` Dario Faggioli
2010-12-24 12:29       ` Frederic Weisbecker
2010-12-20 15:24 ` [RFC PATCH 02/15] nohz_task: Avoid nohz task cpu as non-idle timer target Frederic Weisbecker
2010-12-20 15:47   ` Peter Zijlstra
2010-12-20 16:06     ` Steven Rostedt
2010-12-20 16:12       ` Peter Zijlstra
2010-12-21  0:20         ` Frederic Weisbecker
2010-12-21  7:51           ` Peter Zijlstra
2010-12-21 13:58             ` Frederic Weisbecker
2010-12-21  0:13     ` Frederic Weisbecker
2010-12-21  7:50       ` Peter Zijlstra
2010-12-21 13:52         ` Frederic Weisbecker
2010-12-20 15:24 ` [RFC PATCH 03/15] nohz_task: Make tick stop and restart callable outside idle Frederic Weisbecker
2010-12-20 15:48   ` Peter Zijlstra
2010-12-20 16:19     ` Steven Rostedt
2010-12-20 16:25       ` Peter Zijlstra
2010-12-21  1:34         ` Frederic Weisbecker
2010-12-20 15:24 ` [RFC PATCH 04/15] nohz_task: Stop the tick when the nohz task runs alone Frederic Weisbecker
2010-12-20 15:51   ` Peter Zijlstra
2010-12-20 23:37     ` Frederic Weisbecker
2010-12-21  7:35       ` Peter Zijlstra
2010-12-21 13:22         ` Frederic Weisbecker
2010-12-21 14:34           ` Steven Rostedt
2010-12-21 15:14             ` Frederic Weisbecker
2010-12-20 15:24 ` [RFC PATCH 05/15] nohz_task: Restart the tick when another task compete on the cpu Frederic Weisbecker
2010-12-20 15:53   ` Peter Zijlstra
2010-12-20 23:39     ` Frederic Weisbecker
2010-12-20 15:24 ` [RFC PATCH 06/15] nohz_task: Keep the tick if rcu needs it Frederic Weisbecker
2010-12-20 15:58   ` Peter Zijlstra
2010-12-20 23:49     ` Frederic Weisbecker
2010-12-21  0:12       ` Jonathan Corbet
2010-12-21  2:10         ` Frederic Weisbecker
2010-12-21  8:10     ` Paul E. McKenney
2010-12-20 15:24 ` [RFC PATCH 07/15] nohz_task: Restart tick when RCU forces nohz task cpu quiescent state Frederic Weisbecker
2010-12-20 16:02   ` Peter Zijlstra
2010-12-20 23:52     ` Frederic Weisbecker
2010-12-21  7:41       ` Peter Zijlstra
2010-12-21 13:28         ` Frederic Weisbecker
2010-12-21 15:35         ` Paul E. McKenney
2010-12-20 15:24 ` [RFC PATCH 08/15] smp: Don't warn if irq are disabled but we don't wait for the ipi Frederic Weisbecker
2010-12-20 16:03   ` Peter Zijlstra
2010-12-21  0:02     ` Frederic Weisbecker
2010-12-20 15:24 ` [RFC PATCH 09/15] rcu: Make rcu_enter,exit_nohz() callable from irq Frederic Weisbecker
2010-12-21 19:26   ` Paul E. McKenney
2010-12-21 19:27     ` Frederic Weisbecker
2010-12-20 15:24 ` [RFC PATCH 10/15] nohz_task: Enter in extended quiescent state when in userspace Frederic Weisbecker
2010-12-20 16:18   ` Peter Zijlstra
2010-12-21  1:27     ` Frederic Weisbecker
2010-12-21  8:04       ` Peter Zijlstra
2010-12-21 14:06         ` Frederic Weisbecker
2010-12-21 19:28   ` Paul E. McKenney
2010-12-21 21:49     ` Frederic Weisbecker
2010-12-22  2:20       ` Paul E. McKenney
2010-12-20 15:24 ` [RFC PATCH 11/15] x86: Nohz task support Frederic Weisbecker
2010-12-20 16:23   ` Peter Zijlstra
2010-12-21  1:30     ` Frederic Weisbecker
2010-12-21  8:05       ` Peter Zijlstra
2010-12-21 14:19         ` Frederic Weisbecker
2010-12-21 15:12         ` Frederic Weisbecker
2010-12-20 15:24 ` [RFC PATCH 12/15] clocksource: Ignore nohz task cpu in clocksource watchdog Frederic Weisbecker
2010-12-20 16:27   ` Peter Zijlstra
2010-12-21  1:40     ` Frederic Weisbecker
2010-12-20 15:24 ` [RFC PATCH 13/15] sched: Protect nohz task cpu affinity Frederic Weisbecker
2010-12-20 16:28   ` Peter Zijlstra
2010-12-20 17:05     ` Steven Rostedt
2010-12-21  1:55       ` Frederic Weisbecker
2010-12-20 15:24 ` [RFC PATCH 14/15] nohz_task: Clear nohz task attribute on exit() Frederic Weisbecker
2010-12-20 16:30   ` Peter Zijlstra
2010-12-21  1:48     ` Frederic Weisbecker
2010-12-21  8:07       ` Peter Zijlstra
2010-12-21 14:22         ` Frederic Weisbecker
2010-12-20 15:24 ` [RFC PATCH 15/15] nohz_task: Procfs interface Frederic Weisbecker
2010-12-20 15:42   ` Peter Zijlstra
2010-12-20 15:57     ` Frederic Weisbecker
2010-12-20 16:16       ` Peter Zijlstra
2010-12-21  1:24         ` Frederic Weisbecker
2010-12-21  8:14           ` Peter Zijlstra
2010-12-21 14:00             ` Avi Kivity
2010-12-21 17:05               ` Frederic Weisbecker
2010-12-21 18:17                 ` Avi Kivity
2010-12-21 21:08                   ` Frederic Weisbecker
2010-12-22  9:22                     ` Avi Kivity
2010-12-22  9:51                       ` Peter Zijlstra
2010-12-22 20:41                         ` Frederic Weisbecker
2010-12-21 14:26             ` Frederic Weisbecker
2010-12-20 15:44 ` [RFC PATCH 00/15] Nohz task support Steven Rostedt
2010-12-20 23:33   ` Frederic Weisbecker
2010-12-21  1:36     ` Steven Rostedt
2010-12-21  2:15       ` Frederic Weisbecker
2010-12-21  7:34     ` Peter Zijlstra
2010-12-21 13:13       ` Frederic Weisbecker
2010-12-21 13:56     ` Avi Kivity
2010-12-21 17:01       ` Frederic Weisbecker
2010-12-20 16:35 ` Peter Zijlstra
2010-12-21  1:53   ` Frederic Weisbecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox