Re: [PATCH v3 1/3] rust: add a wrapper for the `num_possible_cpus` C function
From: Yury Norov
Date: Mon Oct 12 2026 - 12:06:00 EST
On Fri, Oct 02, 2026 at 11:07:00AM +0200, Miguel Ojeda wrote:
> On Fri, Oct 2, 2026 at 10:33 AM Andreas Hindborg <a.hindborg@xxxxxxxxxx> wrote:
> >
> > I don't think we need to split the helper C files by the headers they
> > are defined in. We can include multiple headers in a C file that
> > logically lumps things together. If you are worried about finding things
> > becoming difficult because they are not in the file one expect, I do not
> > share the concern. I usually just grep in the directory through my
> > editor.
>
> Of course, it doesn't need to be a strict split. But, where possible,
> I think it is better to match the C side for the helpers, because they
> are thin wrappers that need to be updated and maintained at the same
> time as the C side.
Yes, that's correct. This should mirror the kernel file structure
unless there's a strong reason to change that.
Andreas, can you put this into rust/helpers/cpumask.c, and please have
the __rust helper thing on a separate line for better greppability.
This patch creates a new file without a maintenance entry, which is a
no-go anyways, so we need v4.
> In any case, I mentioned it especially because `cpumask.h` already
> exists and because it avoids an extra `#include` as I mentioned.
>
> > I don't think we need that kind of granularity at the moment. If things
> > become messy, we can just refactor.
>
> Just in case: `cpumask.rs` already exists, i.e. we are not adding new
> granularity (or what do you mean by "at the moment" otherwise?)
>
> Cheers,
> Miguel