diff options
author | Johannes Weiner <jweiner@redhat.com> | 2012-01-12 20:18:10 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-12 23:13:05 -0500 |
commit | 6290df545814990ca2663baf6e894669132d5f73 (patch) | |
tree | c62472270ba81a7146bed0854be74e2e2338c629 /include/linux/mmzone.h | |
parent | b95a2f2d486d0d768a92879c023a03757b9c7e58 (diff) |
mm: collect LRU list heads into struct lruvec
Having a unified structure with a LRU list set for both global zones and
per-memcg zones allows to keep that code simple which deals with LRU
lists and does not care about the container itself.
Once the per-memcg LRU lists directly link struct pages, the isolation
function and all other list manipulations are shared between the memcg
case and the global LRU case.
Signed-off-by: Johannes Weiner <jweiner@redhat.com>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Reviewed-by: Michal Hocko <mhocko@suse.cz>
Reviewed-by: Kirill A. Shutemov <kirill@shutemov.name>
Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Cc: Balbir Singh <bsingharora@gmail.com>
Cc: Ying Han <yinghan@google.com>
Cc: Greg Thelen <gthelen@google.com>
Cc: Michel Lespinasse <walken@google.com>
Cc: Rik van Riel <riel@redhat.com>
Cc: Minchan Kim <minchan.kim@gmail.com>
Cc: Christoph Hellwig <hch@infradead.org>
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/mmzone.h')
-rw-r--r-- | include/linux/mmzone.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index ca6ca92418a6..42e544cd4c9f 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -159,6 +159,10 @@ static inline int is_unevictable_lru(enum lru_list l) | |||
159 | return (l == LRU_UNEVICTABLE); | 159 | return (l == LRU_UNEVICTABLE); |
160 | } | 160 | } |
161 | 161 | ||
162 | struct lruvec { | ||
163 | struct list_head lists[NR_LRU_LISTS]; | ||
164 | }; | ||
165 | |||
162 | /* Mask used at gathering information at once (see memcontrol.c) */ | 166 | /* Mask used at gathering information at once (see memcontrol.c) */ |
163 | #define LRU_ALL_FILE (BIT(LRU_INACTIVE_FILE) | BIT(LRU_ACTIVE_FILE)) | 167 | #define LRU_ALL_FILE (BIT(LRU_INACTIVE_FILE) | BIT(LRU_ACTIVE_FILE)) |
164 | #define LRU_ALL_ANON (BIT(LRU_INACTIVE_ANON) | BIT(LRU_ACTIVE_ANON)) | 168 | #define LRU_ALL_ANON (BIT(LRU_INACTIVE_ANON) | BIT(LRU_ACTIVE_ANON)) |
@@ -364,10 +368,8 @@ struct zone { | |||
364 | ZONE_PADDING(_pad1_) | 368 | ZONE_PADDING(_pad1_) |
365 | 369 | ||
366 | /* Fields commonly accessed by the page reclaim scanner */ | 370 | /* Fields commonly accessed by the page reclaim scanner */ |
367 | spinlock_t lru_lock; | 371 | spinlock_t lru_lock; |
368 | struct zone_lru { | 372 | struct lruvec lruvec; |
369 | struct list_head list; | ||
370 | } lru[NR_LRU_LISTS]; | ||
371 | 373 | ||
372 | struct zone_reclaim_stat reclaim_stat; | 374 | struct zone_reclaim_stat reclaim_stat; |
373 | 375 | ||