linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCHSET] sched,perf: unify tracers in sched and move perf on top of TP
@ 2010-05-04 12:38 Tejun Heo
  2010-05-04 12:38 ` [PATCH 01/12] sched: drop @cpu argument from sched_in preempt notifier Tejun Heo
                   ` (12 more replies)
  0 siblings, 13 replies; 55+ messages in thread
From: Tejun Heo @ 2010-05-04 12:38 UTC (permalink / raw)
  To: mingo, peterz, efault, avi, paulus, acme, linux-kernel

Hello, all.

This patchset does the following two things.

* 0001-0007: Unify the three tracers (tracepoints, perf_events and
  preempt/sched notifiers) in scheduler.

* 0008-0012: Move perf hooks in sched on top of tracepoints if TPs are
	     enabled.

It probably should be two separate patchsets with the first part on
top of sched/core which then gets pulled into perf branch, on top of
which the second part is applied but in the spirit of RFC I'm posting
it as a single chunk on top of mainline+perf/urgent.

This patchset contains the following 12 patches.

 0001-sched-drop-cpu-argument-from-sched_in-preempt-notifi.patch
 0002-sched-rename-preempt_notifiers-to-sched_notifiers-an.patch
 0003-perf-add-perf_event_task_migrate.patch
 0004-perf-add-rq-to-perf_event_task_sched_out.patch
 0005-perf-move-perf_event_task_sched_in-next-to-fire_sche.patch
 0006-sched-relocate-fire_sched_notifiers_out-and-trace_sc.patch
 0007-sched-coalesce-event-notifiers.patch
 0008-sched-add-switch_in-and-tick-tracepoints.patch
 0009-perf-factor-out-perf_event_switch_clones.patch
 0010-perf-make-nr_events-an-int-and-add-perf_online_mutex.patch
 0011-perf-prepare-to-move-sched-perf-functions-on-top-of-.patch
 0012-perf-move-sched-perf-functions-on-top-of-tracepoints.patch

0001-0006 move tracers in sched around and massage them here and there
to bring the related ones together and make them take the same
arguments.  The only change worth noting would be 0005 where
perf_event_task_sched_in() is moved after finish_lock_switch() which
costs the function a pair of local_irq_disable/enable() when switching
a task context in when there's a context to switch in (the unlikely
path).

0007 implements SCHED_EVENT[_RQ]() macros which can define all or any
subset of the three at once and uses them to replace all trace calls.

0008-0011 prepare to move sched perf functions on top of matching TPs
and make them enabled on demand.

0012 makes all sched perf functions TP probe functions and
enable/disable them on-demand.

The whole patchset is more or less straight forward except that the
on-demand (or rather off-demand?) disabling of perf functions in 0012
is somewhat complicated because the callback which can determine when
to turn it off is called under rq lock while unregistering requires a
thread context.  As rq lock is depended upon by workqueue, tasklet and
timer, none of those can be used directly.  It's worked around by
having a periodic timer polling for completion.

This patchset is available in the following git branch.

  git://git.kernel.org/pub/scm/linux/kernel/git/tj/misc.git sched-trace

The tree is on top of linus#master + sched/urgent for now.  Diffstat
follows.

 arch/ia64/kvm/Kconfig        |    2 
 arch/powerpc/kvm/Kconfig     |    2 
 arch/s390/kvm/Kconfig        |    2 
 arch/x86/kvm/Kconfig         |    2 
 include/linux/kvm_host.h     |    4 
 include/linux/perf_event.h   |   39 ++++-
 include/linux/preempt.h      |   48 -------
 include/linux/sched.h        |   52 +++++++
 include/trace/events/sched.h |   14 ++
 init/Kconfig                 |    2 
 kernel/perf_event.c          |  288 +++++++++++++++++++++++++++++++++++++------
 kernel/sched.c               |  175 ++++++++++++++------------
 virt/kvm/kvm_main.c          |   28 +---
 13 files changed, 459 insertions(+), 199 deletions(-)

Thanks.

--
tejun

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

end of thread, other threads:[~2010-05-10  5:49 UTC | newest]

