unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer via Libc-alpha <libc-alpha@sourceware.org>
To: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Cc: Nicolas Saenz Julienne <nsaenzju@redhat.com>, libc-alpha@sourceware.org
Subject: Re: [PATCH v2 3/3] linux: Revert the use of sched_getaffinity on get_nproc (BZ #28310)
Date: Mon, 13 Sep 2021 13:05:55 +0200	[thread overview]
Message-ID: <87o88wd9bg.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <20210907122259.79800-4-adhemerval.zanella@linaro.org> (Adhemerval Zanella's message of "Tue, 7 Sep 2021 09:22:59 -0300")

* Adhemerval Zanella:

> The use of sched_getaffinity on get_nproc and
> sysconf (_SC_NPROCESSORS_ONLN) done in 903bc7dcc2acafc40 (BZ #27645)
> breaks the top command in common hypervisor configurations and also
> other monitoring tools.
>
> The main issue using sched_getaffinity changed the symbols semantic
> from system-wide scope of online CPUs to per-process one (which can
> be changed with kernel cpusets or book parameters in VM).
>
> This patch reverts mostly of the 903bc7dcc2acafc40, with the
> exceptions:
>
>   * No more cached values and atomic updates, since they are inherent
>     racy.
>
>   * No /proc/cpuinfo fallback, since /proc/stat is already used and
>     it would require to revert more arch-specific code.
>
>   * The alloca is replace with a static buffer of 1024 bytes.
>
> So the implementation first consult the sysfs, and fallbacks to procfs.

Looks okay.

Reviewed-by: Florian Weimer <fweimer@redhat.com>

Thanks,
Florian


      reply	other threads:[~2021-09-13 11:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-07 12:22 [PATCH v2 0/3] Revert the use of sched_getaffinity on get_nproc Adhemerval Zanella via Libc-alpha
2021-09-07 12:22 ` [PATCH v2 1/3] misc: Add __get_nprocs_sched Adhemerval Zanella via Libc-alpha
2021-09-13 11:05   ` Florian Weimer via Libc-alpha
2021-09-07 12:22 ` [PATCH v2 2/3] linux: Simplify get_nprocs Adhemerval Zanella via Libc-alpha
2021-09-13 11:04   ` Florian Weimer via Libc-alpha
2021-09-07 12:22 ` [PATCH v2 3/3] linux: Revert the use of sched_getaffinity on get_nproc (BZ #28310) Adhemerval Zanella via Libc-alpha
2021-09-13 11:05   ` Florian Weimer via Libc-alpha [this message]

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

  List information: https://www.gnu.org/software/libc/involved.html

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

  git send-email \
    --in-reply-to=87o88wd9bg.fsf@oldenburg.str.redhat.com \
    --to=libc-alpha@sourceware.org \
    --cc=adhemerval.zanella@linaro.org \
    --cc=fweimer@redhat.com \
    --cc=nsaenzju@redhat.com \
    /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).