]> Git Repo - linux.git/commit
perf: Store active software events in a hashlist
authorFrederic Weisbecker <[email protected]>
Mon, 5 Apr 2010 13:35:57 +0000 (15:35 +0200)
committerFrederic Weisbecker <[email protected]>
Wed, 14 Apr 2010 16:20:33 +0000 (18:20 +0200)
commit76e1d9047e4edefb8ada20aa90d5762306082bd6
tree60384bd206878d2c440e07b33d97b1bb00a103dc
parentc05556421742eb47f80301767653a4bcb19de9de
perf: Store active software events in a hashlist

Each time a software event triggers, we need to walk through
the entire list of events from the current cpu and task contexts
to retrieve a running perf event that matches.
We also need to check a matching perf event is actually counting.

This walk is wasteful and makes the event fast path scaling
down with a growing number of events running on the same
contexts.

To solve this, we store the running perf events in a hashlist to
get an immediate access to them against their type:event_id when
they trigger.

v2: - Fix SWEVENT_HLIST_SIZE definition (and re-learn some basic
      maths along the way)
    - Only allocate hlist for online cpus, but keep track of the
      refcount on offline possible cpus too, so that we allocate it
      if needed when it becomes online.
    - Drop the kref use as it's not adapted to our tricks anymore.

v3: - Fix bad refcount check (address instead of value). Thanks to
      Eric Dumazet who spotted this.
    - While exiting cpu, move the hlist release out of the IPI path
      to lock the hlist mutex sanely.

Signed-off-by: Frederic Weisbecker <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Ingo Molnar <[email protected]>
include/linux/perf_event.h
kernel/perf_event.c
This page took 0.05393 seconds and 4 git commands to generate.