The patch titled pgdat allocation for new node add (export kswapd start func) has been added to the -mm tree. Its filename is pgdat-allocation-for-new-node-add-export-kswapd-start-func.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this From: Yasunori Goto <y-goto@xxxxxxxxxxxxxx> When node is hot-added, kswapd for the node should start. This export kswapd start function as kswapd_run() to use at add_memory(). Signed-off-by: Yasunori Goto <y-goto@xxxxxxxxxxxxxx> Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx> Cc: Dave Hansen <haveblue@xxxxxxxxxx> Cc: "Brown, Len" <len.brown@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- include/linux/swap.h | 2 ++ mm/vmscan.c | 35 ++++++++++++++++++++++++++--------- 2 files changed, 28 insertions(+), 9 deletions(-) diff -puN include/linux/swap.h~pgdat-allocation-for-new-node-add-export-kswapd-start-func include/linux/swap.h --- devel/include/linux/swap.h~pgdat-allocation-for-new-node-add-export-kswapd-start-func 2006-04-20 16:07:00.000000000 -0700 +++ devel-akpm/include/linux/swap.h 2006-04-20 16:07:00.000000000 -0700 @@ -211,6 +211,8 @@ static inline int zone_reclaim(struct zo } #endif +extern int kswapd_run(int nid); + #ifdef CONFIG_MMU /* linux/mm/shmem.c */ extern int shmem_unuse(swp_entry_t entry, struct page *page); diff -puN mm/vmscan.c~pgdat-allocation-for-new-node-add-export-kswapd-start-func mm/vmscan.c --- devel/mm/vmscan.c~pgdat-allocation-for-new-node-add-export-kswapd-start-func 2006-04-20 16:07:00.000000000 -0700 +++ devel-akpm/mm/vmscan.c 2006-04-20 16:07:00.000000000 -0700 @@ -34,6 +34,7 @@ #include <linux/notifier.h> #include <linux/rwsem.h> #include <linux/delay.h> +#include <linux/kthread.h> #include <asm/tlbflush.h> #include <asm/div64.h> @@ -1454,20 +1455,36 @@ static int __devinit cpu_callback(struct } #endif /* CONFIG_HOTPLUG_CPU */ +/* + * This kswapd start function will be called by init and node-hot-add. + * On node-hot-add, kswapd will moved to proper cpus if cpus are hot-added. + */ +int kswapd_run(int nid) +{ + pg_data_t *pgdat = NODE_DATA(nid); + int ret = 0; + + if (pgdat->kswapd) + return 0; + + pgdat->kswapd = kthread_run(kswapd, pgdat, "kswapd%d", nid); + if (pgdat->kswapd == ERR_PTR(-ENOMEM)) { + /* failure at boot is fatal */ + BUG_ON(system_state == SYSTEM_BOOTING); + printk("faled to run kswapd on node %d\n",nid); + ret = -1; + } + return ret; +} + static int __init kswapd_init(void) { - pg_data_t *pgdat; + int nid; swap_setup(); - for_each_online_pgdat(pgdat) { - pid_t pid; + for_each_online_node(nid) + kswapd_run(nid); - pid = kernel_thread(kswapd, pgdat, CLONE_KERNEL); - BUG_ON(pid < 0); - read_lock(&tasklist_lock); - pgdat->kswapd = find_task_by_pid(pid); - read_unlock(&tasklist_lock); - } total_memory = nr_free_pagecache_pages(); hotcpu_notifier(cpu_callback, 0); return 0; _ Patches currently in -mm which might be from y-goto@xxxxxxxxxxxxxx are catch-notification-of-memory-add-event-of-acpi-via-container-driver-register-start-func-for-memory-device.patch catch-notification-of-memory-add-event-of-acpi-via-container-driveravoid-redundant-call-add_memory.patch wait_table-and-zonelist-initializing-for-memory-hotadd-change-name-of-wait_table_size.patch wait_table-and-zonelist-initializing-for-memory-hotadd-change-to-meminit-for-build_zonelist.patch wait_table-and-zonelist-initializing-for-memory-hotaddadd-return-code-for-init_current_empty_zone.patch wait_table-and-zonelist-initializing-for-memory-hotadd-wait_table-initialization.patch wait_table-and-zonelist-initializing-for-memory-hotadd-wait_table-initialization-fixes.patch wait_table-and-zonelist-initializing-for-memory-hotadd-update-zonelists.patch pgdat-allocation-for-new-node-add-specify-node-id.patch pgdat-allocation-for-new-node-add-specify-node-id-tidy.patch pgdat-allocation-for-new-node-add-get-node-id-by-acpi.patch pgdat-allocation-for-new-node-add-generic-alloc-node_data.patch pgdat-allocation-for-new-node-add-generic-alloc-node_data-tidy.patch pgdat-allocation-for-new-node-add-refresh-node_data.patch pgdat-allocation-for-new-node-add-export-kswapd-start-func.patch pgdat-allocation-for-new-node-add-export-kswapd-start-func-tidy.patch pgdat-allocation-for-new-node-add-call-pgdat-allocation.patch unify-pxm_to_node-and-node_to_pxm.patch unify-pxm_to_node-and-node_to_pxm-update.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html