Re: [PATCH v3 1/3] rust: add a wrapper for the `num_possible_cpus` C function

From: Miguel Ojeda

Date: Fri Oct 02 2026 - 05:09:53 EST


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.

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