diff options
-rw-r--r-- | include/linux/mmzone.h | 2 | ||||
-rw-r--r-- | mm/vmscan.c | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 2427706f78b4..68c569fcbb66 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -694,7 +694,7 @@ typedef struct pglist_data { | |||
694 | range, including holes */ | 694 | range, including holes */ |
695 | int node_id; | 695 | int node_id; |
696 | wait_queue_head_t kswapd_wait; | 696 | wait_queue_head_t kswapd_wait; |
697 | struct task_struct *kswapd; | 697 | struct task_struct *kswapd; /* Protected by lock_memory_hotplug() */ |
698 | int kswapd_max_order; | 698 | int kswapd_max_order; |
699 | enum zone_type classzone_idx; | 699 | enum zone_type classzone_idx; |
700 | } pg_data_t; | 700 | } pg_data_t; |
diff --git a/mm/vmscan.c b/mm/vmscan.c index eeb3bc9d1d36..661576324c7f 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
@@ -2955,14 +2955,17 @@ int kswapd_run(int nid) | |||
2955 | } | 2955 | } |
2956 | 2956 | ||
2957 | /* | 2957 | /* |
2958 | * Called by memory hotplug when all memory in a node is offlined. | 2958 | * Called by memory hotplug when all memory in a node is offlined. Caller must |
2959 | * hold lock_memory_hotplug(). | ||
2959 | */ | 2960 | */ |
2960 | void kswapd_stop(int nid) | 2961 | void kswapd_stop(int nid) |
2961 | { | 2962 | { |
2962 | struct task_struct *kswapd = NODE_DATA(nid)->kswapd; | 2963 | struct task_struct *kswapd = NODE_DATA(nid)->kswapd; |
2963 | 2964 | ||
2964 | if (kswapd) | 2965 | if (kswapd) { |
2965 | kthread_stop(kswapd); | 2966 | kthread_stop(kswapd); |
2967 | NODE_DATA(nid)->kswapd = NULL; | ||
2968 | } | ||
2966 | } | 2969 | } |
2967 | 2970 | ||
2968 | static int __init kswapd_init(void) | 2971 | static int __init kswapd_init(void) |