* [PATCH 6/7][TRIVIAL][resend] mm: cleanup page reclaim comment error
@ 2012-06-15 13:19 Wanpeng Li
2012-06-15 14:58 ` Johannes Weiner
0 siblings, 1 reply; 2+ messages in thread
From: Wanpeng Li @ 2012-06-15 13:19 UTC (permalink / raw)
To: trivial
Cc: Christoph Lameter, Srikar Dronamraju, linux-pci, Jesse Barnes,
David Howells, Paul Gortmaker, H. Peter Anvin, Larry Woodman,
Andrea Arcangeli, Stephen Rothwell, Gavin Shan, x86, Hugh Dickins,
Ingo Molnar, KOSAKI Motohiro, Jan Kiszka, Nishanth Aravamudan,
Wanpeng Li, Peter Zijlstra, Mel Gorman, Jason Wessel, Al Viro,
Bjorn Helgaas, cgroups, Thomas Gleixner, KAMEZAWA Hiroyuki,
Michal Hocko, linux-mm, linux-kernel, Milton Miller, Minchan Kim,
Li Zefan, Johannes Weiner, Tejun Heo, David Rientjes,
Andrew Morton, linuxppc-dev
From: Wanpeng Li <liwp@linux.vnet.ibm.com>
Since there are five lists in LRU cache, the array nr in get_scan_count
should be:
nr[0] = anon inactive pages to scan; nr[1] = anon active pages to scan
nr[2] = file inactive pages to scan; nr[3] = file active pages to scan
Signed-off-by: Wanpeng Li <liwp.linux@gmail.com>
Acked-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Reviewed-by: Rik van Riel <riel@redhat.com>
---
mm/vmscan.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/mm/vmscan.c b/mm/vmscan.c
index eeb3bc9..ed823df 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1567,7 +1567,8 @@ static int vmscan_swappiness(struct scan_control *sc)
* by looking at the fraction of the pages scanned we did rotate back
* onto the active list instead of evict.
*
- * nr[0] = anon pages to scan; nr[1] = file pages to scan
+ * nr[0] = anon inactive pages to scan; nr[1] = anon active pages to scan
+ * nr[2] = file inactive pages to scan; nr[3] = file active pages to scan
*/
static void get_scan_count(struct lruvec *lruvec, struct scan_control *sc,
unsigned long *nr)
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 6/7][TRIVIAL][resend] mm: cleanup page reclaim comment error
2012-06-15 13:19 [PATCH 6/7][TRIVIAL][resend] mm: cleanup page reclaim comment error Wanpeng Li
@ 2012-06-15 14:58 ` Johannes Weiner
0 siblings, 0 replies; 2+ messages in thread
From: Johannes Weiner @ 2012-06-15 14:58 UTC (permalink / raw)
To: Wanpeng Li
Cc: Christoph Lameter, Srikar Dronamraju, linux-pci, Jesse Barnes,
David Howells, Paul Gortmaker, H. Peter Anvin, Larry Woodman,
Andrea Arcangeli, Stephen Rothwell, Gavin Shan, x86, Hugh Dickins,
Ingo Molnar, KOSAKI Motohiro, Jan Kiszka, Nishanth Aravamudan,
Peter Zijlstra, Mel Gorman, David Rientjes, Al Viro,
Bjorn Helgaas, cgroups, Thomas Gleixner, KAMEZAWA Hiroyuki,
Michal Hocko, trivial, linux-mm, linux-kernel, Milton Miller,
Minchan Kim, Li Zefan, Jason Wessel, Tejun Heo, Andrew Morton,
linuxppc-dev
On Fri, Jun 15, 2012 at 09:19:45PM +0800, Wanpeng Li wrote:
> From: Wanpeng Li <liwp@linux.vnet.ibm.com>
>
> Since there are five lists in LRU cache, the array nr in get_scan_count
> should be:
>
> nr[0] = anon inactive pages to scan; nr[1] = anon active pages to scan
> nr[2] = file inactive pages to scan; nr[3] = file active pages to scan
>
> Signed-off-by: Wanpeng Li <liwp.linux@gmail.com>
> Acked-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
> Acked-by: Minchan Kim <minchan@kernel.org>
> Reviewed-by: Rik van Riel <riel@redhat.com>
>
> ---
> mm/vmscan.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/mm/vmscan.c b/mm/vmscan.c
> index eeb3bc9..ed823df 100644
> --- a/mm/vmscan.c
> +++ b/mm/vmscan.c
> @@ -1567,7 +1567,8 @@ static int vmscan_swappiness(struct scan_control *sc)
> * by looking at the fraction of the pages scanned we did rotate back
> * onto the active list instead of evict.
> *
> - * nr[0] = anon pages to scan; nr[1] = file pages to scan
> + * nr[0] = anon inactive pages to scan; nr[1] = anon active pages to scan
> + * nr[2] = file inactive pages to scan; nr[3] = file active pages to scan
> */
Does including this in the comment have any merit in the first place?
We never access nr[0] or nr[1] etc. anywhere with magic numbers. It's
a local function with one callsite, the passed array is declared and
accessed exclusively by what is defined in enum lru_list, where is the
point in repeating the enum items?. I'd rather the next change to
this comment would be its removal.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-06-15 16:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-15 13:19 [PATCH 6/7][TRIVIAL][resend] mm: cleanup page reclaim comment error Wanpeng Li
2012-06-15 14:58 ` Johannes Weiner
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).