Re: [PATCH RFC 1/3] mutex: Make more scalable by doing less atomicoperations

From: Ingo Molnar
Date: Thu Apr 11 2013 - 05:07:35 EST

* Waiman Long <Waiman.Long@xxxxxx> wrote:

> BTW, I have also been thinking about extracting the spinlock out from the mutex
> structure for some busy mutex by adding a pointer to an external auxiliary
> structure (separately allocated at init time). The idea is to use the external
> spinlock if available. Otherwise, the internal one will be used. That should
> reduce cacheline contention for some of the busiest mutex. The spinner queuing
> tickets can be in the external structure too. However, it requires a one line
> change in each of the mutex initialization code. I haven't actually made the
> code change and try it yet, but that is something that I am thinking of doing
> when I have time.

I'm not sure per mutex allocations are a really good idea - we like our locking
primitives to be simple, embeddable into data structures and allocatable together
with the data structure with no other separate memory footprint.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at