> *) compute the context-switch pair time average for the system. This is
This is not a uniform time. Consider the difference between
context switch on the same hyperthread, context switch between cores
on a die, context switch between sockets, context switch between
distant numa nodes. You could have several orders of magnitude
between all those.
That would assume that the hold times are very uniform. But what happens
when you e.g. have a workload where 50% of the lock aquisitions are short
and 30% are long?
I'm a little sceptical of such "too clever" algorithms.
-Andi
--