[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <063D6719AE5E284EB5DD2968C1650D6D1CAE688E@AcuExch.aculab.com>
Date: Fri, 20 Feb 2015 14:27:58 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Eric Dumazet' <eric.dumazet@...il.com>
CC: 'Daniel Borkmann' <daniel@...earbox.net>,
"davem@...emloft.net" <davem@...emloft.net>,
"tgraf@...g.ch" <tgraf@...g.ch>,
"johunt@...mai.com" <johunt@...mai.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: RE: [PATCH net 2/3] rhashtable: better high order allocation
attempts
From: Eric Dumazet
> On Fri, 2015-02-20 at 10:11 +0000, David Laight wrote:
> > From: Daniel Borkmann
> > > When trying to allocate future tables via bucket_table_alloc(), it seems
> > > overkill on large table shifts that we probe for kzalloc() unconditionally
> > > first, as it's likely to fail.
> >
> > How about a two-level array for large tables?
> > Then you don't need to allocate more than 1 page at a time?
>
> This is called vmalloc() in linux kernel.
vmalloc() still requires contiguous KVA, just not contiguous physical memory.
I also believe that (on some systems at least) the address space for
vmalloc() is much smaller than that for kalloc().
IIRC At least one piece of historic documentation says that vmalloc() should
only be used for short term allocations.
I presume this code is allocating very large arrays for the base of the hash lists.
Since there is no absolute requirement for contiguous KVA (nothing
sequentially accesses the entire array) it can be coded differently.
I realize that this would involve an extra data cache line access.
So you'd want to avoid it for small tables.
(I expected this to be your objection)
David
Powered by blists - more mailing lists