summaryrefslogtreecommitdiffstats
path: root/debian/patches-rt/0319-Revert-mm-page_alloc-fix-potential-deadlock-on-zonel.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches-rt/0319-Revert-mm-page_alloc-fix-potential-deadlock-on-zonel.patch')
-rw-r--r--debian/patches-rt/0319-Revert-mm-page_alloc-fix-potential-deadlock-on-zonel.patch63
1 files changed, 63 insertions, 0 deletions
diff --git a/debian/patches-rt/0319-Revert-mm-page_alloc-fix-potential-deadlock-on-zonel.patch b/debian/patches-rt/0319-Revert-mm-page_alloc-fix-potential-deadlock-on-zonel.patch
new file mode 100644
index 000000000..1872b2fc8
--- /dev/null
+++ b/debian/patches-rt/0319-Revert-mm-page_alloc-fix-potential-deadlock-on-zonel.patch
@@ -0,0 +1,63 @@
+From 59fc9fa59a8a6eaa1456e7a3035b10152a9e6d94 Mon Sep 17 00:00:00 2001
+From: "Luis Claudio R. Goncalves" <lgoncalv@redhat.com>
+Date: Thu, 8 Jun 2023 19:47:25 -0300
+Subject: [PATCH 319/323] Revert "mm/page_alloc: fix potential deadlock on
+ zonelist_update_seqseqlock"
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.204-rt100.tar.xz
+
+This reverts commit a992c387b41186ab968fd176ca26b432b05c53ec.
+
+The support for deferred printing was removed in v5.10-rc1-rt1 by commit
+9153e3c5cb0c9 ("printk: remove deferred printing") because:
+
+ Since printing occurs either atomically or from the printing
+ kthread, there is no need for any deferring or tracking possible
+ recursion paths. Remove all printk context tracking.
+
+Also, disabling interrupts in __build_all_zonelists() should produce warnings
+once that code path is hit.
+
+Fixes: a992c387b4118 ("mm/page_alloc: fix potential deadlock on zonelist_update_seq seqlock")
+Signed-off-by: Luis Claudio R. Goncalves <lgoncalv@redhat.com>
+---
+ mm/page_alloc.c | 16 ----------------
+ 1 file changed, 16 deletions(-)
+
+diff --git a/mm/page_alloc.c b/mm/page_alloc.c
+index c5eb7d6844ae..39d1782b398f 100644
+--- a/mm/page_alloc.c
++++ b/mm/page_alloc.c
+@@ -6043,21 +6043,7 @@ 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
+@@ -6092,8 +6078,6 @@ static void __build_all_zonelists(void *data)
+ }
+
+ write_sequnlock(&zonelist_update_seq);
+- printk_deferred_exit();
+- local_irq_restore(flags);
+ }
+
+ static noinline void __init
+--
+2.43.0
+