From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: vmolnaro@redhat.com
Cc: linux-perf-users@vger.kernel.org, acme@redhat.com,
adrian.hunter@intel.com, atrajeev@linux.vnet.ibm.com,
irogers@google.com, jolsa@kernel.org, kjain@linux.ibm.com,
mpetlan@redhat.com, rstoyano@redhat.com
Subject: Re: [PATCH v3] perf test record.sh: Raise limit of open file descriptors
Date: Wed, 14 Aug 2024 12:32:36 -0300 [thread overview]
Message-ID: <ZrzOFDmwl9Z8F8NP@x1> (raw)
In-Reply-To: <20240814151734.15409-1-vmolnaro@redhat.com>
On Wed, Aug 14, 2024 at 05:17:34PM +0200, vmolnaro@redhat.com wrote:
> From: Veronika Molnarova <vmolnaro@redhat.com>
>
> Subtest for system-wide record with '--threads=cpu' option fails due
> to a limit of open file descriptors on systems with 128 or more CPUs
> as the default limit is set to 1024.
>
> The number of open file descriptors should be slightly above
> nmb_events*nmb_cpus + nmb_cpus(for perf.data.n) + 4*nmb_cpus(for pipes),
> which equals 8*nmb_cpus. Therefore, temporarily raise the limit to
> 16*nmb_cpus for the test.
So it is not applying anymore, Kan Liang changed that file, I'm fixing
it up:
⬢[acme@toolbox perf-tools-next]$ git am ./v3_20240814_vmolnaro_perf_test_record_sh_raise_limit_of_open_file_descriptors.mbx
Applying: perf test record.sh: Raise limit of open file descriptors
error: patch failed: tools/perf/tests/shell/record.sh:22
error: tools/perf/tests/shell/record.sh: patch does not apply
Patch failed at 0001 perf test record.sh: Raise limit of open file descriptors
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
⬢[acme@toolbox perf-tools-next]$
Doing it manually makes us go farther:
⬢[acme@toolbox perf-tools-next]$ patch -p1 < ./v3_20240814_vmolnaro_perf_test_record_sh_raise_limit_of_open_file_descriptors.mbx
patching file tools/perf/tests/shell/record.sh
Hunk #1 succeeded at 23 with fuzz 2 (offset 1 line).
Hunk #2 succeeded at 123 (offset 1 line).
Hunk #3 succeeded at 217 with fuzz 1 (offset 7 lines).
⬢[acme@toolbox perf-tools-next]$
After applying it with the resulting diff, I think we should not disable
those changes, just state the precise shell we think is needed for this
particular test:
⬢[acme@toolbox perf-tools-next]$ git diff
diff --git a/tools/perf/tests/shell/record.sh b/tools/perf/tests/shell/record.sh
index 28f5fe3b380e0b06..de913ebeb54ba220 100755
--- a/tools/perf/tests/shell/record.sh
+++ b/tools/perf/tests/shell/record.sh
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# perf record tests
# SPDX-License-Identifier: GPL-2.0
@@ -32,7 +32,6 @@ ulimit_supported=false
# outside of testing, thus raising the limit to 16*nmb_cpus
min_fd_limit=$(($(getconf _NPROCESSORS_ONLN) * 16))
-# shellcheck disable=SC3045 # ulimit is required for testing --threads option
default_fd_limit=$(ulimit -Sn)
if [ $? -eq 0 ]; then
ulimit_supported=true
@@ -219,7 +218,6 @@ test_branch_counter() {
# raise the limit of file descriptors to required minimum
if [ $ulimit_supported ] && [ $default_fd_limit -lt $min_fd_limit ]; then
- # shellcheck disable=SC3045 # ulimit is required for testing --threads option
ulimit -Sn $min_fd_limit
fi
@@ -231,7 +229,6 @@ test_branch_counter
# restore the default value
if [ $ulimit_supported ]; then
- # shellcheck disable=SC3045 # ulimit is required for testing --threads option
ulimit -Sn $default_fd_limit
fi
⬢[acme@toolbox perf-tools-next]$
I.e. just state that /bin/bash is needed, like is done in multiple other
shell tests:
⬢[acme@toolbox perf-tools-next]$ head -1 tools/perf/tests/shell/*.sh | grep bash | wc -l
16
⬢[acme@toolbox perf-tools-next]$
Ok? I'm applying it with this change. Thanks,
- Arnaldo
next prev parent reply other threads:[~2024-08-14 15:32 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-14 15:17 [PATCH v3] perf test record.sh: Raise limit of open file descriptors vmolnaro
2024-08-14 15:32 ` Arnaldo Carvalho de Melo [this message]
2024-08-14 15:35 ` Arnaldo Carvalho de Melo
2024-08-14 15:42 ` Veronika Molnarova
2024-08-14 15:54 ` Arnaldo Carvalho de Melo
2024-08-14 15:56 ` Arnaldo Carvalho de Melo
2024-08-14 16:04 ` Veronika Molnarova
2024-08-14 16:39 ` Arnaldo Carvalho de Melo
2024-08-14 15:58 ` Veronika Molnarova
2024-08-14 15:53 ` Arnaldo Carvalho de Melo
-- strict thread matches above, loose matches on Subject: below --
2024-08-14 15:47 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=ZrzOFDmwl9Z8F8NP@x1 \
--to=acme@kernel.org \
--cc=acme@redhat.com \
--cc=adrian.hunter@intel.com \
--cc=atrajeev@linux.vnet.ibm.com \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=kjain@linux.ibm.com \
--cc=linux-perf-users@vger.kernel.org \
--cc=mpetlan@redhat.com \
--cc=rstoyano@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).