Skip to contentSkip to conversation

mm: update the description for vm_total_pages

PATCH In review Wang Sheng-Hui 2 participants 4 messages Jul 8, 2014 – Jul 9, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm: update the description for vm_total_pages

vm_total_pages is calculated by nr_free_pagecache_pages(), which counts the number of pages which are beyond the high watermark within all zones. So vm_total_pages is not equal to total number of pages which the VM controls.

---
 mm/vmscan.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
mm/vmscan.c +5 -1
index 0f16ffe..8c7a559 100644
@@ -136,7 +136,11 @@ struct scan_control {
  * From 0 .. 100.  Higher means more swappy.
  */
 int vm_swappiness = 60;
-unsigned long vm_total_pages;  /* The total number of pages which the VM controls */
+/*
+ * The total number of pages which are beyond the high watermark
+ * within all zones.
+ */
+unsigned long vm_total_pages;
 
 static LIST_HEAD(shrinker_list);
 static DECLARE_RWSEM(shrinker_rwsem);
Signature · 7 lines
1.8.3.2

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
maintainer
#1 lore raw
Quoted 12 lines · On Tue, 08 Jul 2014 13:44:51 +0800 Wang Sheng-Hui <[email protected]> wrote:

vm_total_pages is calculated by nr_free_pagecache_pages(), which counts the number of pages which are beyond the high watermark within all zones. So vm_total_pages is not equal to total number of pages which the VM controls.

...

mm/vmscan.c +0 -0
@@ -136,7 +136,11 @@ struct scan_control {
  * From 0 .. 100.  Higher means more swappy.
  */

mm/vmscan.c struct scan_control { · line 146

Quoted 10 lines
mm/vmscan.c +5 -1
 int vm_swappiness = 60;
-unsigned long vm_total_pages;  /* The total number of pages which the VM controls */
+/*
+ * The total number of pages which are beyond the high watermark
+ * within all zones.
+ */
+unsigned long vm_total_pages;
 
 static LIST_HEAD(shrinker_list);
 static DECLARE_RWSEM(shrinker_rwsem);

Nice patch! It's good to document these little things as one discovers them.

However vm_total_pages is only ever used in build_all_zonelists() and could be made a local within that function.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

#2 lore raw

Andrew,

Quoted 22 lines · Andrew Morton
Quoted 20 lines · On Tue, 08 Jul 2014 13:44:51 +0800 Wang Sheng-Hui <[email protected]> wrote:

vm_total_pages is calculated by nr_free_pagecache_pages(), which counts the number of pages which are beyond the high watermark within all zones. So vm_total_pages is not equal to total number of pages which the VM controls.

...

mm/vmscan.c +5 -1
@@ -136,7 +136,11 @@ struct scan_control {
  * From 0 .. 100.  Higher means more swappy.
  */
 int vm_swappiness = 60;
-unsigned long vm_total_pages;  /* The total number of pages which the VM controls */
+/*
+ * The total number of pages which are beyond the high watermark
+ * within all zones.
+ */
+unsigned long vm_total_pages;
 
Quoted 8 lines

mm/vmscan.c struct scan_control { · line 146

Quoted 2 lines
mm/vmscan.c +0 -0
 static LIST_HEAD(shrinker_list);
 static DECLARE_RWSEM(shrinker_rwsem);

Nice patch! It's good to document these little things as one discovers them.

However vm_total_pages is only ever used in build_all_zonelists() and could be made a local within that function.

We can see that vm_total_pages is not used in build_all_zonelist() only.
http://lxr.oss.org.cn/search?string=vm_total_pages

Maybe some redefinition is needed instead of current definition in vmscan.c.:-)

Quoted 1 line

Regards,
Wang Sheng-Hui

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

maintainer
#3 lore raw
Quoted 5 lines · On Wed, 09 Jul 2014 07:45:06 +0800 Wang Sheng-Hui <[email protected]> wrote:
Quoted 5 lines
Quoted 4 lines

+unsigned long vm_total_pages;

static LIST_HEAD(shrinker_list);
static DECLARE_RWSEM(shrinker_rwsem);

Quoted 8 lines
Quoted 5 lines

Nice patch! It's good to document these little things as one discovers them.

However vm_total_pages is only ever used in build_all_zonelists() and could be made a local within that function.

We can see that vm_total_pages is not used in build_all_zonelist() only.
http://lxr.oss.org.cn/search?string=vm_total_pages

Look more closely ;)

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>