• Jesse Barnes's avatar
    [PATCH] remove contention on profile_lock · a370025d
    Jesse Barnes authored
    profile_hook unconditionally takes a read lock on profile_lock if kernel
    profiling is enabled.  The lock protects the profile_hook notifier chain
    from being written while it's being called.  The routine profile_hook is
    called in a very hot path though: every timer tick on every CPU.  As you
    can imagine, on a large system, this makes the cacheline containing
    profile_lock pretty hot.  Since oprofile was the only user of the
    profile_hook, I removed the notifier chain altogether in favor of a simple
    function pointer with the help of John Levon.  This removes all of the
    contention in the hot path since the variable is very seldom written and
    simplifies things a little to boot.
    Acked-by: default avatarJohn Levon <levon@movementarian.org>
    Signed-off-by: default avatarJesse Barnes <jbarnes@sgi.com>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    a370025d
timer_int.c 938 Bytes