summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2015-11-12 14:59:09 -0500
committerRobert Haas <rhaas@postgresql.org>2015-11-12 14:59:09 -0500
commitfe702a7b3f9f2bc5bf6d173166d7d55226af82c8 (patch)
treed2e1c94a293e39cef4615f20b91dfce21a1b0245 /src/include
parentc405918858c09d4264ffc5a3c73d57dc3efb0213 (diff)
Move each SLRU's lwlocks to a separate tranche.
This makes it significantly easier to identify these lwlocks in LWLOCK_STATS or Trace_lwlocks output. It's also arguably better from a modularity standpoint, since lwlock.c no longer needs to know anything about the LWLock needs of the higher-level SLRU facility. Ildus Kurbangaliev, reviewd by Álvaro Herrera and by me.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/access/slru.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/include/access/slru.h b/src/include/access/slru.h
index f60e75b569a..661abbc789b 100644
--- a/src/include/access/slru.h
+++ b/src/include/access/slru.h
@@ -36,6 +36,9 @@
*/
#define SLRU_PAGES_PER_SEGMENT 32
+/* Maximum length of an SLRU name */
+#define SLRU_MAX_NAME_LENGTH 32
+
/*
* Page status codes. Note that these do not include the "dirty" bit.
* page_dirty can be TRUE only in the VALID or WRITE_IN_PROGRESS states;
@@ -69,7 +72,6 @@ typedef struct SlruSharedData
bool *page_dirty;
int *page_number;
int *page_lru_count;
- LWLock **buffer_locks;
/*
* Optional array of WAL flush LSNs associated with entries in the SLRU
@@ -99,6 +101,12 @@ typedef struct SlruSharedData
* the latest page.
*/
int latest_page_number;
+
+ /* LWLocks */
+ int lwlock_tranche_id;
+ LWLockTranche lwlock_tranche;
+ char lwlock_tranche_name[SLRU_MAX_NAME_LENGTH];
+ LWLockPadded *buffer_locks;
} SlruSharedData;
typedef SlruSharedData *SlruShared;