radix_tree_next_chunk: redundant search for next slot in hole

Valdis Kl=?utf-8?Q?=c4=93?=tnieks valdis.kletnieks at vt.edu
Fri May 3 18:38:39 EDT 2019


On Fri, 03 May 2019 16:03:46 -0500, Probir Roy said:

> While searching for next slot in a hole, it walks through the same
> slots over n over.

How did you determine this?

>           while (++offset < RADIX_TREE_MAP_SIZE) {
>                     void *slot = rcu_dereference_raw(   /* redundant slot walk */
>                             node->slots[offset]);
>                     if (slot)
>                         break;
>                 }

Looks to me like the ++offset will walk through each potential slot once,
and break out if it finds one.

I haven't looked at the code closely, perhaps what you're seeing is repeated
scan/merge/rescan behavior?  Often, compacting a data structure requires
multiple passes.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20190503/7d8259e2/attachment.sig>


More information about the Kernelnewbies mailing list