[PATCH 2/2] scsi: target: alua: Drop the grace period wait from LUN detach

From: Qiliang Yuan

Date: Tue Nov 10 2026 - 09:01:56 EST


core_tpg_remove_lun() detaches a LUN from its ALUA target port group
once transport_clear_lun_ref() has drained its I/O, and
target_detach_tg_pt_gp() then waits for an RCU grace period.

Nothing that wait could protect is freed here: the group lives on until
core_alua_free_tg_pt_gp(), which waits for a grace period of its own
before freeing it, and the se_lun is freed with call_rcu(). Every LUN
removed through configfs still pays a grace period for it.

Remove the synchronize_rcu() call.

Removing 256 LUNs from an iSCSI TPG through configfs, five rounds
alternating with and without this patch, takes (median, min-max in
parentheses):

LUNs before (ms) after (ms) change
256 5222 (5165-5244) 3551 (3436-3810) -32%

Signed-off-by: Qiliang Yuan <qiliang.yuan@xxxxxxxxx>
---
drivers/target/target_core_alua.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/target/target_core_alua.c b/drivers/target/target_core_alua.c
index 35d36cd36db6c..4e22f988bb83f 100644
--- a/drivers/target/target_core_alua.c
+++ b/drivers/target/target_core_alua.c
@@ -1858,7 +1858,6 @@ void target_detach_tg_pt_gp(struct se_lun *lun)
rcu_assign_pointer(lun->lun_tg_pt_gp, NULL);
}
spin_unlock(&lun->lun_tg_pt_gp_lock);
- synchronize_rcu();
}

static void target_swap_tg_pt_gp(struct se_lun *lun,

--
2.43.0