mm: numa: Structures for Migrate On Fault per NUMA migration rate limiting
authorAndrea Arcangeli <aarcange@redhat.com>
Fri, 23 Mar 2012 19:56:34 +0000 (20:56 +0100)
committerMel Gorman <mgorman@suse.de>
Tue, 11 Dec 2012 14:42:50 +0000 (14:42 +0000)
This defines the per-node data used by Migrate On Fault in order to
rate limit the migration. The rate limiting is applied independently
to each destination node.

Signed-off-by: Andrea Arcangeli <aarcange@redhat.com>
Signed-off-by: Mel Gorman <mgorman@suse.de>
include/linux/mmzone.h
mm/page_alloc.c

index a23923ba8263b18dac16ec73971d19bed719d015..28601fdfcdb2540762fac701a69edc96faae633b 100644 (file)
@@ -717,6 +717,19 @@ typedef struct pglist_data {
        struct task_struct *kswapd;     /* Protected by lock_memory_hotplug() */
        int kswapd_max_order;
        enum zone_type classzone_idx;
+#ifdef CONFIG_NUMA_BALANCING
+       /*
+        * Lock serializing the per destination node AutoNUMA memory
+        * migration rate limiting data.
+        */
+       spinlock_t numabalancing_migrate_lock;
+
+       /* Rate limiting time interval */
+       unsigned long numabalancing_migrate_next_window;
+
+       /* Number of pages migrated during the rate limiting time interval */
+       unsigned long numabalancing_migrate_nr_pages;
+#endif
 } pg_data_t;
 
 #define node_present_pages(nid)        (NODE_DATA(nid)->node_present_pages)
index 5953dc2d196f1a5b3b7f584361f41ca6cbf08c93..ef025e20dbee167d614e80d4b47f1699d5f900fe 100644 (file)
@@ -4449,6 +4449,11 @@ static void __paginginit free_area_init_core(struct pglist_data *pgdat,
        int ret;
 
        pgdat_resize_init(pgdat);
+#ifdef CONFIG_NUMA_BALANCING
+       spin_lock_init(&pgdat->numabalancing_migrate_lock);
+       pgdat->numabalancing_migrate_nr_pages = 0;
+       pgdat->numabalancing_migrate_next_window = jiffies;
+#endif
        init_waitqueue_head(&pgdat->kswapd_wait);
        init_waitqueue_head(&pgdat->pfmemalloc_wait);
        pgdat_page_cgroup_init(pgdat);