Skip to contentSkip to conversation

ufs: core: Reduce the size of struct ufshcd_lrb

PATCH Applied Bart Van Assche 3 participants 3 messages Aug 19, 2025 – Aug 20, 2025

Subsystems (2)
lore
Share & tools
lore

Bart Van Assche

author reviewer
#0 lore raw

PATCH 1/1 ufs: core: Reduce the size of struct ufshcd_lrb

The size of the data structures that are used in the hot path matters for performance (IOPS). Hence this patch that reduces the size of struct ufshcd_lrb on 64-bit systems by 16 bytes. The size of this data structure is reduced from 152 to 136 bytes.

---
 include/ufs/ufshcd.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
include/ufs/ufshcd.h +2 -3
index 81d8592fa36e..621901d13b52 100644
@@ -167,13 +167,13 @@ struct ufs_pm_lvl_states {
  * @task_tag: Task tag of the command
  * @lun: LUN of the command
  * @intr_cmd: Interrupt command (doesn't participate in interrupt aggregation)
+ * @req_abort_skip: skip request abort task flag
  * @issue_time_stamp: time stamp for debug purposes (CLOCK_MONOTONIC)
  * @issue_time_stamp_local_clock: time stamp for debug purposes (local_clock)
  * @compl_time_stamp: time stamp for statistics (CLOCK_MONOTONIC)
  * @compl_time_stamp_local_clock: time stamp for debug purposes (local_clock)
  * @crypto_key_slot: the key slot to use for inline crypto (-1 if none)
  * @data_unit_num: the data unit number for the first block for inline crypto
- * @req_abort_skip: skip request abort task flag
  */
 struct ufshcd_lrb {
 	struct utp_transfer_req_desc *utr_descriptor_ptr;
@@ -193,6 +193,7 @@ struct ufshcd_lrb {
 	int task_tag;
 	u8 lun; /* UPIU LUN id field is only 8-bit wide */
 	bool intr_cmd;
+	bool req_abort_skip;
 	ktime_t issue_time_stamp;
 	u64 issue_time_stamp_local_clock;
 	ktime_t compl_time_stamp;
@@ -201,8 +202,6 @@ struct ufshcd_lrb {
 	int crypto_key_slot;
 	u64 data_unit_num;
 #endif
-
-	bool req_abort_skip;
 };
 
 /**
Reviewed-by on v1 1/1
#1 lore raw
Quoted 12 lines · Bart Van Assche

External email : Please do not click links or open attachments until you have verified the sender or the content.

The size of the data structures that are used in the hot path matters for
performance (IOPS). Hence this patch that reduces the size of struct ufshcd_lrb on 64-bit systems by 16 bytes. The size of this data structure
is reduced from 152 to 136 bytes.

Quoted 5 lines

---
 include/ufs/ufshcd.h | 5 ++---

 1 file changed, 2 insertions(+), 3 deletions(-)
#2 lore raw
In reply to Bart Van Assche

Bart,

Quoted 4 lines

The size of the data structures that are used in the hot path matters for performance (IOPS). Hence this patch that reduces the size of struct ufshcd_lrb on 64-bit systems by 16 bytes. The size of this data structure is reduced from 152 to 136 bytes.

Applied to 6.18/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen