From: Matt H. <mat...@us...> - 2006-05-23 04:59:07
|
On Mon, 2006-05-22 at 03:05 -0700, Paul Jackson wrote: > Jes wrote: > > I think the theory is that for subsystems that are only used 'sometimes' > > this could be a benefit. This enables GPL'd modules too. > Ok - interesting theory. > > I guess you're saying that for such subsystems, if enough of them > aren't used on a given day on a given system, then the complete absence > of any call to them in fork or exit would more than make up in CPU > cycles and cache lines for the higher cost of calling those subsystems > that really are in use. > > That is, for example, it could be cheaper to do say 5 indirect calls > that are actually needed, as opposed to 25 old fashioned calls of which > 20 are useless. > > Do you have any idea what is the relative cost, in CPU cycles, pipeline > stalls or cache line misses, of an indirect call via a notifier, in > comparison to an old-fashioned direct call? I don't. Perhaps Jes does. These measurements are highly dependent on the combination of hardware (processor, cache, chipset, RAM) and compiler used. Are they worth considering if the we can't distinguish these effects from the rest of the noise in the fork/exit/etc paths? > If we knew that, we could estimate whether we had enough candidates > for these indirect calls in fork or exit to make all this payoff in > this particular way. I think the ability to add modules that use these paths is sufficient reason to add the notifier chain. Regardless, I intend to run some benchmarks and report the resulting differences, if any. > By the way, the cpuset_fork and cpuset_exit calls, at least as > currently coded, really do need to be called, on any system with > CONFIG_CPUSETS enabled, or else the reference 'count' on the top_cpuset > will get messed up, and risk crashing the kernel if cpusets are > subsequently made real use of. That cpuset reference 'count' is > maintained by those cpuset_*() callouts, and the cpuset code relies on > this being done. We can guarantee that it will be called. cpusets would be registered from inside main.c's start_kernel() and hence would be one of the first 5 or so notifier blocks on the chain. None of these blocks have functions that would prevent the remainder of the chain from being notified. Cheers, -Matt Helsley |