Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 27 Jul 2022 19:58:59 +0200
From: Szabolcs Nagy <nsz@...t70.net>
To: Rob Landley <rob@...dley.net>
Cc: musl@...ts.openwall.com
Subject: Re: Re: sysconf(_SC_NPROCESSORS_CONF) broken.

* Rob Landley <rob@...dley.net> [2022-07-27 01:34:41 -0500]:

> On 7/27/22 01:28, Rob Landley wrote:
> > NPROCESSORS_CONF is supposed to show total processors, NPROCESSORS_ONLN shows
> > available processors using the tasket mask sched_getaffinity()).
> > 
> > Musl is (uniquely) using the getaffinity() version for both. Neither glibc nor
> > bionic have that bug.
> > 
> > Test: my laptop has 4 processors:
> > 
> > $ taskset 7 nproc
> > 3
> > $ taskset 7 nproc --all
> > 4
> > 
> > With musl, both show 3.
> 
> P.S. According to strace, devuan's nprocs --all is reading sysfs:
> 
> openat(AT_FDCWD, "/sys/devices/system/cpu",
> O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 3
> fstat(3, {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
> getdents64(3, /* 22 entries */, 32768)  = 656
> getdents64(3, /* 0 entries */, 32768)   = 0
> 
> At a guess, counting the cpu[0-9]* entries? I looked at bionic's source and it
> had a comment that x86 can use /proc/cpuinfo but arm only shows "available"
> processors there, not total processors...

i think the most recent thread on the topic:
https://www.openwall.com/lists/musl/2021/07/06/2

an older discussion is at
https://www.openwall.com/lists/musl/2019/03/15/5

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.