Re: [patch 0/9] mutex subsystem, -V4

From: David Lang
Date: Mon Dec 26 2005 - 19:38:40 EST


On Mon, 26 Dec 2005, Andrew Morton wrote:

Arjan van de Ven <arjan@xxxxxxxxxxxxx> wrote:


hm. 16 CPUs hitting the same semaphore at great arrival rates. The cost
of a short spin is much less than the cost of a sleep/wakeup. The machine
was doing 100,000 - 200,000 context switches per second.

interesting.. this might be a good indication that a "spin a bit first"
mutex slowpath for some locks might be worth implementing...

If we see a workload which is triggering such high context switch rates,
maybe. But I don't think we've seen any such for a long time.


how does 'spin a bit' interact with virutal CPU's (HT and equivalent).

it would seem to me that on a multi true-core system the spin-a-bit is a win becouse it allows the other CPU's to release the lock, but on virtual CPU's all the spinning would do is to delay the other virtual CPU's running and therefor delay the lock getting released.

David Lang

--
There are two ways of constructing a software design. One way is to make it so simple that there are obviously no deficiencies. And the other way is to make it so complicated that there are no obvious deficiencies.
-- C.A.R. Hoare

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/