[PATCH 05/09] make zone_nr_pages() helper function
- From: KOSAKI Motohiro <kosaki.motohiro@xxxxxxxxxxxxxx>
- Date: Sun, 30 Nov 2008 19:59:55 +0900 (JST)
make zone_nr_pages() function.
it is used by latter patch.
this patch doesn't have any functional change.
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@xxxxxxxxxxxxxx>
---
mm/vmscan.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
Index: b/mm/vmscan.c
===================================================================
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -140,6 +140,13 @@ static struct zone_reclaim_stat *get_rec
return &zone->reclaim_stat;
}
+static unsigned long zone_nr_pages(struct zone *zone, struct scan_control *sc,
+ enum lru_list lru)
+{
+ return zone_page_state(zone, NR_LRU_BASE + lru);
+}
+
+
/*
* Add a shrinker callback to be called from the vm
*/
@@ -1435,10 +1442,10 @@ static void get_scan_ratio(struct zone *
return;
}
- anon = zone_page_state(zone, NR_ACTIVE_ANON) +
- zone_page_state(zone, NR_INACTIVE_ANON);
- file = zone_page_state(zone, NR_ACTIVE_FILE) +
- zone_page_state(zone, NR_INACTIVE_FILE);
+ anon = zone_nr_pages(zone, sc, LRU_ACTIVE_ANON) +
+ zone_nr_pages(zone, sc, LRU_INACTIVE_ANON);
+ file = zone_nr_pages(zone, sc, LRU_ACTIVE_FILE) +
+ zone_nr_pages(zone, sc, LRU_INACTIVE_FILE);
free = zone_page_state(zone, NR_FREE_PAGES);
/* If we have very few page cache pages, force-scan anon pages. */
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- Re: [PATCH 05/09] make zone_nr_pages() helper function
- From: Rik van Riel
- Re: [PATCH 05/09] make zone_nr_pages() helper function
- References:
- [PATCH 00/09] memcg: split-lru feature for memcg
- From: KOSAKI Motohiro
- [PATCH 00/09] memcg: split-lru feature for memcg
- Prev by Date: [PATCH 04/09] memcg: make zone_reclaim_stat
- Next by Date: [PATCH 06/09] make get_scan_ratio() to memcg awareness
- Previous by thread: Re: [PATCH 04/09] memcg: make zone_reclaim_stat
- Next by thread: Re: [PATCH 05/09] make zone_nr_pages() helper function
- Index(es):
Relevant Pages
|