Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

doc: clarify the behaviour of dirty_ratio/dirty_bytes

When dirty_ratio or dirty_bytes is written the other parameter is disabled
and set to 0 (in dirty_bytes_handler() / dirty_ratio_handler()).

We do the same for dirty_background_ratio and dirty_background_bytes.

However, in the sysctl documentation, we say that the counterpart becomes
a function of the old value, that is not correct.

Clarify the documentation reporting the actual behaviour.

Reviewed-by: Greg Thelen <gthelen@google.com>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Andrea Righi <arighi@develer.com>
Cc: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Andrea Righi and committed by
Linus Torvalds
abffc020 e45c9eff

+8 -4
+8 -4
Documentation/sysctl/vm.txt
··· 80 80 Contains the amount of dirty memory at which the pdflush background writeback 81 81 daemon will start writeback. 82 82 83 - If dirty_background_bytes is written, dirty_background_ratio becomes a function 84 - of its value (dirty_background_bytes / the amount of dirtyable system memory). 83 + Note: dirty_background_bytes is the counterpart of dirty_background_ratio. Only 84 + one of them may be specified at a time. When one sysctl is written it is 85 + immediately taken into account to evaluate the dirty memory limits and the 86 + other appears as 0 when read. 85 87 86 88 ============================================================== 87 89 ··· 99 97 Contains the amount of dirty memory at which a process generating disk writes 100 98 will itself start writeback. 101 99 102 - If dirty_bytes is written, dirty_ratio becomes a function of its value 103 - (dirty_bytes / the amount of dirtyable system memory). 100 + Note: dirty_bytes is the counterpart of dirty_ratio. Only one of them may be 101 + specified at a time. When one sysctl is written it is immediately taken into 102 + account to evaluate the dirty memory limits and the other appears as 0 when 103 + read. 104 104 105 105 Note: the minimum value allowed for dirty_bytes is two pages (in bytes); any 106 106 value lower than this limit will be ignored and the old configuration will be