Skip to contentSkip to conversation

mm: Document improved handling of swappiness==0

PATCH In review Aaron Tomlin 2 participants 2 messages Jan 24, 2014 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm: Document improved handling of swappiness==0

Prior to upstream commit fe35004f ("[mm] avoid swapping out with swappiness==0") setting swappiness to 0, reclaim code could still evict recently used user anonymous memory to swap even though there is a significant amount of RAM used for page cache.

The behaviour of setting swappiness to 0 has since changed. When set, the reclaim code does not initiate swap until the amount of free pages and file-backed pages, is less than the high water mark in a zone.

Let's update the documentation to reflect this.

---
 Documentation/sysctl/vm.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Documentation/sysctl/vm.txt +3 -1
index 9f5481b..38388ee 100644
@@ -696,7 +696,9 @@ swappiness
 
 This control is used to define how aggressive the kernel will swap
 memory pages.  Higher values will increase agressiveness, lower values
-decrease the amount of swap.
+decrease the amount of swap.  A value of 0 instructs the kernel not to
+initiate swap until the amount of free and file-backed pages, is less
+than the high water mark in a zone.
 
 The default value is 60.
 
Signature · 1 line
1.8.4.2
reviewer
#1 lore raw
Quoted 25 lines · Aaron Tomlin

Prior to upstream commit fe35004f ("[mm] avoid swapping out with swappiness==0") setting swappiness to 0, reclaim code could still evict recently used user anonymous memory to swap even though there is a significant amount of RAM used for page cache.

The behaviour of setting swappiness to 0 has since changed. When set, the reclaim code does not initiate swap until the amount of free pages and file-backed pages, is less than the high water mark in a zone.

Let's update the documentation to reflect this.

---
 Documentation/sysctl/vm.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Documentation/sysctl/vm.txt +0 -0
index 9f5481b..38388ee 100644

Documentation/sysctl/vm.txt swappiness · line 700

Quoted 6 lines
Documentation/sysctl/vm.txt +2 -1
@@ -696,7 +696,9 @@ swappiness
 
 This control is used to define how aggressive the kernel will swap
 memory pages.  Higher values will increase agressiveness, lower values
-decrease the amount of swap.
+decrease the amount of swap.  A value of 0 instructs the kernel not to
+initiate swap until the amount of free and file-backed pages, is less

drop the comma ^

Quoted 5 lines
Documentation/sysctl/vm.txt +1 -0
+than the high water mark in a zone.
 
 The default value is 60.
 
Signature · 1 line
~Randy