Re: rust compile failure in next-20260730
From: Harry Yoo
Date: Thu Aug 06 2026 - 01:52:46 EST
On Tue, Aug 04, 2026 at 12:35:42PM +0200, Vlastimil Babka (SUSE) wrote:
> On 8/4/26 12:10, Gary Guo wrote:
> > On Mon Aug 3, 2026 at 10:04 PM BST, Vlastimil Babka (SUSE) wrote:
> >> On 8/3/26 17:32, Gary Guo wrote:
> >>> On Mon Aug 3, 2026 at 4:10 PM BST, Vlastimil Babka (SUSE) wrote:
> >>>> On 8/3/26 16:23, Boqun Feng wrote:
> >>>>> On Mon, Aug 03, 2026 at 02:57:49PM +0100, Gary Guo wrote:
> >>>>>>
> >>>>>> We could also unconditionally use `kvfree_rcu_head` here, and
> >>>>>> add
> >>>>>>
> >>>>>> #[cfg(not(CONFIG_KVFREE_RCU_BATCHED))]
> >>>>>> pub type kvfree_rcu_head = callback_head;
> >>>>>>
> >>>>>> to bindings.rs?
> >>>>>>
> >>>>>
> >>>>> This option is currently not maintainable unless it becomes a
> >>>>> maintainer-aware way to handle things like this.
> >>>>>
> >>>>>> (Or even better, changing `#define` to `typedef` so bindgen takes care of
> >>>>>> everything).
> >>>>>>
> >>>>>
> >>>>> Yes, this is better IMO, but it's up to slab maintainers. :-)
> >>>>
> >>>> Can you elaborate a bit please, how would that look like?
> >>>
> >>> I was thinking of doing `typedef struct rcu_head kvfree_rcu_head;` but of course
> >>> that didn't work because you can't use typedef to create `kvfree_rcu_head` :)
> >>>
> >>> However, something like this could work?
> >>>
> >>> #ifdef CONFIG_KVFREE_RCU_BATCHED
> >>> ...
> >>> #else
> >>> struct kvfree_rcu_head {
> >>> struct rcu_head head;
> >>> };
> >>> #endif
> >>>
> >>> and everywhere add a cast everywhere that expects kvfree_rcu_head == rcu_head.
> >>>
> >>> but this would indeed be more complex :(
> >>
> >> So you mean like this? Doesn't seem so complex and seems to compile here
> >> with CONFIG_KVFREE_RCU_BATCHED both disabled and enabled.
> >
> > I thought that a lot more places have to be updated, but it looks from your diff
> > below that this is simple enough.
>
> Thanks. The slab/for-next branch now includes the slab changes.
The slab changes looks good to me, thanks!
--
Cheers,
Harry / Hyeonggon