24 #define SLRU_MAX_ALLOWED_BUFFERS ((1024 * 1024 * 1024) / BLCKSZ)
39 #define SLRU_PAGES_PER_SEGMENT 32
182 bankno = pageno &
ctl->bank_mask;
183 return &(
ctl->shared->bank_locks[bankno].lock);
189 const char *subdir,
int buffer_tranche_id,
191 bool long_segment_names);
199 #ifdef USE_ASSERT_CHECKING
202 #define SlruPagePrecedesUnitTests(ctl, per_page) do {} while (0)
216 int64 segpage,
void *
data);
void SimpleLruInit(SlruCtl ctl, const char *name, int nslots, int nlsns, const char *subdir, int buffer_tranche_id, int bank_tranche_id, SyncRequestHandler sync_handler, bool long_segment_names)
static LWLock * SimpleLruGetBankLock(SlruCtl ctl, int64 pageno)
SlruSharedData * SlruShared
int SimpleLruReadPage_ReadOnly(SlruCtl ctl, int64 pageno, TransactionId xid)
#define SlruPagePrecedesUnitTests(ctl, per_page)
void SimpleLruWritePage(SlruCtl ctl, int slotno)
bool(* SlruScanCallback)(SlruCtl ctl, char *filename, int64 segpage, void *data)
void SimpleLruWriteAll(SlruCtl ctl, bool allow_redirtied)
int SimpleLruAutotuneBuffers(int divisor, int max)
bool SimpleLruDoesPhysicalPageExist(SlruCtl ctl, int64 pageno)
void SlruDeleteSegment(SlruCtl ctl, int64 segno)
struct SlruCtlData SlruCtlData
bool SlruScanDirectory(SlruCtl ctl, SlruScanCallback callback, void *data)
bool SlruScanDirCbDeleteAll(SlruCtl ctl, char *filename, int64 segpage, void *data)
int SimpleLruReadPage(SlruCtl ctl, int64 pageno, bool write_ok, TransactionId xid)
int SlruSyncFileTag(SlruCtl ctl, const FileTag *ftag, char *path)
struct SlruSharedData SlruSharedData
int SimpleLruZeroPage(SlruCtl ctl, int64 pageno)
void SimpleLruTruncate(SlruCtl ctl, int64 cutoffPage)
@ SLRU_PAGE_WRITE_IN_PROGRESS
@ SLRU_PAGE_READ_IN_PROGRESS
Size SimpleLruShmemSize(int nslots, int nlsns)
bool SlruScanDirCbReportPresence(SlruCtl ctl, char *filename, int64 segpage, void *data)
bool check_slru_buffers(const char *name, int *newval)
bool(* PagePrecedes)(int64, int64)
SyncRequestHandler sync_handler
LWLockPadded * bank_locks
pg_atomic_uint64 latest_page_number
SlruPageStatus * page_status
LWLockPadded * buffer_locks
static void callback(struct sockaddr *addr, struct sockaddr *mask, void *unused)