Commit a91b02b2 authored by zhenwei pi's avatar zhenwei pi Committed by Tomasz Zawadzki
Browse files

scsi: Move registrant fields to the end of struct spdk_scsi_lun



Registrant related fields use the biggest part of struct
spdk_scsi_lun, and it's usually *not* hot code path. Move them to
the end of structure.

Also swap 'uint32_t pr_generation', is's possible to reduce memory
in the next step.

Suggested-by: default avatarJim Harris <jim.harris@samsung.com>
Change-Id: Ie544efe01ca42162c056dc84deec5e5c338a4eb9
Signed-off-by: default avatarzhenwei pi <pizhenwei@bytedance.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/20709


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <smatsumoto@nvidia.com>
Reviewed-by: default avatarJim Harris <jim.harris@samsung.com>
Community-CI: Mellanox Build Bot
parent 2c9dfc37
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -121,15 +121,6 @@ struct spdk_scsi_lun {
	/** Argument for resize_cb */
	void *resize_ctx;

	/** Registrant head for I_T nexus */
	TAILQ_HEAD(, spdk_scsi_pr_registrant) reg_head;
	/** Persistent Reservation Generation */
	uint32_t pr_generation;
	/** Reservation for the LUN */
	struct spdk_scsi_pr_reservation reservation;
	/** Reservation holder for SPC2 RESERVE(6) and RESERVE(10) */
	struct spdk_scsi_pr_registrant scsi2_holder;

	/** List of open descriptors for this LUN. */
	TAILQ_HEAD(, spdk_scsi_lun_desc) open_descs;

@@ -153,6 +144,15 @@ struct spdk_scsi_lun {

	/** The LUN is resizing */
	bool resizing;

	/** Persistent Reservation Generation */
	uint32_t pr_generation;
	/** Registrant head for I_T nexus */
	TAILQ_HEAD(, spdk_scsi_pr_registrant) reg_head;
	/** Reservation for the LUN */
	struct spdk_scsi_pr_reservation reservation;
	/** Reservation holder for SPC2 RESERVE(6) and RESERVE(10) */
	struct spdk_scsi_pr_registrant scsi2_holder;
};

struct spdk_scsi_lun *scsi_lun_construct(const char *bdev_name,