Re: [PATCH v3 1/3] rust: add a wrapper for the `num_possible_cpus` C function
From: Andreas Hindborg
Date: Fri Oct 02 2026 - 04:39:21 EST
"Miguel Ojeda" <miguel.ojeda.sandonis@xxxxxxxxx> writes:
> On Wed, Sep 30, 2026 at 1:38 PM Miguel Ojeda
> <miguel.ojeda.sandonis@xxxxxxxxx> wrote:
>>
>> I can do it.
>
> Actually, `cpumask.c` may be better -- that is where C defines it and
> that helper has the right `#include`.
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.
But I also don't care. If you want to put it in another file, I will not
object at all.
> Which in turn makes me wonder if we should also put the Rust one in
> `cpumask.rs` instead, rather than `cpu.rs`.
I don't think we need that kind of granularity at the moment. If things
become messy, we can just refactor.
> However, we do already have `nr_cpu_ids()` in `cpu.rs`, though, which
> is however in `cpumask.h` in C.
It's fine.
Best regards,
Andreas Hindborg