Thread (10 messages) 10 messages, 2 authors, 2018-05-24

Re: semantics of rhashtable and sysvipc

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2018-05-24 19:18:01
Also in: lkml

On Thu, May 24, 2018 at 12:08 PM Davidlohr Bueso [off-list ref] wrote:

However, after how about the resize being based on HASH_MIN_SIZE instead
of
HASH_DEFAULT_SIZE?
I think that sounds reasonable. We wouldn't expect this to ever happen in
practice, and as you say, if it *does* happen, the size of the hash array
is the last of our problems.
Considering that some users set p.min_size to be rather large-ish (up to
1024
buckets afaict), we'd need the following:
         size = min(ht->p.min_size, HASH_MIN_SIZE);
Bah, let's just go for simplicity, and just make it HASH_MIN_SIZE
unconditionally, and just have a single fallback: if the first "normal"
allocation fails, do one single unconditional allocation with HASH_MIN_SIZE
and GFP_NOFAIL.

I think that should work fine.

                Linus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help