]>
git.proxmox.com Git - ceph.git/blob - ceph/src/spdk/scripts/prep_benchmarks.sh
3 function configure_performance
() {
4 echo -n "Placing all CPUs in performance mode..."
5 for governor
in /sys
/devices
/system
/cpu
/cpu
*/cpufreq
/scaling_governor
; do
6 echo -n performance
> $governor
10 if [ -f "/sys/devices/system/cpu/intel_pstate/no_turbo" ]; then
11 echo -n "Disabling Turbo Boost..."
12 echo -n 1 > /sys
/devices
/system
/cpu
/intel_pstate
/no_turbo
16 echo -n "Disabling irqbalance service..."
17 service irqbalance stop
2> /dev
/null
20 echo -n "Moving all interrupts off of core 0..."
21 count
=$
(($
(nproc
) / 4))
23 for ((i
= 1; i
< count
; i
++)); do
24 if [ $
((i
% 8)) -eq 0 ]; then
29 for file in /proc
/irq
/*/smp_affinity
; do
30 echo "$cpumask" > $file 2> /dev
/null
34 echo -n "Configuring kernel blk-mq for NVMe SSDs..."
35 for queue
in /sys
/block
/nvme
*n
*/queue
; do
36 if [ -f "$queue/nomerges" ]; then
37 echo "1" > $queue/nomerges
40 if [ -f "$queue/io_poll" ]; then
41 echo "1" > $queue/io_poll
44 if [ -f "$queue/io_poll_delay" ]; then
45 echo "-1" > $queue/io_poll_delay
51 function reset_performance
() {
52 echo -n "Placing all CPUs in powersave mode..."
53 for governor
in /sys
/devices
/system
/cpu
/cpu
*/cpufreq
/scaling_governor
; do
54 echo -n powersave
> $governor
58 if [ -f "/sys/devices/system/cpu/intel_pstate/no_turbo" ]; then
59 echo -n "Enabling Turbo Boost..."
60 echo -n 0 > /sys
/devices
/system
/cpu
/intel_pstate
/no_turbo
64 echo -n "Enabling irqbalance service..."
65 service irqbalance start
2> /dev
/null
69 if [ "$1" = "reset" ]; then