diff options
Diffstat (limited to 'mm/vmscan.c')
-rw-r--r-- | mm/vmscan.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c index 518540a4a2a6..093f5fe6dd77 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <linux/rwsem.h> | 36 | #include <linux/rwsem.h> |
37 | #include <linux/delay.h> | 37 | #include <linux/delay.h> |
38 | #include <linux/kthread.h> | 38 | #include <linux/kthread.h> |
39 | #include <linux/freezer.h> | ||
39 | 40 | ||
40 | #include <asm/tlbflush.h> | 41 | #include <asm/tlbflush.h> |
41 | #include <asm/div64.h> | 42 | #include <asm/div64.h> |
@@ -1172,11 +1173,12 @@ loop_again: | |||
1172 | if (!zone_watermark_ok(zone, order, zone->pages_high, | 1173 | if (!zone_watermark_ok(zone, order, zone->pages_high, |
1173 | 0, 0)) { | 1174 | 0, 0)) { |
1174 | end_zone = i; | 1175 | end_zone = i; |
1175 | goto scan; | 1176 | break; |
1176 | } | 1177 | } |
1177 | } | 1178 | } |
1178 | goto out; | 1179 | if (i < 0) |
1179 | scan: | 1180 | goto out; |
1181 | |||
1180 | for (i = 0; i <= end_zone; i++) { | 1182 | for (i = 0; i <= end_zone; i++) { |
1181 | struct zone *zone = pgdat->node_zones + i; | 1183 | struct zone *zone = pgdat->node_zones + i; |
1182 | 1184 | ||
@@ -1259,6 +1261,9 @@ out: | |||
1259 | } | 1261 | } |
1260 | if (!all_zones_ok) { | 1262 | if (!all_zones_ok) { |
1261 | cond_resched(); | 1263 | cond_resched(); |
1264 | |||
1265 | try_to_freeze(); | ||
1266 | |||
1262 | goto loop_again; | 1267 | goto loop_again; |
1263 | } | 1268 | } |
1264 | 1269 | ||
@@ -1508,7 +1513,6 @@ out: | |||
1508 | } | 1513 | } |
1509 | #endif | 1514 | #endif |
1510 | 1515 | ||
1511 | #ifdef CONFIG_HOTPLUG_CPU | ||
1512 | /* It's optimal to keep kswapds on the same CPUs as their memory, but | 1516 | /* It's optimal to keep kswapds on the same CPUs as their memory, but |
1513 | not required for correctness. So if the last cpu in a node goes | 1517 | not required for correctness. So if the last cpu in a node goes |
1514 | away, we get changed to run anywhere: as the first one comes back, | 1518 | away, we get changed to run anywhere: as the first one comes back, |
@@ -1529,7 +1533,6 @@ static int __devinit cpu_callback(struct notifier_block *nfb, | |||
1529 | } | 1533 | } |
1530 | return NOTIFY_OK; | 1534 | return NOTIFY_OK; |
1531 | } | 1535 | } |
1532 | #endif /* CONFIG_HOTPLUG_CPU */ | ||
1533 | 1536 | ||
1534 | /* | 1537 | /* |
1535 | * This kswapd start function will be called by init and node-hot-add. | 1538 | * This kswapd start function will be called by init and node-hot-add. |