linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: vmolnaro@redhat.com
Cc: linux-perf-users@vger.kernel.org, acme@redhat.com,
	mpetlan@redhat.com,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] perf test record.sh: Raise limit of open file descriptors
Date: Tue, 21 Nov 2023 09:32:38 -0300	[thread overview]
Message-ID: <ZVyjZjPCXVmGGVFk@kernel.org> (raw)
In-Reply-To: <20231115140522.28200-1-vmolnaro@redhat.com>

Em Wed, Nov 15, 2023 at 03:05:22PM +0100, vmolnaro@redhat.com escreveu:
> From: Veronika Molnarova <vmolnaro@redhat.com>
 
> Subtest for system-wide record with '--threads' option fails due to a
> limit of open file descriptors(usually set to 1024) on systems with
> 128 and more CPUs.
> 
> If the default limit is set lower than 2048 file descriptors,
> temporarily raise it to this value for the test.

Can we instead raise it to a multiple of the number of CPUs? Using:

[acme@five ~]$ getconf _NPROCESSORS_ONLN
32
[acme@five ~]$

If you tested 2048 is ok for a 128 CPU system, then maybe this is more
future proof:

[acme@five ~]$ echo $(($(getconf _NPROCESSORS_ONLN) * 16))
512
[acme@five ~]$ echo $((128 * 16))
2048
[acme@five ~]$

- Arnaldo
 
> Signed-off-by: Veronika Molnarova <vmolnaro@redhat.com>
> ---
>  tools/perf/tests/shell/record.sh | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/tools/perf/tests/shell/record.sh b/tools/perf/tests/shell/record.sh
> index 4fbc74805d52..c6c43263809a 100755
> --- a/tools/perf/tests/shell/record.sh
> +++ b/tools/perf/tests/shell/record.sh
> @@ -11,6 +11,8 @@ err=0
>  perfdata=$(mktemp /tmp/__perf_test.perf.data.XXXXX)
>  testprog="perf test -w thloop"
>  testsym="test_loop"
> +min_fd_limit=2048
> +default_fd_limit=$(ulimit -n)
>  
>  cleanup() {
>    rm -rf "${perfdata}"
> @@ -154,10 +156,16 @@ test_workload() {
>    echo "Basic target workload test [Success]"
>  }
>  
> +if [[ $default_fd_limit -lt $min_fd_limit ]]; then
> +	ulimit -n $min_fd_limit
> +fi
> +
>  test_per_thread
>  test_register_capture
>  test_system_wide
>  test_workload
>  
> +ulimit -n $default_fd_limit
> +
>  cleanup
>  exit $err
> -- 
> 2.41.0

  reply	other threads:[~2023-11-21 12:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-15 14:05 [PATCH] perf test record.sh: Raise limit of open file descriptors vmolnaro
2023-11-21 12:32 ` Arnaldo Carvalho de Melo [this message]
2023-11-30 21:29   ` vmolnaro
  -- strict thread matches above, loose matches on Subject: below --
2024-03-20 14:19 [PATCH v2] " Arnaldo Carvalho de Melo
2024-03-28 15:46 ` [PATCH] " vmolnaro

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=ZVyjZjPCXVmGGVFk@kernel.org \
    --to=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mpetlan@redhat.com \
    --cc=vmolnaro@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 NNTP newsgroup(s).