Re: Improve LWLock tranche name visibility across backends - Mailing list pgsql-hackers

From Rahila Syed
Subject Re: Improve LWLock tranche name visibility across backends
Date
Msg-id CAH2L28v0Qf=CrLYVTQP9g6cncHo2bU4P=1NhjSom7rnOjwxKQg@mail.gmail.com
Whole thread Raw
In response to Re: Improve LWLock tranche name visibility across backends  (Sami Imseih <samimseih@gmail.com>)
List pgsql-hackers
Hi,
 

Since DSM is not available during postmaster, if we were to create a DSA
segment in place, similar to what's done in StatsShmemInit(), we would also
need to ensure that the initial shared memory is sized appropriately. This is
because it would need to be large enough to accommodate all user-defined
tranches registered during postmaster, without having to rely on new
dsm segments.
From my experimentation, this sizing is not as straightforward as simply
calculating # of tranches * size of a tranche entry.

I still think we should create the dsa during postmaster, as we do with
StatsShmemInit, but it would be better if postmaster keeps its hands off this
dshash and only normal backends can use them.

Thoughts?


Since creating a DSA segment in place during Postmaster startup still requires calculating the size of
the tranche names table including the user-defined tranches, why not use static shared memory to
pre-allocate a fixed sized table and arrays of size NAMEDATALEN to store the names?  

If a dshash table is used to store tranche names and IDs, where would the tranche name for this table
be registered?  

Thank you,
Rahila Syed

pgsql-hackers by date:

Previous
From: "Joel Jacobson"
Date:
Subject: Re: Optimize LISTEN/NOTIFY
Next
From: "Hayato Kuroda (Fujitsu)"
Date:
Subject: RE: stats.sql might fail due to shared buffers also used by parallel tests