From: Wanpeng Li <hidden> Date: 2012-06-15 13:20:18
From: Wanpeng Li <redacted>
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 <redacted>
Acked-by: KOSAKI Motohiro <redacted>
Acked-by: Minchan Kim <minchan@kernel.org>
Reviewed-by: Rik van Riel <redacted>
---
mm/vmscan.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
From: Johannes Weiner <hannes@cmpxchg.org> Date: 2012-06-15 15:02:27
On Fri, Jun 15, 2012 at 09:19:45PM +0800, Wanpeng Li wrote:
quoted hunk
From: Wanpeng Li <redacted>
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 <redacted>
Acked-by: KOSAKI Motohiro <redacted>
Acked-by: Minchan Kim <minchan@kernel.org>
Reviewed-by: Rik van Riel <redacted>
---
mm/vmscan.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
@@ -1567,7 +1567,8 @@ static int vmscan_swappiness(struct scan_control *sc)*bylookingatthefractionofthepagesscannedwedidrotateback*ontotheactivelistinsteadofevict.*-*nr[0]=anonpagestoscan;nr[1]=filepagestoscan+*nr[0]=anoninactivepagestoscan;nr[1]=anonactivepagestoscan+*nr[2]=fileinactivepagestoscan;nr[3]=fileactivepagestoscan*/
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.