public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: Sultan Alsawaf <sultan@kerneltoast.com>
Cc: unlisted-recipients:; (no To-header on input) Jason Gunthorpe
	<jgg@ziepe.ca>, Ming Lei <ming.lei@redhat.com>,
	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 10:00:17 -0700	[thread overview]
Message-ID: <87lfx39oim.fsf@firstfloor.org> (raw)
In-Reply-To: <20190712063657.17088-1-sultan@kerneltoast.com> (Sultan Alsawaf's message of "Thu, 11 Jul 2019 23:36:56 -0700")

Sultan Alsawaf <sultan@kerneltoast.com> writes:
>
> Abusing repeated kmallocs to produce a large allocation puts strain on
> the slab allocator, when kvmalloc can be used instead. The single
> kvmalloc allocation for all sg lists reduces the burden on the slab and
> page allocators, since for large sg list allocations, this commit
> replaces numerous kmalloc calls with one kvmalloc call.

Note that vmalloc will eventually cause global TLB flushes, which
are very expensive on larger systems. THere are also global locks
in vmalloc, which can also cause scaling problems. slab is a lot
more optimized.

I don't see any performance numbers in your proposal.

Did you test these corner cases?

I suspect you're better of with larger kmallocs up to a reasonable
size. How big would a sg list need to be to need more than a couple
pages?

-Andi

      parent reply	other threads:[~2019-07-12 17:00 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
2019-07-12  7:06   ` Thomas Gleixner
2019-07-12  7:17     ` Sultan Alsawaf
2019-07-12 17:00 ` Andi Kleen [this message]

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=87lfx39oim.fsf@firstfloor.org \
    --to=andi@firstfloor.org \
    --cc=sultan@kerneltoast.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