* [musl] Re: Re: [PATCH v2] sysconf: add _SC_NPROCESSORS_CONF support
@ 2021-07-02 13:29 Vincent Donnefort
2021-07-03 21:20 ` Szabolcs Nagy
0 siblings, 1 reply; 3+ messages in thread
From: Vincent Donnefort @ 2021-07-02 13:29 UTC (permalink / raw)
To: jyknight, musl
Hi James,
Here's a new thread as I never received your previous email and I just
noticed the answer today.
I'm not sure I understand why I can't use "present". As per the kernel
documentation:
possible: CPUs that have been allocated resources and can be
brought online if they are present. [cpu_possible_mask]
present: CPUs that have been identified as being present in the
system. [cpu_present_mask]
In this example, the NR_CPUS config option is 128, but the kernel was
started with possible_cpus=144. There are 4 CPUs in the system and cpu2
was manually taken offline (and is the only CPU that can be brought
online.)::
kernel_max: 127
offline: 2,4-127,128-143
online: 0-1,3
possible: 0-127
present: 0-3
So indeed I could use "possible"... but there's a chance the two masks won't
be equal, and the sysfs entries are matching "present", not "possible".
"possible" is the CPUs that have allocated resources and can be physically
added to the system. "present" is the CPUs that are known as physically
present but might be offline.
--
Vincent
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [musl] Re: Re: [PATCH v2] sysconf: add _SC_NPROCESSORS_CONF support
2021-07-02 13:29 [musl] Re: Re: [PATCH v2] sysconf: add _SC_NPROCESSORS_CONF support Vincent Donnefort
@ 2021-07-03 21:20 ` Szabolcs Nagy
2021-07-06 9:00 ` Vincent Donnefort
0 siblings, 1 reply; 3+ messages in thread
From: Szabolcs Nagy @ 2021-07-03 21:20 UTC (permalink / raw)
To: Vincent Donnefort; +Cc: jyknight, musl
* Vincent Donnefort <vincent.donnefort@arm.com> [2021-07-02 14:29:37 +0100]:
> Here's a new thread as I never received your previous email and I just
> noticed the answer today.
>
> I'm not sure I understand why I can't use "present". As per the kernel
> documentation:
>
> possible: CPUs that have been allocated resources and can be
> brought online if they are present. [cpu_possible_mask]
>
> present: CPUs that have been identified as being present in the
> system. [cpu_present_mask]
>
>
> In this example, the NR_CPUS config option is 128, but the kernel was
> started with possible_cpus=144. There are 4 CPUs in the system and cpu2
> was manually taken offline (and is the only CPU that can be brought
> online.)::
>
> kernel_max: 127
> offline: 2,4-127,128-143
> online: 0-1,3
> possible: 0-127
> present: 0-3
>
> So indeed I could use "possible"... but there's a chance the two masks won't
> be equal, and the sysfs entries are matching "present", not "possible".
>
> "possible" is the CPUs that have allocated resources and can be physically
> added to the system. "present" is the CPUs that are known as physically
> present but might be offline.
i guess we just need a guarantee that these interfaces are stable
and the set of present cpus don't change during the lifetime of a
process. (can that even work with checkpoint/restore? probably not
our problem)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [musl] Re: Re: [PATCH v2] sysconf: add _SC_NPROCESSORS_CONF support
2021-07-03 21:20 ` Szabolcs Nagy
@ 2021-07-06 9:00 ` Vincent Donnefort
0 siblings, 0 replies; 3+ messages in thread
From: Vincent Donnefort @ 2021-07-06 9:00 UTC (permalink / raw)
To: jyknight, musl
On Sat, Jul 03, 2021 at 11:20:18PM +0200, Szabolcs Nagy wrote:
> * Vincent Donnefort <vincent.donnefort@arm.com> [2021-07-02 14:29:37 +0100]:
> > Here's a new thread as I never received your previous email and I just
> > noticed the answer today.
> >
> > I'm not sure I understand why I can't use "present". As per the kernel
> > documentation:
> >
> > possible: CPUs that have been allocated resources and can be
> > brought online if they are present. [cpu_possible_mask]
> >
> > present: CPUs that have been identified as being present in the
> > system. [cpu_present_mask]
> >
> >
> > In this example, the NR_CPUS config option is 128, but the kernel was
> > started with possible_cpus=144. There are 4 CPUs in the system and cpu2
> > was manually taken offline (and is the only CPU that can be brought
> > online.)::
> >
> > kernel_max: 127
> > offline: 2,4-127,128-143
> > online: 0-1,3
> > possible: 0-127
> > present: 0-3
> >
> > So indeed I could use "possible"... but there's a chance the two masks won't
> > be equal, and the sysfs entries are matching "present", not "possible".
> >
> > "possible" is the CPUs that have allocated resources and can be physically
> > added to the system. "present" is the CPUs that are known as physically
> > present but might be offline.
>
> i guess we just need a guarantee that these interfaces are stable
> and the set of present cpus don't change during the lifetime of a
> process. (can that even work with checkpoint/restore? probably not
> our problem)
In that case "possible" is what we want. It can't change during the kernel
lifetime, while "present" can.
--
Vincent
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-07-06 9:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-02 13:29 [musl] Re: Re: [PATCH v2] sysconf: add _SC_NPROCESSORS_CONF support Vincent Donnefort
2021-07-03 21:20 ` Szabolcs Nagy
2021-07-06 9:00 ` Vincent Donnefort
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).