Re: [PATCH] scatterlist: Allocate a contiguous array instead of chaining
From: Andi Kleen
Date: Fri Jul 12 2019 - 13:00:23 EST
Sultan Alsawaf <sultan@xxxxxxxxxxxxxxx> 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