Re: s_lock() seems too aggressive for machines with many sockets - Mailing list pgsql-hackers

From Nils Goroll
Subject Re: s_lock() seems too aggressive for machines with many sockets
Date
Msg-id 55784FE3.6060906@schokola.de
Whole thread Raw
In response to Re: s_lock() seems too aggressive for machines with many sockets  (Andres Freund <andres@anarazel.de>)
Responses Re: s_lock() seems too aggressive for machines with many sockets
List pgsql-hackers
On 10/06/15 16:20, Andres Freund wrote:
> That's precisely what I referred to in the bit you cut away...

I apologize, yes.

On 10/06/15 16:25, Tom Lane wrote:
> Optimizing for misuse of the mechanism is not the way.

I absolutely agree and I really appreciate all efforts towards lockless data
structures or at least better concurrency using classical mutual exclusion.

But still I am convinced that on today's massively parallel NUMAs, spinlocks are
plain wrong:

- Even if critical sections are kept minimal, they can still become hot spots

- When they do, we get potentially massive negative scalability, it will be hard to exclude the possibility of a system
"tilting"under (potentially yet unknown) load patterns as long as userland slocks exist.
 
 Briefly: When slocks fail, they fail big time

- slocks optimize for the best case, but I think on today's systems we should optimize for the worst case.

- The fact that well behaved mutexes have a higher initial cost could even motivate good use of them rather than
optimizemisuse.
 

Cheers,

Nils



pgsql-hackers by date:

Previous
From: Jan Wieck
Date:
Subject: Re: s_lock() seems too aggressive for machines with many sockets
Next
From: Andres Freund
Date:
Subject: Re: s_lock() seems too aggressive for machines with many sockets