public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Szabolcs Nagy <szabolcs.nagy@arm.com>
To: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Cc: libc-alpha@sourceware.org, Florian Weimer <fweimer@redhat.com>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	Carlos O'Donell <carlos@redhat.com>
Subject: Re: [PATCH v2] stdlib: Tuned down tst-arc4random-thread internal parameters
Date: Thu, 28 Jul 2022 13:25:16 +0100	[thread overview]
Message-ID: <YuKALD7B3FU3Y6jL@arm.com> (raw)
In-Reply-To: <20220727131031.2016648-1-adhemerval.zanella@linaro.org>

The 07/27/2022 10:10, Adhemerval Zanella via Libc-alpha wrote:
> +  /* Do not run more threads than the maximum of online CPUs.  */
> +  long int cpus = sysconf (_SC_NPROCESSORS_ONLN);
> +  if (cpus != -1)
> +    /* Limit the number to not overload the system.  */
> +    outer_threads = (cpus / 2) / inner_threads ?: 1;

on my glibc test system

$ getconf _NPROCESSORS_ONLN
160
$ nproc
16
$ taskset -c 0 getconf _NPROCESSORS_ONLN
160
$ taskset -c 0 nproc
1

this is in a cgroup with a fixed cpuset 0-15.

sched_getaffinity might be better for this.

      reply	other threads:[~2022-07-28 12:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-27 13:10 Adhemerval Zanella
2022-07-28 12:25 ` Szabolcs Nagy [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

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

  git send-email \
    --in-reply-to=YuKALD7B3FU3Y6jL@arm.com \
    --to=szabolcs.nagy@arm.com \
    --cc=Jason@zx2c4.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=carlos@redhat.com \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@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).