* [PATCH] mm: update the description for vm_total_pages
@ 2014-07-08 5:44 Wang Sheng-Hui
2014-07-08 20:41 ` Andrew Morton
0 siblings, 1 reply; 4+ messages in thread
From: Wang Sheng-Hui @ 2014-07-08 5:44 UTC (permalink / raw)
To: Andrew Morton, Mel Gorman, Rik van Riel, Johannes Weiner,
Michal Hocko, Vladimir Davydov, Glauber Costa, Dave Chinner,
linux-mm
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.
Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com>
---
mm/vmscan.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 0f16ffe..8c7a559 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -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);
--
1.8.3.2
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] mm: update the description for vm_total_pages
2014-07-08 5:44 [PATCH] mm: update the description for vm_total_pages Wang Sheng-Hui
@ 2014-07-08 20:41 ` Andrew Morton
2014-07-08 23:45 ` Wang Sheng-Hui
0 siblings, 1 reply; 4+ messages in thread
From: Andrew Morton @ 2014-07-08 20:41 UTC (permalink / raw)
To: Wang Sheng-Hui
Cc: Mel Gorman, Rik van Riel, Johannes Weiner, Michal Hocko,
Vladimir Davydov, Glauber Costa, Dave Chinner, linux-mm
On Tue, 08 Jul 2014 13:44:51 +0800 Wang Sheng-Hui <shhuiw@gmail.com> 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.
>
> ...
>
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -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);
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 majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mm: update the description for vm_total_pages
2014-07-08 20:41 ` Andrew Morton
@ 2014-07-08 23:45 ` Wang Sheng-Hui
2014-07-09 0:02 ` Andrew Morton
0 siblings, 1 reply; 4+ messages in thread
From: Wang Sheng-Hui @ 2014-07-08 23:45 UTC (permalink / raw)
To: Andrew Morton
Cc: Mel Gorman, Rik van Riel, Johannes Weiner, Michal Hocko,
Vladimir Davydov, Glauber Costa, Dave Chinner, linux-mm
Andrew,
On 2014a1'07ae??09ae?JPY 04:41, Andrew Morton wrote:
> On Tue, 08 Jul 2014 13:44:51 +0800 Wang Sheng-Hui <shhuiw@gmail.com> 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.
>>
>> ...
>>
>> --- a/mm/vmscan.c
>> +++ b/mm/vmscan.c
>> @@ -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);
>
> 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.:-)
>
Regards,
Wang Sheng-Hui
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mm: update the description for vm_total_pages
2014-07-08 23:45 ` Wang Sheng-Hui
@ 2014-07-09 0:02 ` Andrew Morton
0 siblings, 0 replies; 4+ messages in thread
From: Andrew Morton @ 2014-07-09 0:02 UTC (permalink / raw)
To: Wang Sheng-Hui
Cc: Mel Gorman, Rik van Riel, Johannes Weiner, Michal Hocko,
Vladimir Davydov, Glauber Costa, Dave Chinner, linux-mm
On Wed, 09 Jul 2014 07:45:06 +0800 Wang Sheng-Hui <shhuiw@gmail.com> wrote:
> >> +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.
>
> 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 majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-07-09 0:03 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-08 5:44 [PATCH] mm: update the description for vm_total_pages Wang Sheng-Hui
2014-07-08 20:41 ` Andrew Morton
2014-07-08 23:45 ` Wang Sheng-Hui
2014-07-09 0:02 ` Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).