Merge pull request #792 from zacikpa/dirty-update
vm: Deprecate dirty_ratio in favour of dirty_bytes with %
This commit is contained in:
commit
51caa84b2f
14 changed files with 28 additions and 21 deletions
|
|
@ -25,11 +25,11 @@ readahead=>4096
|
|||
#
|
||||
# The generator of dirty data starts writeback at this percentage (system default
|
||||
# is 20%)
|
||||
dirty_ratio = 40
|
||||
dirty_bytes = 40%
|
||||
|
||||
# Start background writeback (via writeback threads) at this percentage (system
|
||||
# default is 10%)
|
||||
dirty_background_ratio = 10
|
||||
dirty_background_bytes = 10%
|
||||
|
||||
[sysctl]
|
||||
# PID allocation wrap value. When the kernel's next PID value
|
||||
|
|
|
|||
|
|
@ -22,11 +22,11 @@ platform_profile=performance
|
|||
#
|
||||
# The generator of dirty data starts writeback at this percentage (system default
|
||||
# is 20%)
|
||||
dirty_ratio=10
|
||||
dirty_bytes=10%
|
||||
|
||||
# Start background writeback (via writeback threads) at this percentage (system
|
||||
# default is 10%)
|
||||
dirty_background_ratio=3
|
||||
dirty_background_bytes=3%
|
||||
|
||||
[sysctl]
|
||||
# The swappiness parameter controls the tendency of the kernel to move
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ force_latency=5
|
|||
[vm]
|
||||
# For multi-instance SQL deployments use 'madvise' instead of 'always'
|
||||
transparent_hugepages=always
|
||||
dirty_background_ratio=3
|
||||
dirty_ratio=80
|
||||
dirty_background_bytes=3%
|
||||
dirty_bytes=80%
|
||||
|
||||
[sysctl]
|
||||
vm.swappiness=1
|
||||
|
|
|
|||
|
|
@ -25,6 +25,6 @@ kernel.panic_on_oops = 1
|
|||
kernel.numa_balancing = 0
|
||||
|
||||
[vm]
|
||||
dirty_background_ratio = 3
|
||||
dirty_ratio = 40
|
||||
dirty_background_bytes = 3%
|
||||
dirty_bytes = 40%
|
||||
transparent_hugepages=never
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@ min_perf_pct=100
|
|||
|
||||
[vm]
|
||||
transparent_hugepages=madvise
|
||||
dirty_ratio = 40
|
||||
dirty_background_ratio = 10
|
||||
dirty_bytes = 40%
|
||||
dirty_background_bytes = 10%
|
||||
|
||||
[sysctl]
|
||||
kernel.sem = 32000 1024000000 500 32000
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ energy_perf_bias=performance
|
|||
min_perf_pct=100
|
||||
|
||||
[vm]
|
||||
dirty_ratio = 40
|
||||
dirty_background_ratio = 10
|
||||
dirty_bytes = 40%
|
||||
dirty_background_bytes = 10%
|
||||
|
||||
[sysctl]
|
||||
kernel.numa_balancing = 1
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ spindown=6
|
|||
alpm=med_power_with_dipm
|
||||
|
||||
[vm]
|
||||
dirty_ratio=60
|
||||
dirty_bytes=60%
|
||||
|
||||
[sysctl]
|
||||
vm.dirty_writeback_centisecs=6000
|
||||
|
|
|
|||
|
|
@ -25,11 +25,11 @@ platform_profile=performance
|
|||
#
|
||||
# The generator of dirty data starts writeback at this percentage (system default
|
||||
# is 20%)
|
||||
dirty_ratio = 40
|
||||
dirty_bytes = 40%
|
||||
|
||||
# Start background writeback (via writeback threads) at this percentage (system
|
||||
# default is 10%)
|
||||
dirty_background_ratio = 10
|
||||
dirty_background_bytes = 10%
|
||||
|
||||
# Marvell ThunderX
|
||||
[vm.thunderx]
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ include=throughput-performance
|
|||
#
|
||||
# The generator of dirty data starts writeback at this percentage (system default
|
||||
# is 20%)
|
||||
dirty_ratio = 30
|
||||
dirty_bytes = 30%
|
||||
|
||||
[sysctl]
|
||||
# Filesystem I/O is usually much more efficient than swapping, so try to keep
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ include=throughput-performance
|
|||
[vm]
|
||||
# Start background writeback (via writeback threads) at this percentage (system
|
||||
# default is 10%)
|
||||
dirty_background_ratio = 5
|
||||
dirty_background_bytes = 5%
|
||||
|
||||
[cpu]
|
||||
# Setting C3 state sleep mode/power savings
|
||||
|
|
|
|||
|
|
@ -2,4 +2,4 @@
|
|||
summary=Post-loaded profile that uses variables from the regular active profile
|
||||
|
||||
[vm]
|
||||
dirty_ratio=${foo}
|
||||
dirty_bytes=${foo}%
|
||||
|
|
|
|||
|
|
@ -2,4 +2,4 @@
|
|||
summary=Post-loaded profile
|
||||
|
||||
[vm]
|
||||
dirty_ratio=8
|
||||
dirty_bytes=8%
|
||||
|
|
|
|||
|
|
@ -2,4 +2,4 @@
|
|||
summary=Second version of the post-loaded profile
|
||||
|
||||
[vm]
|
||||
dirty_ratio=7
|
||||
dirty_bytes=7%
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ class VMPlugin(base.Plugin):
|
|||
@staticmethod
|
||||
def _check_conflicting_dirty_options(instance, first, second):
|
||||
if instance.options[first] is not None and instance.options[second] is not None:
|
||||
log.error("Conflicting options '%s' and '%s', this may cause undefined behavior." % (first, second))
|
||||
log.warning("Conflicting options '%s' and '%s', this may cause undefined behavior." % (first, second))
|
||||
|
||||
@staticmethod
|
||||
def _proc_sys_vm_option_path(option):
|
||||
|
|
@ -160,18 +160,24 @@ class VMPlugin(base.Plugin):
|
|||
|
||||
@command_custom("dirty_bytes")
|
||||
def _dirty_bytes(self, enabling, value, verify, ignore_missing, instance):
|
||||
if value is not None and value.strip().endswith("%"):
|
||||
return self._dirty_option("dirty_ratio", "dirty_bytes", self._check_ratio, enabling, value.strip().rstrip("%"), verify)
|
||||
return self._dirty_option("dirty_bytes", "dirty_ratio", self._check_twice_pagesize, enabling, value, verify)
|
||||
|
||||
@command_custom("dirty_ratio")
|
||||
def _dirty_ratio(self, enabling, value, verify, ignore_missing, instance):
|
||||
log.warning("The 'dirty_ratio' option is deprecated and does not support inheritance, use 'dirty_bytes' with '%' instead.")
|
||||
return self._dirty_option("dirty_ratio", "dirty_bytes", self._check_ratio, enabling, value, verify)
|
||||
|
||||
@command_custom("dirty_background_bytes")
|
||||
def _dirty_background_bytes(self, enabling, value, verify, ignore_missing, instance):
|
||||
if value is not None and value.strip().endswith("%"):
|
||||
return self._dirty_option("dirty_background_ratio", "dirty_background_bytes", self._check_ratio, enabling, value.strip().rstrip("%"), verify)
|
||||
return self._dirty_option("dirty_background_bytes", "dirty_background_ratio", self._check_positive, enabling, value, verify)
|
||||
|
||||
@command_custom("dirty_background_ratio")
|
||||
def _dirty_background_ratio(self, enabling, value, verify, ignore_missing, instance):
|
||||
log.warning("The 'dirty_background_ratio' option is deprecated and does not support inheritance, use 'dirty_background_bytes' with '%' instead.")
|
||||
return self._dirty_option("dirty_background_ratio", "dirty_background_bytes", self._check_ratio, enabling, value, verify)
|
||||
|
||||
def _dirty_option(self, option, counterpart, check_fun, enabling, value, verify):
|
||||
|
|
@ -189,6 +195,7 @@ class VMPlugin(base.Plugin):
|
|||
int_value = int(value)
|
||||
except ValueError:
|
||||
log.error("The value of '%s' must be an integer." % option)
|
||||
return None
|
||||
if not check_fun(option, int_value):
|
||||
return None
|
||||
if current_value == value:
|
||||
|
|
|
|||
Loading…
Reference in a new issue