Skip to content

scsi: core: avoid big pre-allocation for sg list

Ming Lei linux-block 3 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest0 of 2 patches 0 repliesNew
  2. v22 patches 4 repliesSuperseded
  3. v12 patches 14 repliesSuperseded

Changes in v3 from the cover letter

- improve sg_alloc_table_chained() to accept variant size of the 1st pre-allocated SGL
- applies the improved sg API to address the big pre-allocation issue

Patches in v3 No applies recorded yet

None of the 2 patches the cover letter announces are in this archive.

Reviews trailers per patch

PatchChristoph Hellwig
SeriesR-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH V3 0/2] scsi: core: avoid big pre-allocation for sg list

Hi,

Since supporting to blk-mq, big pre-allocation for sg list is introduced, this way is very unfriendly wrt. memory consumption.

There were Red Hat internal reports that some scsi_debug based tests can't be run any more because of too big pre-allocation.

Also lpfc users commplained that 1GB+ ram is pre-allocatd for single HBA.

sg_alloc_table_chained() is improved to support variant size of 1st pre-allocated SGL in the 1st patch as suggested by Christoph.

The other two patches try to address this issue by allocating sg list runtime, meantime pre-allocating one or two inline sg entries for small IO. This ways follows NVMe's approach wrt. sg list allocation.

V3:
- improve sg_alloc_table_chained() to accept variant size of the 1st pre-allocated SGL
- applies the improved sg API to address the big pre-allocation issue

V2:
- move inline sg table initializetion into one helper
- introduce new helper for getting inline sg
- comment log fix

Ming Lei (3):
lib/sg_pool.c: improve APIs for allocating sg pool
scsi: core: avoid to pre-allocate big chunk for protection meta data
scsi: core: avoid to pre-allocate big chunk for sg list

 drivers/scsi/scsi_lib.c     | 36 +++++++++++++++++++++++----------
 include/linux/scatterlist.h | 27 ++++++++++++++++++++-----
 lib/scatterlist.c           | 36 +++++++++++++++++++++------------
 lib/sg_pool.c               | 49 ++++++++++++++++++++++++++++++---------------
 4 files changed, 103 insertions(+), 45 deletions(-)
Cc Christoph Hellwig <[email protected]>
Cc Bart Van Assche <[email protected]>
Cc Ewan D. Milne <[email protected]>
Cc Hannes Reinecke <[email protected]>
Signature · 1 line
2.9.5