summaryrefslogtreecommitdiffstats
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2023-04-18 14:53:49 -0700
committerAndrew Morton <akpm@linux-foundation.org>2023-04-18 14:53:49 -0700
commitf8f238ffe5e96a924a2ddbbaa872231fbf2c0d7b (patch)
tree6d1a2fc13d6d1e0737888bd3a7a8387097fbeb05 /mm/page_alloc.c
parente492cd61b986590a45c674ede7dd1c4dbf94cf24 (diff)
parentef832747a82dfbc22a3702219cc716f449b24e4a (diff)
downloadlinux-f8f238ffe5e96a924a2ddbbaa872231fbf2c0d7b.tar.gz
linux-f8f238ffe5e96a924a2ddbbaa872231fbf2c0d7b.tar.bz2
linux-f8f238ffe5e96a924a2ddbbaa872231fbf2c0d7b.zip
sync mm-stable with mm-hotfixes-stable to pick up depended-upon upstream changes
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r--mm/page_alloc.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index d0eb280ec7e4..9c325e5e6b15 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -5796,7 +5796,21 @@ static void __build_all_zonelists(void *data)
int nid;
int __maybe_unused cpu;
pg_data_t *self = data;
+ unsigned long flags;
+ /*
+ * Explicitly disable this CPU's interrupts before taking seqlock
+ * to prevent any IRQ handler from calling into the page allocator
+ * (e.g. GFP_ATOMIC) that could hit zonelist_iter_begin and livelock.
+ */
+ local_irq_save(flags);
+ /*
+ * Explicitly disable this CPU's synchronous printk() before taking
+ * seqlock to prevent any printk() from trying to hold port->lock, for
+ * tty_insert_flip_string_and_push_buffer() on other CPU might be
+ * calling kmalloc(GFP_ATOMIC | __GFP_NOWARN) with port->lock held.
+ */
+ printk_deferred_enter();
write_seqlock(&zonelist_update_seq);
#ifdef CONFIG_NUMA
@@ -5835,6 +5849,8 @@ static void __build_all_zonelists(void *data)
}
write_sequnlock(&zonelist_update_seq);
+ printk_deferred_exit();
+ local_irq_restore(flags);
}
static noinline void __init
@@ -6884,6 +6900,9 @@ static bool pfn_range_valid_contig(struct zone *z, unsigned long start_pfn,
if (PageReserved(page))
return false;
+
+ if (PageHuge(page))
+ return false;
}
return true;
}