aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2019-03-05 15:24:43 +0100
committerJiri Kosina <jkosina@suse.cz>2019-03-05 15:24:43 +0100
commit2c2e5bb97544198a62e4edbf6aca5dd201979564 (patch)
treeffb927ea311d86aeee3a0ef561d6218280c038cb /mm/page_alloc.c
parentHID: roccat: Mark expected switch fall-through (diff)
parentHID: hid-asus: Add BT keyboard dock battery monitoring support (diff)
downloadwireguard-linux-2c2e5bb97544198a62e4edbf6aca5dd201979564.tar.xz
wireguard-linux-2c2e5bb97544198a62e4edbf6aca5dd201979564.zip
Merge branch 'for-5.1/hid-asus' into for-linus
Asus Transbook T100CHI and T90CHI support from NOGUCHI Hiroshi
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r--mm/page_alloc.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index cde5dac6229a..35fdde041f5c 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -2214,7 +2214,7 @@ static void steal_suitable_fallback(struct zone *zone, struct page *page,
*/
boost_watermark(zone);
if (alloc_flags & ALLOC_KSWAPD)
- wakeup_kswapd(zone, 0, 0, zone_idx(zone));
+ set_bit(ZONE_BOOSTED_WATERMARK, &zone->flags);
/* We are not allowed to try stealing from the whole block */
if (!whole_block)
@@ -3102,6 +3102,12 @@ struct page *rmqueue(struct zone *preferred_zone,
local_irq_restore(flags);
out:
+ /* Separate test+clear to avoid unnecessary atomics */
+ if (test_bit(ZONE_BOOSTED_WATERMARK, &zone->flags)) {
+ clear_bit(ZONE_BOOSTED_WATERMARK, &zone->flags);
+ wakeup_kswapd(zone, 0, 0, zone_idx(zone));
+ }
+
VM_BUG_ON_PAGE(page && bad_range(zone, page), page);
return page;
@@ -5695,18 +5701,6 @@ void __meminit memmap_init_zone(unsigned long size, int nid, unsigned long zone,
cond_resched();
}
}
-#ifdef CONFIG_SPARSEMEM
- /*
- * If the zone does not span the rest of the section then
- * we should at least initialize those pages. Otherwise we
- * could blow up on a poisoned page in some paths which depend
- * on full sections being initialized (e.g. memory hotplug).
- */
- while (end_pfn % PAGES_PER_SECTION) {
- __init_single_page(pfn_to_page(end_pfn), end_pfn, zone, nid);
- end_pfn++;
- }
-#endif
}
#ifdef CONFIG_ZONE_DEVICE