Re: MAX_BACKENDS size (comment accuracy)

Jacob Brazeal <jacob.brazeal@gmail.com>

From: Jacob Brazeal <jacob.brazeal@gmail.com>
To: Andres Freund <andres@anarazel.de>, pgsql-hackers@postgresql.org
Date: 2025-01-26T21:08:19Z
Lists: pgsql-hackers
I had a typo earlier: I should have said:

> StaticAssertDecl((MAX_BACKENDS & LW_FLAG_MASK) == 0,
>     "MAX_BACKENDS and LW_FLAG_MASK overlap");

Should this check that  LW_LOCK_MASK & LW_FLAG_MASK == 0? To also ensure
the LW_VAL_EXCLUSIVE bit does not overlap.

Commits

  1. Fix comment for MAX_BACKENDS.

  2. Add static asserts for MAX_BACKENDS limiting factors

  3. Base LWLock limits directly on MAX_BACKENDS

  4. Move MAX_BACKENDS to procnumber.h

  5. bufmgr: Make it easier to change number of buffer state bits

  6. Remove check hooks for GUCs that contribute to MaxBackends.

  7. Allow Pin/UnpinBuffer to operate in a lockfree manner.