linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V3 0/2] scsi: core: avoid big pre-allocation for sg list
@ 2019-04-26  0:53 Ming Lei
  2019-04-26  0:53 ` [PATCH V3 1/3] lib/sg_pool.c: improve APIs for allocating sg pool Ming Lei
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Ming Lei @ 2019-04-26  0:53 UTC (permalink / raw)
  To: James Bottomley, linux-scsi, Martin K . Petersen
  Cc: linux-block, Ming Lei, Christoph Hellwig, Bart Van Assche,
	Ewan D . Milne, Hannes Reinecke

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 <hch@lst.de>
Cc: Bart Van Assche <bvanassche@acm.org>
Cc: Ewan D. Milne <emilne@redhat.com>
Cc: Hannes Reinecke <hare@suse.com>
-- 
2.9.5


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-04-27  5:45 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-26  0:53 [PATCH V3 0/2] scsi: core: avoid big pre-allocation for sg list Ming Lei
2019-04-26  0:53 ` [PATCH V3 1/3] lib/sg_pool.c: improve APIs for allocating sg pool Ming Lei
2019-04-26 14:49   ` Christoph Hellwig
2019-04-26 22:23     ` Ming Lei
2019-04-27  5:45       ` Christoph Hellwig
2019-04-26  0:53 ` [PATCH V3 2/3] scsi: core: avoid to pre-allocate big chunk for protection meta data Ming Lei
2019-04-26 14:49   ` Christoph Hellwig
2019-04-26  0:53 ` [PATCH V3 3/3] scsi: core: avoid to pre-allocate big chunk for sg list Ming Lei
2019-04-26 14:49   ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).