[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAM9d7cjH+c30MChKyOpMNB6-k6Vy4F4ZbB1Eih0Dk5tgXP8mEg@mail.gmail.com>
Date: Mon, 16 Oct 2023 14:44:23 -0700
From: Namhyung Kim <namhyung@...nel.org>
To: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: Ingo Molnar <mingo@...nel.org>, Jiri Olsa <jolsa@...nel.org>,
Ian Rogers <irogers@...gle.com>,
Adrian Hunter <adrian.hunter@...el.com>,
Peter Zijlstra <peterz@...radead.org>,
LKML <linux-kernel@...r.kernel.org>,
linux-perf-users@...r.kernel.org
Subject: Re: [PATCH v3] perf bench sched pipe: Add -G/--cgroups option
On Mon, Oct 16, 2023 at 1:35 PM Arnaldo Carvalho de Melo
<acme@...nel.org> wrote:
>
> Em Mon, Oct 16, 2023 at 12:55:33PM -0300, Arnaldo Carvalho de Melo escreveu:
> > Em Mon, Oct 16, 2023 at 12:51:52PM -0300, Arnaldo Carvalho de Melo escreveu:
> > > Now back at testing with with cgroups.
>
> > Humm, even without the -G I get:
>
> > [root@...e ~]# perf stat -e context-switches,cgroup-switches perf bench sched pipe -l 10000
> > # Running 'sched/pipe' benchmark:
> > # Executed 10000 pipe operations between two processes
>
> > Total time: 0.082 [sec]
>
> > 8.246400 usecs/op
> > 121265 ops/sec
>
> > Performance counter stats for 'perf bench sched pipe -l 10000':
>
> > 20,002 context-switches
> > 20,002 cgroup-switches
>
> Same number, but then I forgot to add the 'taskset -c 0' part of the
> command line, if I have it:
>
> [root@...e ~]# perf stat -e context-switches,cgroup-switches taskset -c 0 perf bench sched pipe -l 10000
> # Running 'sched/pipe' benchmark:
> # Executed 10000 pipe operations between two processes
>
> Total time: 0.072 [sec]
>
> 7.231500 usecs/op
> 138283 ops/sec
>
> Performance counter stats for 'taskset -c 0 perf bench sched pipe -l 10000':
>
> 20,002 context-switches
> 3 cgroup-switches
>
> 0.082855113 seconds time elapsed
>
> 0.007765000 seconds user
> 0.074020000 seconds sys
>
>
> [root@...e ~]# perf stat -e context-switches,cgroup-switches taskset -c 0 perf bench sched pipe -l 10000 -G AAA,BBB
> # Running 'sched/pipe' benchmark:
> # Executed 10000 pipe operations between two processes
>
> Total time: 0.093 [sec]
>
> 9.341800 usecs/op
> 107045 ops/sec
>
> Performance counter stats for 'taskset -c 0 perf bench sched pipe -l 10000 -G AAA,BBB':
>
> 20,004 context-switches
> 20,003 cgroup-switches
>
> 0.103436330 seconds time elapsed
>
> 0.018109000 seconds user
> 0.063058000 seconds sys
>
>
> [root@...e ~]#
>
> I.e. it works as in your results, but can you please spell out why that
> 'taskset -c 0' is needed to get these results?
>
> I wasn't expecting the same number of cgroup-switches when not using
> 'taskset -c 0' :-\
Without taskset, each task is likely to run on different CPUs
and other tasks (including idle) on that CPU would be in
different cgroup so it'll create cgroup switches everytime
if they run in AAA or BBB.
With taskset, both sender and receiver would run on the
same CPU. So it'd see the impact of cgroup switches
with this option.
Thanks,
Namhyung
Powered by blists - more mailing lists