2004-11-04 23:19:44

by Jesse Barnes

[permalink] [raw]
Subject: [PATCH] remove contention on profile_lock

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: John Levon <[email protected]>
Signed-off-by: Jesse Barnes <[email protected]>

Thanks,
Jesse


Attachments:
(No filename) (798.00 B)
remove-profile-notifier-list-5.patch (4.29 kB)
Download all attachments