]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - include/linux/mmzone.h
mm: clean up and clarify lruvec lookup procedure
[linux.git] / include / linux / mmzone.h
index b0a36d1580b62d8f5ba60be5c8b1acf40d525dff..cc8232a100bd0e53f8af572762780168844950df 100644 (file)
@@ -308,7 +308,7 @@ struct lruvec {
 #endif
 };
 
-/* Isolate unmapped file */
+/* Isolate unmapped pages */
 #define ISOLATE_UNMAPPED       ((__force isolate_mode_t)0x2)
 /* Isolate for asynchronous migration */
 #define ISOLATE_ASYNC_MIGRATE  ((__force isolate_mode_t)0x4)
@@ -777,7 +777,13 @@ typedef struct pglist_data {
 #endif
 
        /* Fields commonly accessed by the page reclaim scanner */
-       struct lruvec           lruvec;
+
+       /*
+        * NOTE: THIS IS UNUSED IF MEMCG IS ENABLED.
+        *
+        * Use mem_cgroup_lruvec() to look up lruvecs.
+        */
+       struct lruvec           __lruvec;
 
        unsigned long           flags;
 
@@ -800,11 +806,6 @@ typedef struct pglist_data {
 #define node_start_pfn(nid)    (NODE_DATA(nid)->node_start_pfn)
 #define node_end_pfn(nid) pgdat_end_pfn(NODE_DATA(nid))
 
-static inline struct lruvec *node_lruvec(struct pglist_data *pgdat)
-{
-       return &pgdat->lruvec;
-}
-
 static inline unsigned long pgdat_end_pfn(pg_data_t *pgdat)
 {
        return pgdat->node_start_pfn + pgdat->node_spanned_pages;
@@ -842,7 +843,7 @@ static inline struct pglist_data *lruvec_pgdat(struct lruvec *lruvec)
 #ifdef CONFIG_MEMCG
        return lruvec->pgdat;
 #else
-       return container_of(lruvec, struct pglist_data, lruvec);
+       return container_of(lruvec, struct pglist_data, __lruvec);
 #endif
 }