Repository navigation
Commit 376f0e6
committed
sched/fair: Prefer the previous cpu for wakeup
EEVDF limited CPU saturation can be lack-luster with CPUs having
many cores or CCDs. The provided patch improves limited saturation
by 2%~21% with an AMD Threadripper 3970X CPU, depending on workload.
I'm unqualified in the EEVDF internals. So, the patch was made by
trial and error, plus much testing. It benefits CPU scheduling with
the Threadripper machine.
This is more an awareness for the folks in the CPU scheduler domain.
From Andrea Righi
The "is_idle_core" function
Select target in select_idle_sibling(), if an idle core
From Mario Roy
Prefer the previous cpu for wakeup, if an idle core
Move the recent_used_cpu heuristic to the top, and check
if an idle core
Results
Tested with an AMD Ryzen Threadripper 3970X CPU (32/64)
EEVDF, EEVDF with patch, scx_cosmos, and BMQ schedulers
Pinned is affined to the primary CPUs, excluding siblings [6]
cgterm_cpus 0-31
Cosmos is the sched-ext scheduler
https://github.com/sched-ext/scx
sudo scx_cosmos -m all -s 1250 -l 50000 -c 0 -p 0 -d
:-------------------------------------------------------------------
: pogocache million ops/sec [7][8]
:-------------------------------------------------------------------
FILE1=1.2.0.tar.gz; FILE2=pogocache-1.2.0.tar.gz
wget https://github.com/tidwall/pogocache/archive/refs/tags/$FILE1
mv $FILE1 $FILE2 && tar xf $FILE2 && cd pogocache-1.2.0
make -j4; cd ..
FILE1=2.2.0.tar.gz; FILE2=memtier_benchmark-2.2.0.tar.gz
wget https://github.com/RedisLabs/memtier_benchmark/archive/refs/tags/$FILE1
mv $FILE1 $FILE2 && tar xf $FILE2 && cd memtier_benchmark-2.2.0
autoreconf -ivf; ./configure; make -j4; cd ..
bash -c '
NUM_CPU_CORES=32
cd pogocache-1.2.0
./pogocache -t $NUM_CPU_CORES &
POGOCACHE_PID=$!
sleep 3
cd ../memtier_benchmark-2.2.0
./memtier_benchmark --hide-histogram -t $NUM_CPU_CORES \
-P memcache_text -c 1 -p 9401 --pipeline=16 --test-time=15 \
--ratio=1:1
sleep 1
kill $POGOCACHE_PID
sleep 1
'
eevdf patch pinned cosmos bmq
------ ------ ------ ------ ------
9.67 10.42 10.42 7.53 1.79
9.65 10.32 10.43 7.52 1.54
9.72 10.45 10.45 7.55 1.64
9.61 10.46 10.48 7.59 1.59
9.46 10.30 10.45 7.58 1.93
------ ------ ------ ------ ------
9.62 10.39 10.45 7.55 1.70 average million ops/sec
------ ------ ------ ------ ------
100.0% 108.0% 108.6% 78.5% 17.7% higher is better
:-------------------------------------------------------------------
: x265
:-------------------------------------------------------------------
FILE1=Bosphorus_1920x1080_120fps_420_8bit_YUV_Y4M.7z
FILE2=Bosphorus_1920x1080_120fps_420_8bit_YUV.y4m
wget --show-progress -Nq http://ultravideo.cs.tut.fi/video/$FILE1
7z e $FILE1 -o./
time x265 -p slow -b 6 -o /dev/null --no-progress \
--log-level none --input $FILE2
eevdf patch pinned cosmos bmq
------ ------ ------ ------ ------
19.15 17.70 17.43 17.44 17.20
19.21 17.70 17.46 17.46 17.18
19.45 17.75 17.47 17.44 17.22
19.28 17.73 17.46 17.53 17.23
19.25 17.74 17.47 17.51 17.23
------ ------ ------ ------ ------
96.34 88.62 87.29 87.38 86.06 total time
------ ------ ------ ------ ------
100.0% 92.0% 90.6% 90.7% 89.3% lower is better
:-------------------------------------------------------------------
: Encode 1920x1080 video with AOM [1]
:-------------------------------------------------------------------
Same input file as above
time bash -c '
FILE=Bosphorus_1920x1080_120fps_420_8bit_YUV.y4m
rm -f test.av1
time aomenc --threads=16 --cpu-used=6 -o test.av1 $FILE
'
eevdf patch pinned cosmos bmq
------ ------ ------ ------ ------
24.53 23.84 23.88 24.51 24.28
24.32 23.84 23.86 24.49 24.25
24.46 23.85 23.84 24.45 24.26
24.36 23.84 23.86 24.35 24.22
24.53 23.77 23.76 24.50 24.28
------ ------ ------ ------ ------
122.20 119.14 119.20 122.30 121.29 total time
------ ------ ------ ------ ------
100.0% 97.5% 97.5% 100.1% 99.3% lower is better
:-------------------------------------------------------------------
: FFmpeg demux AV1 WebM to IVF that can be consumed by dav1d [1]
:-------------------------------------------------------------------
FILE=Stream2_AV1_4K_22.7mbps.webm
wget http://www.phoronix-test-suite.com/benchmark-files/$FILE
time bash -c '
FILE1=Stream2_AV1_4K_22.7mbps.webm
FILE2=summer_nature_4k.ivf
rm -f $FILE2
ffmpeg -hide_banner -i $FILE1 -vcodec copy -an -f ivf $FILE2
dav1d -i $FILE2 --muxer null --threads 16 --filmgrain 0
'
eevdf patch pinned cosmos bmq
------ ------ ------ ------ ------
13.51 13.21 13.16 13.43 13.27
13.47 13.13 13.13 13.46 13.25
13.55 13.19 13.07 13.43 13.20
13.39 13.25 13.10 13.22 13.13
13.37 13.13 13.16 13.24 13.22
------ ------ ------ ------ ------
67.29 65.91 65.62 66.78 66.07 total time
------ ------ ------ ------ ------
100.0% 97.9% 97.5% 99.2% 98.2% lower is better
:-------------------------------------------------------------------
: Query one million rows with SQLite [2]
:-------------------------------------------------------------------
cp -a sampledb /tmp/. && cd /tmp/sampledb
./create.pl 1000000
./query1.pl | tail
eevdf patch pinned cosmos bmq
------ ------ ------ ------ ------
9.63 8.68 8.65 10.50 9.92
9.82 8.75 8.68 10.07 9.89
9.89 8.61 8.64 9.80 9.51
9.62 8.61 8.63 10.42 9.77
9.63 8.72 8.60 10.59 9.52
------ ------ ------ ------ ------
48.59 43.37 43.20 51.38 48.61 total time
------ ------ ------ ------ ------
100.0% 89.3% 88.9% 105.7% 100.0% lower is better
:-------------------------------------------------------------------
: Chameneos-redux [3]
:-------------------------------------------------------------------
python3 pipe2.py 600000
eevdf patch pinned cosmos bmq
------ ------ ------ ------ ------
7.00 6.26 6.23 7.07 7.27
6.85 6.19 6.25 6.92 6.39
6.83 6.19 6.24 7.15 6.25
7.00 6.20 6.19 7.30 7.46
6.89 6.25 6.23 7.18 6.11
------ ------ ------ ------ ------
34.57 31.09 31.14 35.62 33.48 total time
------ ------ ------ ------ ------
100.0% 89.9% 90.1% 103.0% 96.8% lower is better
:-------------------------------------------------------------------
: Algorithm3 50% CPU Saturation [4]
:-------------------------------------------------------------------
./algorithm3.pl 1e12 --threads=50%
eevdf patch pinned cosmos bmq
------ ------ ------ ------ ------
20.01 15.81 15.82 15.83 17.25
19.94 15.90 15.79 15.94 17.30
20.43 15.97 15.84 15.86 17.27
20.80 16.12 15.81 15.97 17.42
20.41 15.99 15.81 15.96 17.53
------ ------ ------ ------ ------
101.59 79.79 79.07 79.56 86.77 total time
------ ------ ------ ------ ------
100.0% 78.5% 77.8% 78.3% 85.4% lower is better
:-------------------------------------------------------------------
: Algorithm3 31.25% CPU Saturation [4]
:-------------------------------------------------------------------
./algorithm3.pl 1e12 --threads=31.25%
eevdf patch pinned cosmos bmq
------ ------ ------ ------ ------
29.70 23.74 23.79 24.36 24.08
30.19 23.99 23.80 24.57 23.87
30.26 24.16 23.88 24.59 24.33
30.26 23.93 23.95 24.69 24.33
30.63 24.14 23.92 24.37 24.20
------ ------ ------ ------ ------
151.04 119.96 119.34 122.58 120.81 total time
------ ------ ------ ------ ------
100.0% 79.4% 79.0% 81.2% 80.0% lower is better
:-------------------------------------------------------------------
: Primesieve 31.25% CPU Saturation [5]
:-------------------------------------------------------------------
primesieve 2e12 --threads=20
eevdf patch pinned cosmos bmq
------ ------ ------ ------ ------
18.57 18.30 18.51 18.97 18.41
18.57 18.37 18.45 18.60 18.43
18.51 18.34 18.35 18.81 18.55
18.35 18.41 18.36 18.81 18.42
18.33 18.37 18.40 19.05 18.37
------ ------ ------ ------ ------
92.33 91.79 92.07 94.24 92.18 total time
------ ------ ------ ------ ------
100.0% 99.4% 99.7% 102.1% 99.8% lower is better
[1] https://openbenchmarking.org/suite/pts/encoding
[2] https://github.com/marioroy/mce-examples/tree/main/sampledb
[3] https://github.com/marioroy/mce-examples/tree/main/chameneos
[4] https://github.com/marioroy/mce-sandbox
[5] https://github.com/kimwalisch/primesieve
[6] https://github.com/marioroy/linux-cgroup-always
[7] https://openbenchmarking.org/test/pts/pogocache
[8] https://openbenchmarking.org/innhold/969a89ed33ff0f43dd5dbfdaa956a028c9d9e5d0
Signed-off-by: Mario Roy <>
Signed-off-by: Eric Naim <[email protected]>1 parent 017cae3 commit 376f0e6
1 file changed
Lines changed: 46 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1149 | 1149 | | |
1150 | 1150 | | |
1151 | 1151 | | |
1152 | | - | |
| 1152 | + | |
1153 | 1153 | | |
1154 | 1154 | | |
1155 | 1155 | | |
| |||
7578 | 7578 | | |
7579 | 7579 | | |
7580 | 7580 | | |
| 7581 | + | |
| 7582 | + | |
| 7583 | + | |
| 7584 | + | |
| 7585 | + | |
| 7586 | + | |
| 7587 | + | |
| 7588 | + | |
| 7589 | + | |
| 7590 | + | |
| 7591 | + | |
| 7592 | + | |
| 7593 | + | |
| 7594 | + | |
| 7595 | + | |
| 7596 | + | |
| 7597 | + | |
| 7598 | + | |
7581 | 7599 | | |
7582 | 7600 | | |
7583 | 7601 | | |
| |||
7846 | 7864 | | |
7847 | 7865 | | |
7848 | 7866 | | |
7849 | | - | |
| 7867 | + | |
7850 | 7868 | | |
7851 | 7869 | | |
7852 | 7870 | | |
7853 | 7871 | | |
7854 | 7872 | | |
7855 | 7873 | | |
| 7874 | + | |
| 7875 | + | |
| 7876 | + | |
| 7877 | + | |
| 7878 | + | |
| 7879 | + | |
| 7880 | + | |
| 7881 | + | |
| 7882 | + | |
| 7883 | + | |
| 7884 | + | |
| 7885 | + | |
| 7886 | + | |
| 7887 | + | |
| 7888 | + | |
| 7889 | + | |
7856 | 7890 | | |
7857 | 7891 | | |
7858 | 7892 | | |
| |||
7869 | 7903 | | |
7870 | 7904 | | |
7871 | 7905 | | |
7872 | | - | |
| 7906 | + | |
7873 | 7907 | | |
7874 | 7908 | | |
7875 | 7909 | | |
| |||
7903 | 7937 | | |
7904 | 7938 | | |
7905 | 7939 | | |
7906 | | - | |
7907 | | - | |
7908 | | - | |
7909 | | - | |
7910 | | - | |
7911 | | - | |
7912 | | - | |
7913 | | - | |
7914 | | - | |
7915 | | - | |
7916 | | - | |
7917 | | - | |
7918 | | - | |
7919 | | - | |
7920 | | - | |
7921 | | - | |
7922 | | - | |
7923 | | - | |
7924 | 7940 | | |
7925 | 7941 | | |
7926 | 7942 | | |
| |||
8652 | 8668 | | |
8653 | 8669 | | |
8654 | 8670 | | |
8655 | | - | |
| 8671 | + | |
| 8672 | + | |
| 8673 | + | |
| 8674 | + | |
| 8675 | + | |
| 8676 | + | |
| 8677 | + | |
| 8678 | + | |
8656 | 8679 | | |
8657 | 8680 | | |
8658 | 8681 | | |
| |||
10347 | 10370 | | |
10348 | 10371 | | |
10349 | 10372 | | |
10350 | | - | |
| 10373 | + | |
10351 | 10374 | | |
10352 | 10375 | | |
10353 | 10376 | | |
| |||
0 commit comments