Re: [PATCH 5/6] rhashtable: support guaranteed successful insertion.

2018-04-05 Thread Herbert Xu
On Fri, Apr 06, 2018 at 01:11:56PM +1000, NeilBrown wrote: > > You don't need to handle memory allocation failures at the point where > you insert into the table - adding to a linked list requires no new > memory. You do actually. The r in rhashtable stands for resizable. We cannot completely re

Re: [PATCH 5/6] rhashtable: support guaranteed successful insertion.

2018-04-05 Thread NeilBrown
On Thu, Mar 29 2018, Herbert Xu wrote: > On Thu, Mar 29, 2018 at 08:26:21AM +1100, NeilBrown wrote: >> >> I say "astronomically unlikely", you say "probability .. is extremely >> low". I think we are in agreement here. >> >> The point remains that if an error *can* be returned then I have to >>

Re: [PATCH 5/6] rhashtable: support guaranteed successful insertion.

2018-03-28 Thread Herbert Xu
On Thu, Mar 29, 2018 at 08:26:21AM +1100, NeilBrown wrote: > > I say "astronomically unlikely", you say "probability .. is extremely > low". I think we are in agreement here. > > The point remains that if an error *can* be returned then I have to > write code to handle it and test that code. I'd

Re: [PATCH 5/6] rhashtable: support guaranteed successful insertion.

2018-03-28 Thread NeilBrown
On Wed, Mar 28 2018, Herbert Xu wrote: > On Wed, Mar 28, 2018 at 06:04:40PM +1100, NeilBrown wrote: >> >> I disagree. My patch 6 only makes it common instead of exceedingly >> rare. If any table in the list other than the first has a chain with 16 >> elements, then trying to insert an element wi

Re: [PATCH 5/6] rhashtable: support guaranteed successful insertion.

2018-03-28 Thread Herbert Xu
On Wed, Mar 28, 2018 at 06:04:40PM +1100, NeilBrown wrote: > > I disagree. My patch 6 only makes it common instead of exceedingly > rare. If any table in the list other than the first has a chain with 16 > elements, then trying to insert an element with a hash which matches > that chain will fail

Re: [PATCH 5/6] rhashtable: support guaranteed successful insertion.

2018-03-28 Thread NeilBrown
On Wed, Mar 28 2018, Herbert Xu wrote: > On Wed, Mar 28, 2018 at 08:34:19AM +1100, NeilBrown wrote: >> >> It is easy to get an -EBUSY insertion failure when .disable_count is >> enabled, and I did get that. Blindly propagating that up caused lustre >> to get terribly confused - not too surprising

Re: [PATCH 5/6] rhashtable: support guaranteed successful insertion.

2018-03-27 Thread Herbert Xu
On Wed, Mar 28, 2018 at 08:34:19AM +1100, NeilBrown wrote: > > It is easy to get an -EBUSY insertion failure when .disable_count is > enabled, and I did get that. Blindly propagating that up caused lustre > to get terribly confused - not too surprising really. Right, so this failure mode is speci

Re: [PATCH 5/6] rhashtable: support guaranteed successful insertion.

2018-03-27 Thread NeilBrown
On Tue, Mar 27 2018, Herbert Xu wrote: > On Tue, Mar 27, 2018 at 10:33:04AM +1100, NeilBrown wrote: >> The current rhashtable will fail an insertion if the hashtable >> it "too full", one of: >> - table already has 2^31 elements (-E2BIG) >> - a max_size was specified and table already has that >

Re: [PATCH 5/6] rhashtable: support guaranteed successful insertion.

2018-03-27 Thread Herbert Xu
On Tue, Mar 27, 2018 at 10:33:04AM +1100, NeilBrown wrote: > The current rhashtable will fail an insertion if the hashtable > it "too full", one of: > - table already has 2^31 elements (-E2BIG) > - a max_size was specified and table already has that >many elements (rounded up to power of 2) (

[PATCH 5/6] rhashtable: support guaranteed successful insertion.

2018-03-26 Thread NeilBrown
The current rhashtable will fail an insertion if the hashtable it "too full", one of: - table already has 2^31 elements (-E2BIG) - a max_size was specified and table already has that many elements (rounded up to power of 2) (-E2BIG) - a single chain has more than 16 elements (-EBUSY) - table