Re: [PATCH 1/2] scsi: core: avoid to pre-allocate big chunk for protection meta data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2019-04-23 at 18:32 +-0800, Ming Lei wrote:
+AD4 +-/+ACo
+AD4 +- +ACo Size of integrity meta data size is usually small, 1 inline sg
                        +AF4AXgBeAF4AXgBeAF4AXgBeAF4AXgBeAF4AXg
Please change this into +ACI-metadata+ACI. Mentioning +ACI-size+ACI twice is not
useful.
+AD4 +- +ACo should cover normal cases.
+AD4 +- +ACo-/
+AD4 +-+ACM-define  SCSI+AF8-INLINE+AF8-PROT+AF8-SG+AF8-CNT  1
+AD4 +-
+AD4  static struct kmem+AF8-cache +ACo-scsi+AF8-sdb+AF8-cache+ADs
+AD4  static struct kmem+AF8-cache +ACo-scsi+AF8-sense+AF8-cache+ADs
+AD4  static struct kmem+AF8-cache +ACo-scsi+AF8-sense+AF8-isadma+AF8-cache+ADs
+AD4 +AEAAQA -553,12 +-559,21 +AEAAQA static void scsi+AF8-uninit+AF8-cmd(struct scsi+AF8-cmnd +ACo-cmd)
+AD4         +AH0
+AD4  +AH0
+AD4  
+AD4 +-static inline bool scsi+AF8-prot+AF8-use+AF8-inline+AF8-sg(struct scsi+AF8-cmnd +ACo-cmd)
+AD4 +-+AHs
+AD4 +-       if (+ACE-scsi+AF8-prot+AF8-sglist(cmd))
+AD4 +-               return false+ADs

Since scsi+AF8-prot+AF8-use+AF8-inline+AF8-sg() is only called if scsi+AF8-prot+AF8-sg+AF8-count() +AD4 0,
is the above test necessary?

+AD4 +-       return cmd-+AD4-prot+AF8-sdb-+AD4-table.sgl +AD0APQ
+AD4 +-               (struct scatterlist +ACo)(cmd-+AD4-prot+AF8-sdb +- 1)+ADs
+AD4 +-+AH0
+AD4 +-
+AD4  static void scsi+AF8-mq+AF8-free+AF8-sgtables(struct scsi+AF8-cmnd +ACo-cmd)
+AD4  +AHs
+AD4         if (cmd-+AD4-sdb.table.nents)
+AD4                 sg+AF8-free+AF8-table+AF8-chained(+ACY-cmd-+AD4-sdb.table, true)+ADs
+AD4 -       if (scsi+AF8-prot+AF8-sg+AF8-count(cmd))
+AD4 -               sg+AF8-free+AF8-table+AF8-chained(+ACY-cmd-+AD4-prot+AF8-sdb-+AD4-table, true)+ADs
+AD4 +-       if (scsi+AF8-prot+AF8-sg+AF8-count(cmd) +ACYAJg +ACE-scsi+AF8-prot+AF8-use+AF8-inline+AF8-sg(cmd))
+AD4 +-               sg+AF8-free+AF8-table+AF8-chained(+ACY-cmd-+AD4-prot+AF8-sdb-+AD4-table, false)+ADs
+AD4  +AH0
+AD4  
+AD4  static void scsi+AF8-mq+AF8-uninit+AF8-cmd(struct scsi+AF8-cmnd +ACo-cmd)
+AD4 +AEAAQA -1044,9 +-1059,11 +AEAAQA blk+AF8-status+AF8-t scsi+AF8-init+AF8-io(struct scsi+AF8-cmnd +ACo-cmd)
+AD4                 +AH0
+AD4  
+AD4                 ivecs +AD0 blk+AF8-rq+AF8-count+AF8-integrity+AF8-sg(rq-+AD4-q, rq-+AD4-bio)+ADs
+AD4 -
+AD4 -               if (sg+AF8-alloc+AF8-table+AF8-chained(+ACY-prot+AF8-sdb-+AD4-table, ivecs,
+AD4 -                               prot+AF8-sdb-+AD4-table.sgl)) +AHs
+AD4 +-               if (ivecs +ADwAPQ SCSI+AF8-INLINE+AF8-PROT+AF8-SG+AF8-CNT)
+AD4 +-                       prot+AF8-sdb-+AD4-table.nents +AD0 prot+AF8-sdb-+AD4-table.orig+AF8-nents +AD0
+AD4 +-                               SCSI+AF8-INLINE+AF8-PROT+AF8-SG+AF8-CNT+ADs

Please call sg+AF8-init+AF8-table() instead of open-coding it.

+AD4 +-               else if (sg+AF8-alloc+AF8-table+AF8-chained(+ACY-prot+AF8-sdb-+AD4-table, ivecs,
+AD4 +-                                       NULL)) +AHs
+AD4                         ret +AD0 BLK+AF8-STS+AF8-RESOURCE+ADs
+AD4                         goto out+AF8-free+AF8-sgtables+ADs
+AD4                 +AH0

Bart.



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux