RE: [PATCH net 2/2] rhashtable: remove indirection for grow/shrink decision functions
From: David Laight <hidden>
Date: 2015-02-25 15:52:15
From: David Laight <hidden>
Date: 2015-02-25 15:52:15
From: Daniel Borkmann [
On 02/25/2015 04:41 PM, David Laight wrote: ...quoted
Why not cache the 'number of items before we need to expand' value after each expansion, setting it to 'infinite' when expansion is disabled. Then the above check is a simple comparison. You probably don't even need an atomic_read() - provided something is double checked once the first test determines that an expansion is needed.Did you read my cover letter? ;)
I probably didn't infer the relevant references :-) Actually even if some code wanted other rules, provided they are based on comparing the 'number of items' to a preset limit the limit could be set during expansion/contraction. David