From 155f2323a41b866217ee76b52b5648588d09f583 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavol=20=C5=BD=C3=A1=C4=8Dik?= Date: Tue, 17 Sep 2024 16:24:47 +0200 Subject: [PATCH] Adjust profiles to set dirty_(bytes|ratio) via the vm plugin --- profiles/accelerator-performance/tuned.conf | 7 ++--- profiles/latency-performance/tuned.conf | 7 ++--- profiles/mssql/tuned.conf | 4 +-- profiles/oracle/tuned.conf | 4 +-- profiles/postgresql/tuned.conf | 12 ++++----- profiles/sap-hana/tuned.conf | 4 +-- profiles/spectrumscale-ece/tuned.conf | 6 +++-- profiles/spindown-disk/tuned.conf | 4 ++- profiles/throughput-performance/tuned.conf | 27 ++++++++++--------- profiles/virtual-guest/tuned.conf | 5 ++-- profiles/virtual-host/tuned.conf | 4 +-- .../post-vars/tuned.conf | 4 +-- .../post/tuned.conf | 4 +-- .../post2/tuned.conf | 4 +-- 14 files changed, 51 insertions(+), 45 deletions(-) diff --git a/profiles/accelerator-performance/tuned.conf b/profiles/accelerator-performance/tuned.conf index a0f3da4..01f1a78 100644 --- a/profiles/accelerator-performance/tuned.conf +++ b/profiles/accelerator-performance/tuned.conf @@ -17,7 +17,7 @@ platform_profile=performance [disk] readahead=>4096 -[sysctl] +[vm] # If a workload mostly uses anonymous memory and it hits this limit, the entire # working set is buffered for I/O, and any more write buffering would require # swapping, so it's time to throttle writes until I/O can catch up. Workloads @@ -25,12 +25,13 @@ readahead=>4096 # # The generator of dirty data starts writeback at this percentage (system default # is 20%) -vm.dirty_ratio = 40 +dirty_ratio = 40 # Start background writeback (via writeback threads) at this percentage (system # default is 10%) -vm.dirty_background_ratio = 10 +dirty_background_ratio = 10 +[sysctl] # PID allocation wrap value. When the kernel's next PID value # reaches this value, it wraps back to a minimum PID value. # PIDs of value pid_max or larger are not allocated. diff --git a/profiles/latency-performance/tuned.conf b/profiles/latency-performance/tuned.conf index c780602..1e044f5 100644 --- a/profiles/latency-performance/tuned.conf +++ b/profiles/latency-performance/tuned.conf @@ -14,7 +14,7 @@ min_perf_pct=100 [acpi] platform_profile=performance -[sysctl] +[vm] # If a workload mostly uses anonymous memory and it hits this limit, the entire # working set is buffered for I/O, and any more write buffering would require # swapping, so it's time to throttle writes until I/O can catch up. Workloads @@ -22,12 +22,13 @@ platform_profile=performance # # The generator of dirty data starts writeback at this percentage (system default # is 20%) -vm.dirty_ratio=10 +dirty_ratio=10 # Start background writeback (via writeback threads) at this percentage (system # default is 10%) -vm.dirty_background_ratio=3 +dirty_background_ratio=3 +[sysctl] # The swappiness parameter controls the tendency of the kernel to move # processes out of physical memory and onto the swap disk. # 0 tells the kernel to avoid swapping processes out of physical memory diff --git a/profiles/mssql/tuned.conf b/profiles/mssql/tuned.conf index a1c9786..cf3e0f9 100644 --- a/profiles/mssql/tuned.conf +++ b/profiles/mssql/tuned.conf @@ -12,11 +12,11 @@ force_latency=5 [vm] # For multi-instance SQL deployments use 'madvise' instead of 'always' transparent_hugepages=always +dirty_background_ratio=3 +dirty_ratio=80 [sysctl] vm.swappiness=1 -vm.dirty_background_ratio=3 -vm.dirty_ratio=80 vm.dirty_expire_centisecs=500 vm.dirty_writeback_centisecs=100 vm.max_map_count=1600000 diff --git a/profiles/oracle/tuned.conf b/profiles/oracle/tuned.conf index f84cb2f..a1673ff 100644 --- a/profiles/oracle/tuned.conf +++ b/profiles/oracle/tuned.conf @@ -8,8 +8,6 @@ include=throughput-performance [sysctl] vm.swappiness = 10 -vm.dirty_background_ratio = 3 -vm.dirty_ratio = 40 vm.dirty_expire_centisecs = 500 vm.dirty_writeback_centisecs = 100 kernel.shmmax = 4398046511104 @@ -27,4 +25,6 @@ kernel.panic_on_oops = 1 kernel.numa_balancing = 0 [vm] +dirty_background_ratio = 3 +dirty_ratio = 40 transparent_hugepages=never diff --git a/profiles/postgresql/tuned.conf b/profiles/postgresql/tuned.conf index 88da8e4..8165fd8 100644 --- a/profiles/postgresql/tuned.conf +++ b/profiles/postgresql/tuned.conf @@ -16,22 +16,20 @@ force_latency=1 [vm] transparent_hugepages=never -[sysctl] - # The dirty_background_ratio and dirty_ratio controls percentage of memory # that file system cache have to fill with dirty data before kernel will # will start to flush data to disks. The default values are 10% and 20% # accordingly. On a systems with a big amount of memory this values can # be tens of gigabytes and produce IO spikes when PostgreSQL server writes -# checkpoints. +# checkpoints. The values can alternatively be set in absolute number of bytes +# via dirty_background_bytes and dirty_bytes. # # Keep this values reasonable small - about size of RAID controller write-back # cache size (typcal 512MB - 2GB). -vm.dirty_background_ratio = 0 -vm.dirty_ratio = 0 -vm.dirty_background_bytes = 67108864 -vm.dirty_bytes = 536870912 +dirty_background_bytes = 67108864 +dirty_bytes = 536870912 +[sysctl] # The swappiness parameter controls the tendency of the kernel to move # processes out of physical memory and onto the swap disk. # 0 tells the kernel to avoid swapping processes out of physical memory diff --git a/profiles/sap-hana/tuned.conf b/profiles/sap-hana/tuned.conf index aeecf53..e369ddf 100644 --- a/profiles/sap-hana/tuned.conf +++ b/profiles/sap-hana/tuned.conf @@ -13,10 +13,10 @@ min_perf_pct=100 [vm] transparent_hugepages=never +dirty_ratio = 40 +dirty_background_ratio = 10 [sysctl] kernel.sem = 32000 1024000000 500 32000 kernel.numa_balancing = 0 -vm.dirty_ratio = 40 -vm.dirty_background_ratio = 10 vm.swappiness = 10 diff --git a/profiles/spectrumscale-ece/tuned.conf b/profiles/spectrumscale-ece/tuned.conf index c111e31..3b3beba 100644 --- a/profiles/spectrumscale-ece/tuned.conf +++ b/profiles/spectrumscale-ece/tuned.conf @@ -11,10 +11,12 @@ governor=performance energy_perf_bias=performance min_perf_pct=100 +[vm] +dirty_ratio = 40 +dirty_background_ratio = 10 + [sysctl] kernel.numa_balancing = 1 -vm.dirty_ratio = 40 -vm.dirty_background_ratio = 10 vm.swappiness=10 net.ipv4.tcp_window_scaling = 1 net.ipv4.tcp_timestamps = 1 diff --git a/profiles/spindown-disk/tuned.conf b/profiles/spindown-disk/tuned.conf index 6f12684..5252bb7 100644 --- a/profiles/spindown-disk/tuned.conf +++ b/profiles/spindown-disk/tuned.conf @@ -26,10 +26,12 @@ spindown=6 [scsi_host] alpm=medium_power +[vm] +dirty_ratio=60 + [sysctl] vm.dirty_writeback_centisecs=6000 vm.dirty_expire_centisecs=9000 -vm.dirty_ratio=60 vm.laptop_mode=5 vm.swappiness=30 diff --git a/profiles/throughput-performance/tuned.conf b/profiles/throughput-performance/tuned.conf index b5e266d..b55989c 100644 --- a/profiles/throughput-performance/tuned.conf +++ b/profiles/throughput-performance/tuned.conf @@ -17,6 +17,20 @@ energy_performance_preference=performance [acpi] platform_profile=performance +[vm] +# If a workload mostly uses anonymous memory and it hits this limit, the entire +# working set is buffered for I/O, and any more write buffering would require +# swapping, so it's time to throttle writes until I/O can catch up. Workloads +# that mostly use file mappings may be able to use even higher values. +# +# The generator of dirty data starts writeback at this percentage (system default +# is 20%) +dirty_ratio = 40 + +# Start background writeback (via writeback threads) at this percentage (system +# default is 10%) +dirty_background_ratio = 10 + # Marvell ThunderX [vm.thunderx] type=vm @@ -31,19 +45,6 @@ transparent_hugepages=never readahead=>4096 [sysctl] -# If a workload mostly uses anonymous memory and it hits this limit, the entire -# working set is buffered for I/O, and any more write buffering would require -# swapping, so it's time to throttle writes until I/O can catch up. Workloads -# that mostly use file mappings may be able to use even higher values. -# -# The generator of dirty data starts writeback at this percentage (system default -# is 20%) -vm.dirty_ratio = 40 - -# Start background writeback (via writeback threads) at this percentage (system -# default is 10%) -vm.dirty_background_ratio = 10 - # PID allocation wrap value. When the kernel's next PID value # reaches this value, it wraps back to a minimum PID value. # PIDs of value pid_max or larger are not allocated. diff --git a/profiles/virtual-guest/tuned.conf b/profiles/virtual-guest/tuned.conf index 28b85c9..bc4c039 100644 --- a/profiles/virtual-guest/tuned.conf +++ b/profiles/virtual-guest/tuned.conf @@ -6,7 +6,7 @@ summary=Optimize for running inside a virtual guest include=throughput-performance -[sysctl] +[vm] # If a workload mostly uses anonymous memory and it hits this limit, the entire # working set is buffered for I/O, and any more write buffering would require # swapping, so it's time to throttle writes until I/O can catch up. Workloads @@ -14,8 +14,9 @@ include=throughput-performance # # The generator of dirty data starts writeback at this percentage (system default # is 20%) -vm.dirty_ratio = 30 +dirty_ratio = 30 +[sysctl] # Filesystem I/O is usually much more efficient than swapping, so try to keep # swapping low. It's usually safe to go even lower than this on systems with # server-grade storage. diff --git a/profiles/virtual-host/tuned.conf b/profiles/virtual-host/tuned.conf index 5301d9f..ba58cbb 100644 --- a/profiles/virtual-host/tuned.conf +++ b/profiles/virtual-host/tuned.conf @@ -6,10 +6,10 @@ summary=Optimize for running KVM guests include=throughput-performance -[sysctl] +[vm] # Start background writeback (via writeback threads) at this percentage (system # default is 10%) -vm.dirty_background_ratio = 5 +dirty_background_ratio = 5 [cpu] # Setting C3 state sleep mode/power savings diff --git a/tests/beakerlib/bz1798183-RFE-support-post-loaded-profile/post-vars/tuned.conf b/tests/beakerlib/bz1798183-RFE-support-post-loaded-profile/post-vars/tuned.conf index 0bef612..a93de04 100644 --- a/tests/beakerlib/bz1798183-RFE-support-post-loaded-profile/post-vars/tuned.conf +++ b/tests/beakerlib/bz1798183-RFE-support-post-loaded-profile/post-vars/tuned.conf @@ -1,5 +1,5 @@ [main] summary=Post-loaded profile that uses variables from the regular active profile -[sysctl] -vm.dirty_ratio=${foo} +[vm] +dirty_ratio=${foo} diff --git a/tests/beakerlib/bz1798183-RFE-support-post-loaded-profile/post/tuned.conf b/tests/beakerlib/bz1798183-RFE-support-post-loaded-profile/post/tuned.conf index 7844ca8..de0629f 100644 --- a/tests/beakerlib/bz1798183-RFE-support-post-loaded-profile/post/tuned.conf +++ b/tests/beakerlib/bz1798183-RFE-support-post-loaded-profile/post/tuned.conf @@ -1,5 +1,5 @@ [main] summary=Post-loaded profile -[sysctl] -vm.dirty_ratio=8 +[vm] +dirty_ratio=8 diff --git a/tests/beakerlib/bz1798183-RFE-support-post-loaded-profile/post2/tuned.conf b/tests/beakerlib/bz1798183-RFE-support-post-loaded-profile/post2/tuned.conf index 994db42..c8fedd9 100644 --- a/tests/beakerlib/bz1798183-RFE-support-post-loaded-profile/post2/tuned.conf +++ b/tests/beakerlib/bz1798183-RFE-support-post-loaded-profile/post2/tuned.conf @@ -1,5 +1,5 @@ [main] summary=Second version of the post-loaded profile -[sysctl] -vm.dirty_ratio=7 +[vm] +dirty_ratio=7