lkml.org 
[lkml]   [2023]   [Oct]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4] perf bench sched pipe: Add -G/--cgroups option
Em Tue, Oct 17, 2023 at 01:23:42PM -0700, Namhyung Kim escreveu:
> The -G/--cgroups option is to put sender and receiver in different
> cgroups in order to measure cgroup context switch overheads.
<SNIP>
> > taskset -c 0 perf bench sched pipe -l 10000 -G AAA,BBB > /dev/null

> Performance counter stats for 'taskset -c 0 perf bench sched pipe -l 10000 -G AAA,BBB':
>
> 20,001 context-switches
> 20,001 cgroup-switches

Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>

[root@five ~]# 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.063 [sec]

6.367500 usecs/op
157047 ops/sec

Performance counter stats for 'taskset -c 0 perf bench sched pipe -l 10000':

20,004 context-switches
4 cgroup-switches

0.084191842 seconds time elapsed

0.008332000 seconds user
0.067193000 seconds sys


[root@five ~]# perf stat -e context-switches,cgroup-switches taskset -c 0 perf bench sched pipe -l 10000 -G AAA,BBB
# Running 'sched/pipe' benchmark:
no access to cgroup /sys/fs/cgroup/BBB
Failed to open cgroup file in BBB
Hint: create the cgroup first, like 'mkdir /sys/fs/cgroup/BBB'
no access to cgroup /sys/fs/cgroup/AAA
Failed to open cgroup file in AAA
Hint: create the cgroup first, like 'mkdir /sys/fs/cgroup/AAA'

Performance counter stats for 'taskset -c 0 perf bench sched pipe -l 10000 -G AAA,BBB':

2 context-switches
1 cgroup-switches

0.010356533 seconds time elapsed

0.003209000 seconds user
0.007122000 seconds sys


[root@five ~]# vim /tmp/bla
[root@five ~]#
[root@five ~]# mkdir /sys/fs/cgroup/BBB /sys/fs/cgroup/AAA
[root@five ~]# 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.079 [sec]

7.987800 usecs/op
125190 ops/sec

Performance counter stats for 'taskset -c 0 perf bench sched pipe -l 10000 -G AAA,BBB':

20,008 context-switches
20,007 cgroup-switches

0.089361029 seconds time elapsed

0.009004000 seconds user
0.065376000 seconds sys


[root@five ~]#

\
 
 \ /
  Last update: 2023-10-20 22:32    [W:0.054 / U:22.832 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site