Thread overview: 55+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-04 12:38 [RFC PATCHSET] sched,perf: unify tracers in sched and move perf on top of TP Tejun Heo
2010-05-04 12:38 ` [PATCH 01/12] sched: drop @cpu argument from sched_in preempt notifier Tejun Heo
2010-05-04 17:11   ` Peter Zijlstra
2010-05-04 12:38 ` [PATCH 02/12] sched: rename preempt_notifiers to sched_notifiers and refactor implementation Tejun Heo
2010-05-04 12:38 ` [PATCH 03/12] perf: add perf_event_task_migrate() Tejun Heo
2010-05-05  5:08   ` Frederic Weisbecker
2010-05-05  5:16     ` Tejun Heo
2010-05-05  9:11     ` Peter Zijlstra
2010-05-05  9:37       ` Tejun Heo
2010-05-05  9:50         ` Peter Zijlstra
2010-05-05  9:56           ` Tejun Heo
2010-05-04 12:38 ` [PATCH 04/12] perf: add @rq to perf_event_task_sched_out() Tejun Heo
2010-05-04 17:11   ` Peter Zijlstra
2010-05-04 17:22     ` Tejun Heo
2010-05-04 17:42       ` Peter Zijlstra
2010-05-04 18:22       ` Steven Rostedt
2010-05-04 18:26         ` Peter Zijlstra
2010-05-04 18:32           ` Steven Rostedt
2010-05-05  4:48             ` Tejun Heo
2010-05-05  9:58             ` Tejun Heo
2010-05-07 18:41           ` [tip:sched/core] sched: Remove rq argument to the tracepoints tip-bot for Peter Zijlstra
2010-05-04 12:38 ` [PATCH 05/12] perf: move perf_event_task_sched_in() next to fire_sched_notifiers_in() Tejun Heo
2010-05-04 12:38 ` [PATCH 06/12] sched: relocate fire_sched_notifiers_out() and trace_sched_switch() Tejun Heo
2010-05-04 12:38 ` [PATCH 07/12] sched: coalesce event notifiers Tejun Heo
2010-05-04 12:38 ` [PATCH 08/12] sched: add switch_in and tick tracepoints Tejun Heo
2010-05-04 12:38 ` [PATCH 09/12] perf: factor out perf_event_switch_clones() Tejun Heo
2010-05-04 12:38 ` [PATCH 10/12] perf: make nr_events an int and add perf_online_mutex to protect it Tejun Heo
2010-05-04 12:38 ` [PATCH 11/12] perf: prepare to move sched perf functions on top of tracepoints Tejun Heo
2010-05-04 12:38 ` [PATCH 12/12] perf: " Tejun Heo
2010-05-04 17:29 ` [RFC PATCHSET] sched,perf: unify tracers in sched and move perf on top of TP Peter Zijlstra
2010-05-05  5:00   ` Tejun Heo
2010-05-05  9:06     ` Peter Zijlstra
2010-05-05  9:32       ` Tejun Heo
2010-05-05  9:51         ` Peter Zijlstra
2010-05-05  9:54           ` Tejun Heo
2010-05-05 11:38             ` Peter Zijlstra
2010-05-05 12:28               ` Tejun Heo
2010-05-05 16:55                 ` Ingo Molnar
2010-05-05 18:12                   ` Peter Zijlstra
2010-05-05 18:16                     ` Peter Zijlstra
2010-05-05 18:30                       ` Frederic Weisbecker
2010-05-06  6:28                         ` Ingo Molnar
2010-05-06  7:11                           ` Tejun Heo
2010-05-06  8:27                             ` Ingo Molnar
2010-05-06  8:41                               ` Tejun Heo
2010-05-06  8:18                           ` Avi Kivity
2010-05-06  6:31                     ` Ingo Molnar
2010-05-06  7:04                       ` Peter Zijlstra
2010-05-06  7:11                         ` Ingo Molnar
2010-05-06  7:29                           ` Tejun Heo
2010-05-06  7:33                             ` Tejun Heo
2010-05-05 12:33               ` Avi Kivity
2010-05-05 13:09                 ` Tejun Heo
2010-05-10  5:20             ` Paul Mackerras
2010-05-10  5:48               ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).