Skip to content

Instantly share code, notes, and snippets.

@OscarShiang
Created February 19, 2022 06:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OscarShiang/8b530a00f472fd1c39f5979ee601516d to your computer and use it in GitHub Desktop.
Save OscarShiang/8b530a00f472fd1c39f5979ee601516d to your computer and use it in GitHub Desktop.
The test result of oslat with task isolation patches
sudo tuned-adm profile latency-performance
OUTPUT=output-oslat-`uname -r`-`date +%s`
stress-ng --job stress-jobs &
STRESS=$!
sleep 5
# chisol and oslat here are compiled with task isolation userspace patches
# which can be found at https://people.redhat.com/~mtosatti/task-isol-v6-userspace-patches/
chisol -q vmstat_sync -I conf oslat -c 2 -b 400 -w memmove -m 16k -D 15m --json=${OUTPUT}
sudo kill -2 ${STRESS}
echo "Save the result to ${OUTPUT}"
sudo tuned-adm profile latency-performance
OUTPUT=output-oslat-`uname -r`-`date +%s`
stress-ng --job stress-jobs &
STRESS=$!
sleep 5
# This is the original oslat compiled without task isolation userspace patch
oslat -c 2 -b 400 -w memmove -m 16k -D 15m --json=${OUTPUT}
sudo kill -2 ${STRESS}
echo "Save the result to ${OUTPUT}"
# This is stress-ng config used for test 4 (vm + mmap + fault)
taskset 0,1,3
fault 10
vm 2
vm-bytes 2G
mmap 2
mmap-bytes 2G
page-in

Testing task isolation via oslat

System information

Host

  • 2 socket Intel(R) Xeon(R) CPU E5-2650 v4 @ 2.20GHz
  • Ubuntu 20.04 with kernel 5.4.0-99-generic

Guest

  • KVM with 4vCPU and 4GB RAM
  • Debian 10 with kernel 5.15.18-rt28 with task isolation patches
  • Command line: isolcpus=domain,nohz,2 nohz_full=2 irqaffinity=0,1,3
  • oslat from rt-tests v2.30 with Marcelo's patch for oslat
  • stress-ng v0.09.50

Each test spawns system workload on the CPUs which is not isolated, then runs a 15-min oslat with 16 KB memmove workload on the isolated CPU.

To compare the latency performance with and without task isolation, we perform each test on 2 different kernel configs. The one marked as TASKISOL implies that the kernel turns on CONFIG_TASK_ISOLATION.

Test 1: oslat on isolated CPU and timer workload on other CPUs

We create 20 timer workers in this test.

PREEMPT_RT + NOHZ_FULL TASKISOL + PREEMPT_RT + NOHZ_FULL
min (us) 2 2
avg (us) 2.007391 2.012791
max (us) 8391 30774
duration(sec) 899.182 899.183

Test 2: oslat on isolated CPU and major / minor fault workload on other CPUs

Since the patchset aims to eliminate the effect of vmstats, we create 20 fault workers as the system workload in this test.

PREEMPT_RT + NOHZ_FULL TASKISOL + PREEMPT_RT + NOHZ_FULL
min (us) 2 2
avg (us) 2.011208 2.015257
max (us) 5019 27741
duration(sec) 899.181 901.229

Test 3: oslat on isolated CPU and VM / mmap stress on other CPUs

To stress the system with large VM stuff, we use 2 vm and 2 mmap workers. Each worker uses 2GB to raise OOM frequently.

PREEMPT_RT + NOHZ_FULL TASKISOL + PREEMPT_RT + NOHZ_FULL
min (us) 2 2
avg (us) 2.016188 2.02046
max (us) 10153 12648
duration(sec) 899.182 901.229

Test 4: oslat on isolated CPU and VM / mmap / fault workload on other CPUs

This test uses a mixed workload comprised of 10 fault, 2 vm and 2 mmap workers.

PREEMPT_RT + NOHZ_FULL TASKISOL + PREEMPT_RT + NOHZ_FULL
min (us) 2 2
avg (us) 2.014711 2.013344
max (us) 12908 12707
duration(sec) 899.183 899.184
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment