From: ming.lei@redhat.com (Ming Lei)
Subject: [PATCH V4 0/3] scsi: core: avoid big pre-allocation for sg list
Date: Sun, 5 May 2019 09:10:18 +0800 [thread overview]
Message-ID: <20190505011017.GD655@ming.t460p> (raw)
In-Reply-To: <20190428073932.9898-1-ming.lei@redhat.com>
On Sun, Apr 28, 2019@03:39:29PM +0800, Ming Lei wrote:
> 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.
>
> V4:
> - add parameter to sg_alloc_table_chained()/sg_free_table_chained()
> directly, and update current callers
>
> 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/nvme/host/fc.c | 7 ++++---
> drivers/nvme/host/rdma.c | 7 ++++---
> drivers/nvme/target/loop.c | 4 ++--
> drivers/scsi/scsi_lib.c | 31 ++++++++++++++++++++++---------
> include/linux/scatterlist.h | 11 +++++++----
> lib/scatterlist.c | 36 +++++++++++++++++++++++-------------
> lib/sg_pool.c | 37 +++++++++++++++++++++++++++----------
> net/sunrpc/xprtrdma/svc_rdma_rw.c | 5 +++--
> 8 files changed, 92 insertions(+), 46 deletions(-)
>
> Cc: Christoph Hellwig <hch at lst.de>
> Cc: Bart Van Assche <bvanassche at acm.org>
> Cc: Ewan D. Milne <emilne at redhat.com>
> Cc: Hannes Reinecke <hare at suse.com>
> Cc: Sagi Grimberg <sagi at grimberg.me>
> Cc: Chuck Lever <chuck.lever at oracle.com>
> Cc: netdev at vger.kernel.org
> Cc: linux-nvme at lists.infradead.org
Hi Martin,
Could you consider to merge this patchset to 5.2 if you are fine?
Thanks,
Ming
next prev parent reply other threads:[~2019-05-05 1:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-28 7:39 [PATCH V4 0/3] scsi: core: avoid big pre-allocation for sg list Ming Lei
2019-04-28 7:39 ` [PATCH V4 1/3] lib/sg_pool.c: improve APIs for allocating sg pool Ming Lei
2019-04-28 12:04 ` Christoph Hellwig
2019-05-05 1:10 ` Ming Lei [this message]
2019-05-14 2:06 ` [PATCH V4 0/3] scsi: core: avoid big pre-allocation for sg list Martin K. Petersen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190505011017.GD655@ming.t460p \
--to=ming.lei@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox