From 3bcac3095cb7604cc29d18d7cf0b1c0650146b86 Mon Sep 17 00:00:00 2001 From: Jan Vcelak Date: Wed, 18 Aug 2010 12:35:04 +0200 Subject: [PATCH 1/2] architecture specific configuration files support If arch specific configuration file is required, add .$arch before the configuration file extension, e.g.: In profile 'latency-performance' on s390x machines, special sysctl tunning is required. Adding 'sysctl.s390x.ktune' file into profile will cause loading of this file instead of 'sysctl.ktune'. --- tuned_adm.py | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/tuned_adm.py b/tuned_adm.py index d045930..326835a 100644 --- a/tuned_adm.py +++ b/tuned_adm.py @@ -20,12 +20,14 @@ import sys import os import os.path import glob +import platform class Tuned_adm: def __init__(self, profile_dir = "/etc/tune-profiles"): self.profile_dir = os.path.normpath(profile_dir) self.active_file = os.path.join(profile_dir, "active-profile") + self.arch = platform.machine() def error(self, msg, exit_code = 1): print >>sys.stderr, msg @@ -114,6 +116,17 @@ class Tuned_adm: if filter(f): os.unlink(f) + def pick_config(self, name, profile_root): + file = os.path.join(profile_root, name) + (path, ext) = os.path.splitext(file) + arch_specific = "%s.%s%s" % (path, self.arch, ext) + if os.path.exists(arch_specific): + return arch_specific + elif os.path.exists(file): + return file + else: + return None + def off(self): self.set_active("off") @@ -157,24 +170,24 @@ class Tuned_adm: self.remove('/etc/ktune.d/tunedadm.sh') self.remove('/etc/ktune.d/tunedadm.conf') - file = os.path.join(profile_root, "ktune.sysconfig") - if os.path.isfile(file): + file = self.pick_config("ktune.sysconfig", profile_root) + if file: enablektune = True os.rename('/etc/sysconfig/ktune', '/etc/sysconfig/ktune.bckp') os.symlink(file, '/etc/sysconfig/ktune') - file = os.path.join(profile_root, 'ktune.sh') - if os.path.isfile(file): + file = self.pick_config("ktune.sh", profile_root) + if file: os.symlink(file, '/etc/ktune.d/tunedadm.sh') - file = os.path.join(profile_root, 'sysctl.ktune') - if os.path.isfile(file): + file = self.pick_config("sysctl.ktune", profile_root) + if file: os.symlink(file, '/etc/ktune.d/tunedadm.conf') # tuned settings - file = os.path.join(profile_root, 'tuned.conf') - if os.path.isfile(file): + file = self.pick_config("tuned.conf", profile_root) + if file: enabletuned = True os.rename('/etc/tuned.conf', '/etc/tuned.conf.bckp') os.symlink(file, '/etc/tuned.conf') From b90ba21fd225fc61dd40dfb4aa80dc1d0174bd99 Mon Sep 17 00:00:00 2001 From: Jan Vcelak Date: Wed, 18 Aug 2010 12:37:25 +0200 Subject: [PATCH 2/2] throughput-performance: s390x sysctl settings bz #619377 kernel: Process scheduler tuning recommendation for s390 --- .../throughput-performance/sysctl.s390x.ktune | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 tune-profiles/throughput-performance/sysctl.s390x.ktune diff --git a/tune-profiles/throughput-performance/sysctl.s390x.ktune b/tune-profiles/throughput-performance/sysctl.s390x.ktune new file mode 100644 index 0000000..e584681 --- /dev/null +++ b/tune-profiles/throughput-performance/sysctl.s390x.ktune @@ -0,0 +1,40 @@ +# ktune sysctl settings for rhel6 servers, maximizing i/o throughput +# +# Minimal preemption granularity for CPU-bound tasks: +# (default: 1 msec# (1 + ilog(ncpus)), units: nanoseconds) +kernel.sched_min_granularity_ns = 10000000 + +# SCHED_OTHER wake-up granularity. +# (default: 1 msec# (1 + ilog(ncpus)), units: nanoseconds) +# +# This option delays the preemption effects of decoupled workloads +# and reduces their over-scheduling. Synchronous workloads will still +# have immediate wakeup/sleep latencies. +kernel.sched_wakeup_granularity_ns = 15000000 + +# TODO: this bits need comment +kernel.sched_latency_ns = 80000000 +kernel.sched_features = 15834234 +kernel.sched_tunable_scaling = 0 + +# 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 = 15 + +# 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. +# +# A suggested value for pid_max is 1024 * <# of cpu cores/threads in system> +# e.g., a box with 32 cpus, the default of 32768 is reasonable, for 64 cpus, +# 65536, for 4096 cpus, 4194304 (which is the upper limit possible). +#kernel.pid_max = 65536