This patch extracts page buffer pooling and the simple
Bruce Momjian <bruce@momjian.us>
This patch extracts page buffer pooling and the simple least-recently-used strategy from clog.c into slru.c. It doesn't change any visible behaviour and passes all regression tests plus a TruncateCLOG test done manually. Apart from refactoring I made a little change to SlruRecentlyUsed, formerly ClogRecentlyUsed: It now skips incrementing lru_counts, if slotno is already the LRU slot, thus saving a few CPU cycles. To make this work, lru_counts are initialised to 1 in SimpleLruInit. SimpleLru will be used by pg_subtrans (part of the nested transactions project), so the main purpose of this patch is to avoid future code duplication. Manfred Koizar
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/access/transam/clog.c | modified | +36 −792 |
| src/backend/access/transam/Makefile | modified | +2 −2 |
| src/backend/access/transam/slru.c | added | +886 −0 |
| src/backend/storage/lmgr/lwlock.c | modified | +3 −3 |
| src/include/access/slru.h | added | +62 −0 |
| src/include/storage/lwlock.h | modified | +1 −2 |