diff options
| author | Konstantin Khlebnikov <khlebnikov@openvz.org> | 2012-05-29 18:06:58 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-05-29 19:22:26 -0400 |
| commit | 7f5e86c2ccc1480946d2c869d7f7d5278e828092 (patch) | |
| tree | 704612422963868042c9d240b4a395bd7bce8469 /include/linux | |
| parent | 9e3b2f8cd340e13353a44c9a34caef2848131ed7 (diff) | |
mm: add link from struct lruvec to struct zone
This is the first stage of struct mem_cgroup_zone removal. Further
patches replace struct mem_cgroup_zone with a pointer to struct lruvec.
If CONFIG_CGROUP_MEM_RES_CTLR=n lruvec_zone() is just container_of().
Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: 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 | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 5c4880bc027a..2427706f78b4 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
| @@ -201,6 +201,9 @@ struct zone_reclaim_stat { | |||
| 201 | struct lruvec { | 201 | struct lruvec { |
| 202 | struct list_head lists[NR_LRU_LISTS]; | 202 | struct list_head lists[NR_LRU_LISTS]; |
| 203 | struct zone_reclaim_stat reclaim_stat; | 203 | struct zone_reclaim_stat reclaim_stat; |
| 204 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR | ||
| 205 | struct zone *zone; | ||
| 206 | #endif | ||
| 204 | }; | 207 | }; |
| 205 | 208 | ||
| 206 | /* Mask used at gathering information at once (see memcontrol.c) */ | 209 | /* Mask used at gathering information at once (see memcontrol.c) */ |
| @@ -729,6 +732,17 @@ extern int init_currently_empty_zone(struct zone *zone, unsigned long start_pfn, | |||
| 729 | unsigned long size, | 732 | unsigned long size, |
| 730 | enum memmap_context context); | 733 | enum memmap_context context); |
| 731 | 734 | ||
| 735 | extern void lruvec_init(struct lruvec *lruvec, struct zone *zone); | ||
| 736 | |||
| 737 | static inline struct zone *lruvec_zone(struct lruvec *lruvec) | ||
| 738 | { | ||
| 739 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR | ||
| 740 | return lruvec->zone; | ||
| 741 | #else | ||
| 742 | return container_of(lruvec, struct zone, lruvec); | ||
| 743 | #endif | ||
| 744 | } | ||
| 745 | |||
| 732 | #ifdef CONFIG_HAVE_MEMORY_PRESENT | 746 | #ifdef CONFIG_HAVE_MEMORY_PRESENT |
| 733 | void memory_present(int nid, unsigned long start, unsigned long end); | 747 | void memory_present(int nid, unsigned long start, unsigned long end); |
| 734 | #else | 748 | #else |
