Re: [PATCH] scatterlist: Allocate a contiguous array instead of chaining

2019-07-12 Thread Andi Kleen
Sultan Alsawaf 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, th

Re: [PATCH] scatterlist: Allocate a contiguous array instead of chaining

2019-07-12 Thread Sultan Alsawaf
On Fri, Jul 12, 2019 at 09:06:40AM +0200, Thomas Gleixner wrote: > On Fri, 12 Jul 2019, Ming Lei wrote: > > vmalloc() may sleep, so it is impossible to be called in atomic context. > > Allocations from atomic context should be avoided wherever possible and you > really have to have a very convinci

Re: [PATCH] scatterlist: Allocate a contiguous array instead of chaining

2019-07-12 Thread Thomas Gleixner
On Fri, 12 Jul 2019, Ming Lei wrote: > On Thu, Jul 11, 2019 at 11:36:56PM -0700, Sultan Alsawaf wrote: > > From: Sultan Alsawaf > > > > 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 sma

Re: [PATCH] scatterlist: Allocate a contiguous array instead of chaining

2019-07-11 Thread Ming Lei
On Thu, Jul 11, 2019 at 11:36:56PM -0700, Sultan Alsawaf wrote: > From: Sultan Alsawaf > > 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 th

[PATCH] scatterlist: Allocate a contiguous array instead of chaining

2019-07-11 Thread Sultan Alsawaf
From: Sultan Alsawaf 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 chai