From: "Vlastimil Babka (SUSE)" <vbabka@kernel.org>
To: Miguel Ojeda <ojeda@kernel.org>, broonie@kernel.org
Cc: harry@kernel.org, linux-kernel@vger.kernel.org,
linux-next@vger.kernel.org, paulmck@kernel.org,
puranjay@kernel.org, Alice Ryhl <aliceryhl@google.com>,
Boqun Feng <boqun@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: linux-next: manual merge of the slab tree with the rcu tree
Date: Fri, 31 Jul 2026 14:54:33 +0200 [thread overview]
Message-ID: <60021f1b-0533-430d-8ed3-6fa331b4e7e6@kernel.org> (raw)
In-Reply-To: <7abffd3a-cc96-46e9-a85b-7dbc9cadc21e@kernel.org>
On 7/31/26 11:59, Vlastimil Babka (SUSE) wrote:
> On 7/31/26 09:56, Miguel Ojeda wrote:
>> On Thu, 30 Jul 2026 15:38:48 +0100 Mark Brown <broonie@kernel.org> wrote:
>>>
>>> Today's linux-next merge of the slab tree got a conflict in:
>>>
>>> mm/slab_common.c
>>>
>>> between commit:
>>>
>>> 736084507faa3 ("rcu: Rename struct rcu_gp_oldstate to rcu_gp_seq")
>>>
>>> from the rcu tree and commit:
>>>
>>> bdd0cc9f0ffc3 ("mm/slab: introduce struct kvfree_rcu_head for kvfree_rcu batching")
>>>
>>> from the slab tree.
>>
>> The slab one semantically conflicts as well with commit:
>>
>> e5e86df8b666 ("rust: poll: use kfree_rcu() for PollCondVar")
>>
>> from the char-misc tree:
>>
>> 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
>> --> rust/bindings/bindings_generated.rs:90407:12
>> |
>> 90407 | pub fn kvfree_call_rcu(head: *mut kvfree_rcu_head, ptr: *mut ffi::c_void);
>> | ^^^^^^^^^^^^^^^
>>
>> The C API was not meant to have a visible effect, but we don't use the
>> `kvfree_rcu()` macro, so we notice the change. We can add a similar cast
>> to the C side:
>>
>> diff --git a/rust/kernel/sync/poll.rs b/rust/kernel/sync/poll.rs
>> index 684dfa242b1a..79d7e08215b0 100644
>> --- a/rust/kernel/sync/poll.rs
>> +++ b/rust/kernel/sync/poll.rs
>> @@ -172,6 +172,6 @@ fn drop(&mut self) {
>> unsafe { bindings::__wake_up_pollfree((*ptr).inner.inner.wait_queue_head.get()) };
>>
>> // SAFETY: This was allocated using `KBox::pin_init`, so it can be freed with `kvfree`.
>> - unsafe { bindings::kvfree_call_rcu((*ptr).rcu.get(), ptr.cast::<ffi::c_void>()) };
>> + unsafe { bindings::kvfree_call_rcu((*ptr).rcu.get().cast(), ptr.cast::<ffi::c_void>()) };
>> }
>> }
>>
>> Clippy doesn't complain about the "unneeded" `cast()` under
>> `CONFIG_KVFREE_RCU_BATCHED=n`, so it should be fine.
>
> Thanks! Should I thus amend bdd0cc9f0ffc3 ("mm/slab: introduce struct
> kvfree_rcu_head for kvfree_rcu batching") with this fixup or you'll do that
> in the char-misc tree?
I see, it has to be in char-misc which introduces that patched code, we
don't have it.
>> Cc: Alice Ryhl <aliceryhl@google.com>
>> Cc: Boqun Feng <boqun@kernel.org>
>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>> Cc: Harry Yoo (Oracle) <harry@kernel.org>
>> Cc: Vlastimil Babka (SUSE) <vbabka@kernel.org>
>>
>> Cheers,
>> Miguel
>
next prev parent reply other threads:[~2026-07-31 12:54 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-30 14:38 linux-next: manual merge of the slab tree with the rcu tree Mark Brown
2026-07-30 17:31 ` Paul E. McKenney
2026-07-31 7:56 ` Miguel Ojeda
2026-07-31 9:59 ` Vlastimil Babka (SUSE)
2026-07-31 12:54 ` Vlastimil Babka (SUSE) [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-02-12 4:09 Stephen Rothwell
2025-02-12 5:34 ` Boqun Feng
2024-08-12 2:47 Stephen Rothwell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=60021f1b-0533-430d-8ed3-6fa331b4e7e6@kernel.org \
--to=vbabka@kernel.org \
--cc=aliceryhl@google.com \
--cc=boqun@kernel.org \
--cc=broonie@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=harry@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=ojeda@kernel.org \
--cc=paulmck@kernel.org \
--cc=puranjay@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.