Skip to content

Commit abffc02

Browse files
Andrea Righitorvalds
authored andcommitted
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>
1 parent e45c9ef commit abffc02

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

‎Documentation/sysctl/vm.txt‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,10 @@ dirty_background_bytes
8080
Contains the amount of dirty memory at which the pdflush background writeback
8181
daemon will start writeback.
8282

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.
8587

8688
==============================================================
8789

@@ -97,8 +99,10 @@ dirty_bytes
9799
Contains the amount of dirty memory at which a process generating disk writes
98100
will itself start writeback.
99101

100-
If dirty_bytes is written, dirty_ratio becomes a function of its value
101-
(dirty_bytes / the amount of dirtyable system memory).
102+
Note: dirty_bytes is the counterpart of dirty_ratio. Only one of them may be
103+
specified at a time. When one sysctl is written it is immediately taken into
104+
account to evaluate the dirty memory limits and the other appears as 0 when
105+
read.
102106

103107
Note: the minimum value allowed for dirty_bytes is two pages (in bytes); any
104108
value lower than this limit will be ignored and the old configuration will be

0 commit comments

Comments
 (0)