diff options
author | Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> | 2012-10-08 19:32:02 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-09 03:22:44 -0400 |
commit | d1ce749a0db12202b711d1aba1d29e823034648d (patch) | |
tree | b9b1f0e1d4fcda9ab900575f42f5ddc155d28648 /include/linux | |
parent | 2139cbe627b8910ded55148f87ee10f7485408ed (diff) |
cma: count free CMA pages
Add NR_FREE_CMA_PAGES counter to be later used for checking watermark in
__zone_watermark_ok(). For simplicity and to avoid #ifdef hell make this
counter always available (not only when CONFIG_CMA=y).
[akpm@linux-foundation.org: use conventional migratetype naming]
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Michal Nazarewicz <mina86@mina86.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/mmzone.h | 1 | ||||
-rw-r--r-- | include/linux/vmstat.h | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 2daa54f55db7..85ac67aa5770 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -142,6 +142,7 @@ enum zone_stat_item { | |||
142 | NUMA_OTHER, /* allocation from other node */ | 142 | NUMA_OTHER, /* allocation from other node */ |
143 | #endif | 143 | #endif |
144 | NR_ANON_TRANSPARENT_HUGEPAGES, | 144 | NR_ANON_TRANSPARENT_HUGEPAGES, |
145 | NR_FREE_CMA_PAGES, | ||
145 | NR_VM_ZONE_STAT_ITEMS }; | 146 | NR_VM_ZONE_STAT_ITEMS }; |
146 | 147 | ||
147 | /* | 148 | /* |
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h index ad2cfd53dadc..a5bb15018b5c 100644 --- a/include/linux/vmstat.h +++ b/include/linux/vmstat.h | |||
@@ -253,6 +253,14 @@ static inline void refresh_zone_stat_thresholds(void) { } | |||
253 | 253 | ||
254 | #endif /* CONFIG_SMP */ | 254 | #endif /* CONFIG_SMP */ |
255 | 255 | ||
256 | static inline void __mod_zone_freepage_state(struct zone *zone, int nr_pages, | ||
257 | int migratetype) | ||
258 | { | ||
259 | __mod_zone_page_state(zone, NR_FREE_PAGES, nr_pages); | ||
260 | if (is_migrate_cma(migratetype)) | ||
261 | __mod_zone_page_state(zone, NR_FREE_CMA_PAGES, nr_pages); | ||
262 | } | ||
263 | |||
256 | extern const char * const vmstat_text[]; | 264 | extern const char * const vmstat_text[]; |
257 | 265 | ||
258 | #endif /* _LINUX_VMSTAT_H */ | 266 | #endif /* _LINUX_VMSTAT_H */ |