lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