* rust compile failure in next-20260730
@ 2026-07-31 12:28 Bert Karwatzki
2026-07-31 13:19 ` Thorsten Leemhuis
2026-07-31 19:25 ` Nathan Chancellor
0 siblings, 2 replies; 4+ messages in thread
From: Bert Karwatzki @ 2026-07-31 12:28 UTC (permalink / raw)
To: Harry Yoo; +Cc: Bert Karwatzki, linux-kernel, linux-next, Vlastimil Babka
With next-20260730 building a kernel with CONFIG_RUST=y fails with
the following error:
RUSTC L rust/kernel.o
error[E0308]: mismatched types
--> rust/kernel/sync/poll.rs:175:44
|
175 | unsafe { bindings::kvfree_call_rcu((*ptr).rcu.get(), ptr.cast::<ffi::c_void>()) };
| ------------------------- ^^^^^^^^^^^^^^^^ expected `*mut kvfree_rcu_head`, found `*mut callback_head`
| |
| arguments to this function are incorrect
|
= note: expected raw pointer `*mut bindings::kvfree_rcu_head`
found raw pointer `*mut bindings::callback_head`
note: function defined here
--> /mnt/data/linux-forest/linux-next/rust/bindings/bindings_generated.rs:73708:12
|
73708 | pub fn kvfree_call_rcu(head: *mut kvfree_rcu_head, ptr: *mut ffi::c_void);
| ^^^^^^^^^^^^^^^
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0308`.
make[5]: *** [rust/Makefile:781: rust/kernel.o] Fehler 1
make[4]: *** [Makefile:1420: prepare] Fehler 2
make[3]: *** [debian/rules:80: build-arch] Fehler 2
Reverting the following commits:
ef32a74f8f6a ("mm/slab: introduce kfree_rcu_nolock()")
bdd0cc9f0ffc ("mm/slab: introduce struct kvfree_rcu_head for kvfree_rcu batching")
make the compilation work again.
Bert Karwatzki
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: rust compile failure in next-20260730
2026-07-31 12:28 rust compile failure in next-20260730 Bert Karwatzki
@ 2026-07-31 13:19 ` Thorsten Leemhuis
2026-07-31 13:48 ` Luna Jernberg
2026-07-31 19:25 ` Nathan Chancellor
1 sibling, 1 reply; 4+ messages in thread
From: Thorsten Leemhuis @ 2026-07-31 13:19 UTC (permalink / raw)
To: Bert Karwatzki, Harry Yoo
Cc: linux-kernel, linux-next, Vlastimil Babka,
Linux kernel regressions list
On 7/31/26 14:28, Bert Karwatzki wrote:
> With next-20260730 building a kernel with CONFIG_RUST=y fails with
> the following error:
Ran into this, too. Fixing this is discussed in this thread:
https://lore.kernel.org/all/20260731075644.20215-1-ojeda@kernel.org/
> RUSTC L rust/kernel.o
> error[E0308]: mismatched types
> --> rust/kernel/sync/poll.rs:175:44
> |
> 175 | unsafe { bindings::kvfree_call_rcu((*ptr).rcu.get(), ptr.cast::<ffi::c_void>()) };
> | ------------------------- ^^^^^^^^^^^^^^^^ expected `*mut kvfree_rcu_head`, found `*mut callback_head`
> | |
> | arguments to this function are incorrect
> |
> = note: expected raw pointer `*mut bindings::kvfree_rcu_head`
> found raw pointer `*mut bindings::callback_head`
> note: function defined here
> --> /mnt/data/linux-forest/linux-next/rust/bindings/bindings_generated.rs:73708:12
> |
> 73708 | pub fn kvfree_call_rcu(head: *mut kvfree_rcu_head, ptr: *mut ffi::c_void);
> | ^^^^^^^^^^^^^^^
>
> error: aborting due to 1 previous error
>
> For more information about this error, try `rustc --explain E0308`.
> make[5]: *** [rust/Makefile:781: rust/kernel.o] Fehler 1
> make[4]: *** [Makefile:1420: prepare] Fehler 2
> make[3]: *** [debian/rules:80: build-arch] Fehler 2
>
> Reverting the following commits:
> ef32a74f8f6a ("mm/slab: introduce kfree_rcu_nolock()")
> bdd0cc9f0ffc ("mm/slab: introduce struct kvfree_rcu_head for kvfree_rcu batching")
>
> make the compilation work again.
>
> Bert Karwatzki
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: rust compile failure in next-20260730
2026-07-31 13:19 ` Thorsten Leemhuis
@ 2026-07-31 13:48 ` Luna Jernberg
0 siblings, 0 replies; 4+ messages in thread
From: Luna Jernberg @ 2026-07-31 13:48 UTC (permalink / raw)
To: Thorsten Leemhuis, spasswolf, Luna Jernberg
Cc: Harry Yoo, linux-kernel, linux-next, Vlastimil Babka,
Linux kernel regressions list
Noticed this too
Den fre 31 juli 2026 kl 15:21 skrev Thorsten Leemhuis <linux@leemhuis.info>:
>
> On 7/31/26 14:28, Bert Karwatzki wrote:
> > With next-20260730 building a kernel with CONFIG_RUST=y fails with
> > the following error:
>
> Ran into this, too. Fixing this is discussed in this thread:
> https://lore.kernel.org/all/20260731075644.20215-1-ojeda@kernel.org/
>
> > RUSTC L rust/kernel.o
> > error[E0308]: mismatched types
> > --> rust/kernel/sync/poll.rs:175:44
> > |
> > 175 | unsafe { bindings::kvfree_call_rcu((*ptr).rcu.get(), ptr.cast::<ffi::c_void>()) };
> > | ------------------------- ^^^^^^^^^^^^^^^^ expected `*mut kvfree_rcu_head`, found `*mut callback_head`
> > | |
> > | arguments to this function are incorrect
> > |
> > = note: expected raw pointer `*mut bindings::kvfree_rcu_head`
> > found raw pointer `*mut bindings::callback_head`
> > note: function defined here
> > --> /mnt/data/linux-forest/linux-next/rust/bindings/bindings_generated.rs:73708:12
> > |
> > 73708 | pub fn kvfree_call_rcu(head: *mut kvfree_rcu_head, ptr: *mut ffi::c_void);
> > | ^^^^^^^^^^^^^^^
> >
> > error: aborting due to 1 previous error
> >
> > For more information about this error, try `rustc --explain E0308`.
> > make[5]: *** [rust/Makefile:781: rust/kernel.o] Fehler 1
> > make[4]: *** [Makefile:1420: prepare] Fehler 2
> > make[3]: *** [debian/rules:80: build-arch] Fehler 2
> >
> > Reverting the following commits:
> > ef32a74f8f6a ("mm/slab: introduce kfree_rcu_nolock()")
> > bdd0cc9f0ffc ("mm/slab: introduce struct kvfree_rcu_head for kvfree_rcu batching")
> >
> > make the compilation work again.
> >
> > Bert Karwatzki
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: rust compile failure in next-20260730
2026-07-31 12:28 rust compile failure in next-20260730 Bert Karwatzki
2026-07-31 13:19 ` Thorsten Leemhuis
@ 2026-07-31 19:25 ` Nathan Chancellor
1 sibling, 0 replies; 4+ messages in thread
From: Nathan Chancellor @ 2026-07-31 19:25 UTC (permalink / raw)
To: Bert Karwatzki
Cc: Harry Yoo, linux-kernel, linux-next, Vlastimil Babka, Alice Ryhl,
Boqun Feng, Greg Kroah-Hartman, rust-for-linux
+ folks from e5e86df8b666
On Fri, Jul 31, 2026 at 02:28:25PM +0200, Bert Karwatzki wrote:
> With next-20260730 building a kernel with CONFIG_RUST=y fails with
> the following error:
>
> RUSTC L rust/kernel.o
> error[E0308]: mismatched types
> --> rust/kernel/sync/poll.rs:175:44
> |
> 175 | unsafe { bindings::kvfree_call_rcu((*ptr).rcu.get(), ptr.cast::<ffi::c_void>()) };
> | ------------------------- ^^^^^^^^^^^^^^^^ expected `*mut kvfree_rcu_head`, found `*mut callback_head`
> | |
> | arguments to this function are incorrect
> |
> = note: expected raw pointer `*mut bindings::kvfree_rcu_head`
> found raw pointer `*mut bindings::callback_head`
> note: function defined here
> --> /mnt/data/linux-forest/linux-next/rust/bindings/bindings_generated.rs:73708:12
> |
> 73708 | pub fn kvfree_call_rcu(head: *mut kvfree_rcu_head, ptr: *mut ffi::c_void);
> | ^^^^^^^^^^^^^^^
>
> error: aborting due to 1 previous error
>
> For more information about this error, try `rustc --explain E0308`.
> make[5]: *** [rust/Makefile:781: rust/kernel.o] Fehler 1
> make[4]: *** [Makefile:1420: prepare] Fehler 2
> make[3]: *** [debian/rules:80: build-arch] Fehler 2
>
> Reverting the following commits:
> ef32a74f8f6a ("mm/slab: introduce kfree_rcu_nolock()")
> bdd0cc9f0ffc ("mm/slab: introduce struct kvfree_rcu_head for kvfree_rcu batching")
>
> make the compilation work again.
This is a collision between commit e5e86df8b666 ("rust: poll: use
kfree_rcu() for PollCondVar") in the char-misc tree and the
aforementioned commit bdd0cc9f0ffc ("mm/slab: introduce struct
kvfree_rcu_head for kvfree_rcu batching") in the slab tree.
Something like this avoids the error for me but I am not sure if it is
a proper fix.
diff --git a/rust/kernel/sync/poll.rs b/rust/kernel/sync/poll.rs
index 684dfa242b1a..5b12d5d4e9af 100644
--- a/rust/kernel/sync/poll.rs
+++ b/rust/kernel/sync/poll.rs
@@ -124,6 +124,9 @@ pub struct PollCondVarBox {
struct PollCondVarBoxInner {
#[pin]
inner: PollCondVar,
+ #[cfg(CONFIG_KVFREE_RCU_BATCHED)]
+ rcu: Opaque<bindings::kvfree_rcu_head>,
+ #[cfg(not(CONFIG_KVFREE_RCU_BATCHED))]
rcu: Opaque<bindings::callback_head>,
}
--
Cheers,
Nathan
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-07-31 19:25 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-31 12:28 rust compile failure in next-20260730 Bert Karwatzki
2026-07-31 13:19 ` Thorsten Leemhuis
2026-07-31 13:48 ` Luna Jernberg
2026-07-31 19:25 ` Nathan Chancellor
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.