diff --git a/src/backend/replication/slot.c b/src/backend/replication/slot.c
index c39e957..02ec972 100644
--- a/src/backend/replication/slot.c
+++ b/src/backend/replication/slot.c
@@ -97,6 +97,9 @@ ReplicationSlot *MyReplicationSlot = NULL;
 int			max_replication_slots = 0;	/* the maximum number of replication
 										 * slots */
 
+/* Tranche */
+LWLockTranche ReplSlotIOLWLockTranche;
+
 static void ReplicationSlotDropAcquired(void);
 
 /* internal persistency functions */
@@ -137,6 +140,13 @@ ReplicationSlotsShmemInit(void)
 		ShmemInitStruct("ReplicationSlot Ctl", ReplicationSlotsShmemSize(),
 						&found);
 
+	ReplSlotIOLWLockTranche.name = "Replication Slot IO Locks";
+	ReplSlotIOLWLockTranche.array_base =
+		((char *) ReplicationSlotCtl) + offsetof(ReplicationSlotCtlData, replication_slots) +offsetof(ReplicationSlot, io_in_progress_lock);
+	ReplSlotIOLWLockTranche.array_stride = sizeof(ReplicationSlot);
+	LWLockRegisterTranche(LWTRANCHE_REPL_SLOT_IO_IN_PROGRESS,
+						  &ReplSlotIOLWLockTranche);
+
 	if (!found)
 	{
 		int			i;
@@ -150,7 +160,7 @@ ReplicationSlotsShmemInit(void)
 
 			/* everything else is zeroed by the memset above */
 			SpinLockInit(&slot->mutex);
-			slot->io_in_progress_lock = LWLockAssign();
+			LWLockInitialize(&slot->io_in_progress_lock, LWTRANCHE_REPL_SLOT_IO_IN_PROGRESS);
 		}
 	}
 }
@@ -1008,7 +1018,7 @@ SaveSlotToPath(ReplicationSlot *slot, const char *dir, int elevel)
 	if (!was_dirty)
 		return;
 
-	LWLockAcquire(slot->io_in_progress_lock, LW_EXCLUSIVE);
+	LWLockAcquire(&slot->io_in_progress_lock, LW_EXCLUSIVE);
 
 	/* silence valgrind :( */
 	memset(&cp, 0, sizeof(ReplicationSlotOnDisk));
@@ -1101,7 +1111,7 @@ SaveSlotToPath(ReplicationSlot *slot, const char *dir, int elevel)
 		slot->dirty = false;
 	SpinLockRelease(&slot->mutex);
 
-	LWLockRelease(slot->io_in_progress_lock);
+	LWLockRelease(&slot->io_in_progress_lock);
 }
 
 /*
diff --git a/src/backend/storage/lmgr/lwlock.c b/src/backend/storage/lmgr/lwlock.c
index d43fb61..7e85e71 100644
--- a/src/backend/storage/lmgr/lwlock.c
+++ b/src/backend/storage/lmgr/lwlock.c
@@ -356,9 +356,6 @@ NumLWLocks(void)
 	/* proc.c needs one for each backend or auxiliary process */
 	numLocks += MaxBackends + NUM_AUXILIARY_PROCS;
 
-	/* slot.c needs one for each slot */
-	numLocks += max_replication_slots;
-
 	/*
 	 * Add any requested by loadable modules; for backwards-compatibility
 	 * reasons, allocate at least NUM_USER_DEFINED_LWLOCKS of them even if
diff --git a/src/include/replication/slot.h b/src/include/replication/slot.h
index 20dd7a2..05a3f7e 100644
--- a/src/include/replication/slot.h
+++ b/src/include/replication/slot.h
@@ -109,7 +109,7 @@ typedef struct ReplicationSlot
 	ReplicationSlotPersistentData data;
 
 	/* is somebody performing io on this slot? */
-	LWLock	   *io_in_progress_lock;
+	LWLock		io_in_progress_lock;
 
 	/* all the remaining data is only used for logical slots */
 
diff --git a/src/include/storage/lwlock.h b/src/include/storage/lwlock.h
index ff34529..2752981 100644
--- a/src/include/storage/lwlock.h
+++ b/src/include/storage/lwlock.h
@@ -213,6 +213,7 @@ typedef enum BuiltinTrancheIds
 	LWTRANCHE_WAL_INSERT,
 	LWTRANCHE_BUFFER_CONTENT,
 	LWTRANCHE_BUFFER_IO_IN_PROGRESS,
+	LWTRANCHE_REPL_SLOT_IO_IN_PROGRESS,
 	LWTRANCHE_FIRST_USER_DEFINED
 }	BuiltinTrancheIds;
 
