From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 23054 invoked from network); 3 Jul 2021 21:20:34 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 3 Jul 2021 21:20:34 -0000 Received: (qmail 8163 invoked by uid 550); 3 Jul 2021 21:20:31 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 8145 invoked from network); 3 Jul 2021 21:20:30 -0000 Date: Sat, 3 Jul 2021 23:20:18 +0200 From: Szabolcs Nagy To: Vincent Donnefort Cc: jyknight@google.com, musl@lists.openwall.com Message-ID: <20210703212018.GA3554268@port70.net> Mail-Followup-To: Vincent Donnefort , jyknight@google.com, musl@lists.openwall.com References: <20210702132937.GA239501@e120877-lin.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210702132937.GA239501@e120877-lin.cambridge.arm.com> Subject: Re: [musl] Re: Re: [PATCH v2] sysconf: add _SC_NPROCESSORS_CONF support * Vincent Donnefort [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)