All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@redhat.com>
To: Sultan Alsawaf <sultan@kerneltoast.com>
Cc: Jason Gunthorpe <jgg@ziepe.ca>,
	Palmer Dabbelt <palmer@sifive.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Gal Pressman <galpress@amazon.com>,
	Allison Randal <allison@lohutok.net>,
	Christophe Leroy <christophe.leroy@c-s.fr>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] scatterlist: Allocate a contiguous array instead of chaining
Date: Fri, 12 Jul 2019 14:56:15 +0800	[thread overview]
Message-ID: <20190712065613.GA3036@ming.t460p> (raw)
In-Reply-To: <20190712063657.17088-1-sultan@kerneltoast.com>

On Thu, Jul 11, 2019 at 11:36:56PM -0700, Sultan Alsawaf wrote:
> From: Sultan Alsawaf <sultan@kerneltoast.com>
> 
> Typically, drivers allocate sg lists of sizes up to a few MiB in size.
> The current algorithm deals with large sg lists by splitting them into
> several smaller arrays and chaining them together. But if the sg list
> allocation is large, and we know the size ahead of time, sg chaining is
> both inefficient and unnecessary.
> 
> Rather than calling kmalloc hundreds of times in a loop for chaining
> tiny arrays, we can simply do it all at once with kvmalloc, which has
> the proper tradeoff on when to stop using kmalloc and instead use
> vmalloc.

vmalloc() may sleep, so it is impossible to be called in atomic context.

Thanks,
Ming

  reply	other threads:[~2019-07-12  6:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-12  6:36 [PATCH] scatterlist: Allocate a contiguous array instead of chaining Sultan Alsawaf
2019-07-12  6:56 ` Ming Lei [this message]
2019-07-12  7:06   ` Thomas Gleixner
2019-07-12  7:17     ` Sultan Alsawaf
2019-07-12 17:00 ` Andi Kleen

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=20190712065613.GA3036@ming.t460p \
    --to=ming.lei@redhat.com \
    --cc=allison@lohutok.net \
    --cc=christophe.leroy@c-s.fr \
    --cc=galpress@amazon.com \
    --cc=jgg@ziepe.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=palmer@sifive.com \
    --cc=sultan@kerneltoast.com \
    --cc=tglx@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.