From: Namhyung Kim <namhyung@kernel.org>
To: Thomas Richter <tmricht@linux.ibm.com>
Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
acme@kernel.org, svens@linux.ibm.com, gor@linux.ibm.com,
sumanthk@linux.ibm.com, hca@linux.ibm.com,
Ilya Leoshkevich <iii@linux.ibm.com>
Subject: Re: [PATCH v2 PING] perf test: Adjust test case perf record offcpu profiling tests for s390
Date: Mon, 6 Nov 2023 07:21:35 -0800 [thread overview]
Message-ID: <CAM9d7chpvhDCkTLiuPVqSKxoZdNYgJ0A2HvVdXbEgMvPZrv1Eg@mail.gmail.com> (raw)
In-Reply-To: <20231106091627.2022530-1-tmricht@linux.ibm.com>
Hello,
On Mon, Nov 6, 2023 at 1:16 AM Thomas Richter <tmricht@linux.ibm.com> wrote:
>
> On s390 using linux-next the test case
> 87: perf record offcpu profiling tests
> fails. The root cause is this command
>
> # ./perf record --off-cpu -e dummy -- ./perf bench sched messaging -l 10
> # Running 'sched/messaging' benchmark:
> # 20 sender and receiver processes per group
> # 10 groups == 400 processes run
>
> Total time: 0.231 [sec]
> [ perf record: Woken up 1 times to write data ]
> [ perf record: Captured and wrote 0.077 MB perf.data (401 samples) ]
> #
>
> It does not generate 800+ sample entries, on s390 usually around 40[1-9],
> sometimes a few more, but never more than 450. The higher the number
> of CPUs the lower the number of samples.
>
> Looking at function chain
> bench_sched_messaging()
> +--> group()
> the senders and receiver threads are created. The senders and receivers
> call function ready() which writes one bytes and wait for a reply using
> poll system() call.
>
> As context switches are counted, the function ready() will trigger
> a context switch when no input data is available after the write
> system call. The write system call does not trigger context switches
> when the data size is small. And writing 1000 bytes (10 iterations with
> 100 bytes) is not much and certainly won't block.
>
> The 400+ context switch on s390 occur when the some receiver/sender
> threads call ready() and wait for the response from function
> bench_sched_messaging() being kicked off.
>
> Lower the number of expected context switches to 400 to succeed on
> s390.
>
> Suggested-by: Namhyung Kim <namhyung@kernel.org>
> Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
> Co-developed-by: Ilya Leoshkevich <iii@linux.ibm.com>
> Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Thanks,
Namhyung
> ---
> tools/perf/tests/shell/record_offcpu.sh | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/perf/tests/shell/record_offcpu.sh b/tools/perf/tests/shell/record_offcpu.sh
> index a1ef8f0d2b5c..67c925f3a15a 100755
> --- a/tools/perf/tests/shell/record_offcpu.sh
> +++ b/tools/perf/tests/shell/record_offcpu.sh
> @@ -77,9 +77,9 @@ test_offcpu_child() {
> err=1
> return
> fi
> - # each process waits for read and write, so it should be more than 800 events
> + # each process waits at least for poll, so it should be more than 400 events
> if ! perf report -i ${perfdata} -s comm -q -n -t ';' --percent-limit=90 | \
> - awk -F ";" '{ if (NF > 3 && int($3) < 800) exit 1; }'
> + awk -F ";" '{ if (NF > 3 && int($3) < 400) exit 1; }'
> then
> echo "Child task off-cpu test [Failed invalid output]"
> err=1
> --
> 2.41.0
>
next prev parent reply other threads:[~2023-11-06 15:21 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-06 9:16 [PATCH v2 PING] perf test: Adjust test case perf record offcpu profiling tests for s390 Thomas Richter
2023-11-06 15:21 ` Namhyung Kim [this message]
2023-11-08 20:37 ` Arnaldo Carvalho de Melo
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=CAM9d7chpvhDCkTLiuPVqSKxoZdNYgJ0A2HvVdXbEgMvPZrv1Eg@mail.gmail.com \
--to=namhyung@kernel.org \
--cc=acme@kernel.org \
--cc=gor@linux.ibm.com \
--cc=hca@linux.ibm.com \
--cc=iii@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=sumanthk@linux.ibm.com \
--cc=svens@linux.ibm.com \
--cc=tmricht@linux.ibm.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).