Affine kswapd* kernel threads to platform cores

The kswapd* kernel tasks are per NUMA node and have floating
cpu affinity masks spanning those nodes.

On AIO low-latency systems, this affines the kswapd* kernel tasks to
platform cores. This is a performance improvement for low-latency
sensitive applications.

Partial-Bug: 1900174
Change-Id: I20db19978362997b23a69bf591b8e7c23096f492
Signed-off-by: Jim Gauld <james.gauld@windriver.com>
This commit is contained in:
Jim Gauld 2020-10-16 15:41:34 -04:00
parent dd50028318
commit db2156eadd
1 changed files with 5 additions and 0 deletions

View File

@ -111,6 +111,11 @@ function affine_tasks {
taskset --all-tasks --pid --cpu-list ${PLATFORM_CPULIST} $pid &> /dev/null
done
# Affine kernel kswapd threads to platform cores
pidlist=$(ps --ppid 2 -p 2 -o pid=,comm= | grep -E 'kswapd' | awk '{ print $1; }')
for pid in ${pidlist[@]}; do
taskset --all-tasks --pid --cpu-list ${PLATFORM_CPULIST} $pid &> /dev/null
done
fi
return 0