Re: Spinlocks, yet again: analysis and proposed patches - Mailing list pgsql-hackers

From Qingqing Zhou
Subject Re: Spinlocks, yet again: analysis and proposed patches
Date
Msg-id e6qidu$r69$1@news.hub.org
Whole thread Raw
In response to Re: Spinlocks, yet again: analysis and proposed patches  (Simon Riggs <simon@2ndquadrant.com>)
List pgsql-hackers
"Tom Lane" <tgl@sss.pgh.pa.us> wrote
>
> Not really --- that patch was intended to ensure that LWLocks don't
> unnecessarily cross two cache lines.  It doesn't ensure that two
> different LWLocks aren't sharing a cache line.  You could do that
> by increasing LWLOCK_PADDED_SIZE to the cache line size for your
> hardware, if you know what that is.
>
Exactly, this is one way -- if we make LWLOCK_PADDED_SIZE big enough, we can
assure that one lwlock one cacheline. If so, maybe we should plug in a check
like LMBench in ./configure to guess out current cacheline size. But this
way looks like overkill -- a compromise is to pad only some of the LWLocks
big enough but not all (for example, the buffer content lock array).

Regards,
Qingqing




pgsql-hackers by date:

Previous
From: ITAGAKI Takahiro
Date:
Subject: Re: Alternative variable length structure
Next
From: Tom Lane
Date:
Subject: Re: Alternative variable length structure