PostgreSQL
- title
- PostgreSQL
- type
- entity
- summary
- Open-source relational database; process-per-connection model with a shared buffer pool, central to several recent kernel-interaction stories
- tags
- database, postgresql
- sources
- linux-broke-postgresql
- created
- 2026-04-30
- updated
- 2026-04-30
PostgreSQL is an open-source relational database with a process-per-connection model: when a client connects, the server forks a dedicated backend to handle it. Backends share access to a large in-memory cache called the shared buffer pool, sized via shared_buffers. The pool stores recently-read 8 KB data pages (PostgreSQL's on-disk unit, distinct from a Linux memory page) so subsequent reads avoid disk.
When a backend needs a data page that isn't in the buffer pool, it calls StrategyGetBuffer to pick a slot — either an empty one or a victim to evict. That selection is protected by a single global spinlock. The design assumes the critical section is tens of nanoseconds and the holder is gone before anyone notices.
Notable interactions covered in the wiki
- linux-7-postgres-regression — Linux 7.0 removed
PREEMPT_NONE(see linux-preemption-models), letting the scheduler preempt a backend mid–page fault while it holds theStrategyGetBufferspinlock. On a 96-vCPU Graviton4 with 120 GBshared_buffersand 4 KB pages, every other backend spins on a held lock; throughput halves. Workaround: enable huge-pages. - linux-kernel-pgit — pgit ingests Linux kernel git history into PostgreSQL so it's queryable as SQL. Different angle on the same database.
Repo
Linked from