Mateusz Guzik wrote in <cagudohguhrbn7tugmrk4g0bc0nhvhodh82cyn77rifpw9me...@mail.gmail.com>: |On 2/8/23, Steffen Nurpmeso <[email protected]> wrote: |> Mateusz Guzik wrote in |> <[email protected]>: |> ... |>| Add nproc(1) ... |>| It aims to be compatible with nproc as found in GNU coreutils. |> |> That, "however", |> |> ... |>|+ if (all_flag) { |>|+ cpus = sysconf(_SC_NPROCESSORS_ONLN); |> |> is not compatible -- note i like the FreeBSD way better, and maybe |> someone should make a bug report even. |> |> #?0|kent:$ getconf -a|grep NPROC |> _NPROCESSORS_CONF 8 |> _NPROCESSORS_ONLN 4 |> #?0|kent:$ nproc |> 4 |> #?0|kent:$ nproc --all |> 8 |> #?0|kent:$ |> | |Is this from disabling hyperthreading?
Yes (compilations ~30-40% slower when enabled; last i tried). (Waiting for that tricky FINEIBT thing, maybe then again. Not that i really have an idea.) |I have a 40-way box, after doing it I see: |NPROCESSORS_CONF: 20 |NPROCESSORS_ONLN: 20 |_NPROCESSORS_CONF: 20 |_NPROCESSORS_ONLN: 20 | |iow it wont make a difference. I only get that in boxes. On bare metal i see the inactivated ones. By the way it was lscpu that requires /sys/ here, nproc works (i said it does not for the cpuset --count commit). And both coreutils as well as busybox variants use sched_getaffinity, indeed. Ciao, --steffen | |Der Kragenbaer, The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt)
