[DTrace-devel] [PATCH 3/7] htab: add dt_htab_insert_unique

Nick Alcock nick.alcock at oracle.com
Thu Oct 21 04:11:33 PDT 2021


On 13 Oct 2021, Eugene Loh told this:

> On 10/13/21 8:19 AM, Nick Alcock wrote:
>>> one now?  Or, are we rerunning the search merely for the side effect of
>>> recomputing idx?
>> The latter :) it avoids having to write the bucket search loop twice.
>> We're retrying the bucket search.
> I still don't understand.  If the bucket search fails the first time, 
> don't we already know it will fail again after the resizing? The only 
> side effect I see is the recomputation of idx, which is more easily done 
> by replacing "goto retry" with "idx = hval & htab->mask".

It's just for the recomputation. I think this was allowing for the
possibility of future hashing schemes having a resize() that might place
things in shared buckets after resize that weren't there before: but
that's obviously impossible in the current scheme.

If it works (which it should), this change will be in v3.

-- 
NULL && (void)



More information about the DTrace-devel mailing list