Re: [PATCH] bcache: wait for RCU grace period before rehashing btree node

From: Alan Huang

Date: Fri Dec 04 2026 - 03:43:45 EST


Hi Bilal,

If the find doesn’t find a node that actually exists in the hlist(due to move), it will re-find under bucket lock.

If the find does find one node, the key will be re-validated under b->lock.

Thanks,
Alan

> 在 2026年12月4日,08:44,Bilal Hashim <AeeSec@xxxxxxx> 写道:
>
> Hi Coly,
>
> I'm a real person, sorry for the overly formal patch wording — I'm still
> getting used to kernel mailing list conventions.
>
> I ran into the hlist_del_init_rcu() / hlist_add_head_rcu() reuse in
> mca_alloc() while reading through the btree cache path and tested the
> change in QEMU with lockdep enabled. If synchronize_rcu() here isn't
> acceptable due to latency or if there's a better way to handle this
> in bcache, I'm happy to look into an alternative approach or drop it
> based on your feedback.
>
> Thanks,
> Bilal
>
>