[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170207131728.GA11584@breakpoint.cc>
Date: Tue, 7 Feb 2017 14:17:28 +0100
From: Florian Westphal <fw@...len.de>
To: Herbert Xu <herbert@...dor.apana.org.au>
Cc: "David S. Miller" <davem@...emloft.net>,
Thomas Graf <tgraf@...g.ch>, netdev@...r.kernel.org
Subject: Re: [PATCH 3/3] rhashtable: Add nested tables
Herbert Xu <herbert@...dor.apana.org.au> wrote:
> This patch adds code that handles GFP_ATOMIC kmalloc failure on
> insertion. As we cannot use vmalloc, we solve it by making our
> hash table nested. That is, we allocate single pages at each level
> and reach our desired table size by nesting them.
>
> When a nested table is created, only a single page is allocated
> at the top-level. Lower levels are allocated on demand during
> insertion. Therefore for each insertion to succeed, only two
> (non-consecutive) pages are needed.
>
> After a nested table is created, a rehash will be scheduled in
> order to switch to a vmalloced table as soon as possible. Also,
> the rehash code will never rehash into a nested table. If we
> detect a nested table during a rehash, the rehash will be aborted
> and a new rehash will be scheduled.
Ok, but why?
It seems to add a whole lot of complexity...
What users can't handle the insert failure case until resize
has completed?
Would relaxing the max chain length (until rehash is done) be an
alternative?
Powered by blists - more mailing lists