Skip to content

Refcounts and rbtrees to increase luns above 255

Andy Grover linux-scsi 1 version Applied

Status from this message: Applied to for-next.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest32 patches 48 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/32target: Remove unused ua_dev_list member in struct se_uadrivers/target/target_core_ua.c include/target/target_core_base.h+0 -21 reply
2/32target: Don't keep looping in report_luns if too bigdrivers/target/target_core_spc.c+1 -11 reply
3/32target: Allocate more room for port default groupsdrivers/target/target_core_fabric_configfs.c+1 -11 reply
4/32target: Fix sizeof in kmalloc for some default_groups arraysdrivers/target/target_core_configfs.c drivers/target/target_core_fabric_configfs.c+2 -21 reply
5/32target: Rename some list heads used as nodesdrivers/target/iscsi/iscsi_target.c drivers/target/iscsi/iscsi_target_login.c drivers/target/sbp/sbp_target.c +10 more+87 -871 reply
6/32target: Convert lu_gp_ref_cnt to krefdrivers/target/target_core_alua.c include/target/target_core_base.h+21 -185 replies
7/32target: Convert struct alua_lu_gp_member to krefdrivers/target/target_core_alua.c include/target/target_core_base.h+16 -101 reply
8/32target: Convert tg_pt_gp_ref_cnt to krefdrivers/target/target_core_alua.c include/target/target_core_base.h+19 -221 reply
9/32target: convert tg_pt_gp_mem_ref_cnt to krefdrivers/target/target_core_alua.c include/target/target_core_base.h+15 -101 reply
10/32target: Change sep_tg_pt_ref_cnt to use krefdrivers/target/target_core_device.c drivers/target/target_core_internal.h drivers/target/target_core_pr.c +1 more+17 -191 reply
11/32target: Convert se_dev_entry to krefdrivers/target/target_core_device.c drivers/target/target_core_internal.h drivers/target/target_core_pr.c +2 more+32 -351 reply
12/32target: Convert t10_pr_registration to krefdrivers/target/target_core_pr.c include/target/target_core_base.h+42 -591 reply
13/32target: Move spinlock inside core_release_portdrivers/target/target_core_device.c+3 -71 reply
14/32target: Remove extra percpu_ref_initdrivers/target/target_core_tpg.c+0 -41 reply
15/32target: Refer to u32 luns as unpacked_lundrivers/target/target_core_device.c+8 -81 reply
16/32target: Rename core_tpg_{pre,post}_addlun for claritydrivers/target/target_core_device.c drivers/target/target_core_internal.h drivers/target/target_core_tpg.c+7 -71 reply
17/32target: Don't use void* when passing dev in core_tpg_add_lundrivers/target/target_core_internal.h drivers/target/target_core_tpg.c+3 -31 reply
18/32target: More core_dev_del cleanupsdrivers/target/target_core_device.c drivers/target/target_core_fabric_configfs.c drivers/target/target_core_internal.h +1 more+20 -361 reply
19/32target: Convert to rbtree for se_dev_entry in se_node_acldrivers/target/target_core_device.c drivers/target/target_core_fabric_configfs.c drivers/target/target_core_internal.h +6 more+222 -2173 replies
20/32target: Convert to rbtree for se_lun list in se_portal_groupdrivers/target/sbp/sbp_target.c drivers/target/target_core_device.c drivers/target/target_core_fabric_configfs.c +4 more+116 -2021 reply
21/32target: Remove lun_link and device magicdrivers/target/target_core_device.c drivers/target/target_core_fabric_configfs.c drivers/target/target_core_tpg.c +1 more+0 -181 reply
22/32target: Convert percpu_ref to krefdrivers/target/target_core_device.c drivers/target/target_core_internal.h drivers/target/target_core_tpg.c +2 more+18 -581 reply
23/32target: Add lun->lun_tpg pointerdrivers/target/target_core_tpg.c include/target/target_core_base.h+3 -01 reply
24/32target: Remove tpg from core_dev_export/unexport paramsdrivers/target/target_core_device.c drivers/target/target_core_internal.h drivers/target/target_core_tpg.c+11 -161 reply
25/32target: Call remove_lun instead of del_lun in fabric_port_unlinkdrivers/target/target_core_fabric_configfs.c+1 -11 reply
26/32target: Convert tpg_pr_ref_count to krefdrivers/target/target_core_fabric_configfs.c drivers/target/target_core_pr.c drivers/target/target_core_tpg.c +2 more+26 -181 reply
27/32target: Move call to remove_lun to the release function from drop_linkdrivers/target/target_core_fabric_configfs.c+9 -11 reply
28/32target: Convert acl_pr_ref_count to krefDocumentation/target/tcm_mod_builder.py drivers/infiniband/ulp/srpt/ib_srpt.c drivers/scsi/qla2xxx/tcm_qla2xxx.c +10 more+41 -761 reply
29/32target: Simplify params to core_tpg_del_initiator_node_aclDocumentation/target/tcm_mod_builder.py drivers/infiniband/ulp/srpt/ib_srpt.c drivers/scsi/qla2xxx/tcm_qla2xxx.c +7 more+12 -161 reply
30/32target: Change nacl's session refcount to use existing refcountdrivers/target/target_core_tpg.c drivers/target/target_core_transport.c include/target/target_core_base.h +1 more+2 -281 reply
31/32target: Don't release and re-acquire some spinlocks in loopsdrivers/target/target_core_device.c drivers/target/target_core_tpg.c+0 -91 reply
32/32target: Increase MAX_LUNS_PER_TPG to 16384drivers/target/target_core_spc.c include/target/target_core_base.h+8 -43 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/32] Refcounts and rbtrees to increase luns above 255

Hi Nicholas,

This patchset uses krefs to refcount structures shared across threads. LIO is full of these because configfs-based configuration actions can be removing an object, even while that object is being used by a SCSI command.

Using kref to free the struct on whichever thread drops the last reference allows us to avoid busy-waiting in configfs removal functions. Next, this set removes the statically-sized tpg lun and deve arrays in favor of dynamically adding entries into rbtrees. This reduces memory consumption and allows more than 255 luns per tpg and initiator mapping.

Except for some rbtree lookups, these changes are entirely in the configuration paths of Lio. I have tested these as extensively as I can, and it's ready for wider testing.

Note: patch 22 converts a percpu refcount to a normal kref. I'd argue the benefit is really in the "refcount" part rather than the "percpu", so a simpler kref does the job, but we might want to discuss this some more.

Please review.

Thanks -- Regards -- Andy

p.s. https://github.com/agrover/linux.git for_nab