public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "adhemerval.zanella at linaro dot org" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sourceware.org
Subject: [Bug libc/30135] sysconf: _SC_NPROCESSORS*: tweak?
Date: Mon, 20 Feb 2023 22:46:00 +0000	[thread overview]
Message-ID: <bug-30135-131-fUdjiQO0vY@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-30135-131@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=30135

--- Comment #3 from Adhemerval Zanella <adhemerval.zanella at linaro dot org> ---
(In reply to Steffen Nurpmeso from comment #2)
> . sysconf and _SC_NPROCESSORS_ONLN is the only standardized variant,
> sched_getaffinity() is not a portable interface.
> 
> . I feel "currently available to run threads" pretty much matches that
> CPU_COUNT() thing that nproc(1) uses.
> 
> . For example, look at zstd(1), they use sysconf(_SC_NPROCESSORS_ONLN) to
> realize -T0.  Same for xz(1).
> This is _all_ wrong in my cgroup restricted environment, they potentially
> "over-thread".
> 
> . Quite the opposite, top(1) is to be changed (a bit strange as my version
> is from https://gitlab.com/procps-ng aka /proc based)
> If i run it in a cgroup-mutilated environment with three CPUs, it lists a
> fourth one that is out of scope!
> 
> . I have not checked virtual machines.  It astounds me they use synthesized
> CPU counts instead of the CPU count that truly is available.

Fell free to rehash this discussion on libc-alpha, but as I said we already
tried it and since it turned out to generate a lot of unseen problems we
decided to revert and use sysfs instead.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2023-02-20 22:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-18 20:25 [Bug libc/30135] New: " steffen at sdaoden dot eu
2023-02-18 20:26 ` [Bug libc/30135] " steffen at sdaoden dot eu
2023-02-20 20:28 ` adhemerval.zanella at linaro dot org
2023-02-20 20:50 ` steffen at sdaoden dot eu
2023-02-20 22:46 ` adhemerval.zanella at linaro dot org [this message]
2023-02-20 23:47 ` steffen at sdaoden dot eu
2023-02-21  8:59 ` sam at gentoo dot org
2023-02-21 10:25 ` fweimer at redhat dot com
2023-02-21 17:31 ` steffen at sdaoden dot eu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-30135-131-fUdjiQO0vY@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).