1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00
VILLASnode/tools/tune-realtime.sh
Steffen Vogel 0735eb0f89 Make project REUSE compliant
And various other cleanups and harmonizations

Signed-off-by: Steffen Vogel <steffen.vogel@opal-rt.com>
2023-09-07 11:16:04 +02:00

23 lines
651 B
Bash
Executable file

#!/bin/bash
# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University
# SPDX-License-Identifier: Apache-2.0
dnf -y --refresh install \
tuned-utils \
tuned-profiles-realtime
# Isolate half of the available cores by default
if [ -z "${ISOLATED_CORES}" ]; then
PROC=$(nproc)
ISOLATED_CORES=
if ((PROC > 4)); then
ISOLATED_CORES+=$(seq -s, $((PROC/2)) $((PROC-1)))
fi
fi
echo isolated_cores=${ISOLATED_CORES} >> /etc/tuned/realtime-variables.conf
# Enable dynamic preemption
grubby --update-kernel=ALL --remove-args="preempt=full"
# Select real-time tuned profile
tuned-adm profile realtime