]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Dec 2020 09:14:17 +0000 (10:14 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Dec 2020 09:14:17 +0000 (10:14 +0100)
added patches:
mm-swapfile-do-not-sleep-with-a-spin-lock-held.patch

queue-4.14/mm-swapfile-do-not-sleep-with-a-spin-lock-held.patch [new file with mode: 0644]
queue-4.14/powerpc-pseries-pass-msi-affinity-to-irq_create_mapping.patch [deleted file]
queue-4.14/series

diff --git a/queue-4.14/mm-swapfile-do-not-sleep-with-a-spin-lock-held.patch b/queue-4.14/mm-swapfile-do-not-sleep-with-a-spin-lock-held.patch
new file mode 100644 (file)
index 0000000..a07de20
--- /dev/null
@@ -0,0 +1,53 @@
+From b11a76b37a5aa7b07c3e3eeeaae20b25475bddd3 Mon Sep 17 00:00:00 2001
+From: Qian Cai <qcai@redhat.com>
+Date: Sat, 5 Dec 2020 22:14:55 -0800
+Subject: mm/swapfile: do not sleep with a spin lock held
+
+From: Qian Cai <qcai@redhat.com>
+
+commit b11a76b37a5aa7b07c3e3eeeaae20b25475bddd3 upstream.
+
+We can't call kvfree() with a spin lock held, so defer it.  Fixes a
+might_sleep() runtime warning.
+
+Fixes: 873d7bcfd066 ("mm/swapfile.c: use kvzalloc for swap_info_struct allocation")
+Signed-off-by: Qian Cai <qcai@redhat.com>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
+Cc: Hugh Dickins <hughd@google.com>
+Cc: <stable@vger.kernel.org>
+Link: https://lkml.kernel.org/r/20201202151549.10350-1-qcai@redhat.com
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ mm/swapfile.c |    4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/mm/swapfile.c
++++ b/mm/swapfile.c
+@@ -2828,6 +2828,7 @@ late_initcall(max_swapfiles_check);
+ static struct swap_info_struct *alloc_swap_info(void)
+ {
+       struct swap_info_struct *p;
++      struct swap_info_struct *defer = NULL;
+       unsigned int type;
+       int i;
+       int size = sizeof(*p) + nr_node_ids * sizeof(struct plist_node);
+@@ -2857,7 +2858,7 @@ static struct swap_info_struct *alloc_sw
+               smp_wmb();
+               nr_swapfiles++;
+       } else {
+-              kvfree(p);
++              defer = p;
+               p = swap_info[type];
+               /*
+                * Do not memset this entry: a racing procfs swap_next()
+@@ -2870,6 +2871,7 @@ static struct swap_info_struct *alloc_sw
+               plist_node_init(&p->avail_lists[i], 0);
+       p->flags = SWP_USED;
+       spin_unlock(&swap_lock);
++      kvfree(defer);
+       spin_lock_init(&p->lock);
+       spin_lock_init(&p->cont_lock);
diff --git a/queue-4.14/powerpc-pseries-pass-msi-affinity-to-irq_create_mapping.patch b/queue-4.14/powerpc-pseries-pass-msi-affinity-to-irq_create_mapping.patch
deleted file mode 100644 (file)
index 49f2d4d..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-From 9ea69a55b3b9a71cded9726af591949c1138f235 Mon Sep 17 00:00:00 2001
-From: Laurent Vivier <lvivier@redhat.com>
-Date: Thu, 26 Nov 2020 09:28:52 +0100
-Subject: powerpc/pseries: Pass MSI affinity to irq_create_mapping()
-
-From: Laurent Vivier <lvivier@redhat.com>
-
-commit 9ea69a55b3b9a71cded9726af591949c1138f235 upstream.
-
-With virtio multiqueue, normally each queue IRQ is mapped to a CPU.
-
-Commit 0d9f0a52c8b9f ("virtio_scsi: use virtio IRQ affinity") exposed
-an existing shortcoming of the arch code by moving virtio_scsi to
-the automatic IRQ affinity assignment.
-
-The affinity is correctly computed in msi_desc but this is not applied
-to the system IRQs.
-
-It appears the affinity is correctly passed to rtas_setup_msi_irqs() but
-lost at this point and never passed to irq_domain_alloc_descs()
-(see commit 06ee6d571f0e ("genirq: Add affinity hint to irq allocation"))
-because irq_create_mapping() doesn't take an affinity parameter.
-
-Use the new irq_create_mapping_affinity() function, which allows to forward
-the affinity setting from rtas_setup_msi_irqs() to irq_domain_alloc_descs().
-
-With this change, the virtqueues are correctly dispatched between the CPUs
-on pseries.
-
-Fixes: e75eafb9b039 ("genirq/msi: Switch to new irq spreading infrastructure")
-Signed-off-by: Laurent Vivier <lvivier@redhat.com>
-Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-Reviewed-by: Greg Kurz <groug@kaod.org>
-Acked-by: Michael Ellerman <mpe@ellerman.id.au>
-Cc: stable@vger.kernel.org
-Link: https://lore.kernel.org/r/20201126082852.1178497-3-lvivier@redhat.com
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
----
- arch/powerpc/platforms/pseries/msi.c |    3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
---- a/arch/powerpc/platforms/pseries/msi.c
-+++ b/arch/powerpc/platforms/pseries/msi.c
-@@ -462,7 +462,8 @@ again:
-                       return hwirq;
-               }
--              virq = irq_create_mapping(NULL, hwirq);
-+              virq = irq_create_mapping_affinity(NULL, hwirq,
-+                                                 entry->affinity);
-               if (!virq) {
-                       pr_debug("rtas_msi: Failed mapping hwirq %d\n", hwirq);
index 6d59c8f969b6c028527f604718e1facc57aadea6..2cd95f53d26c7091123dc6c68ec77737bf5157dd 100644 (file)
@@ -15,4 +15,4 @@ alsa-hda-realtek-add-new-codec-supported-for-alc897.patch
 alsa-hda-generic-add-option-to-enforce-preferred_dacs-pairs.patch
 ftrace-fix-updating-ftrace_fl_tramp.patch
 cifs-fix-potential-use-after-free-in-cifs_echo_request.patch
-powerpc-pseries-pass-msi-affinity-to-irq_create_mapping.patch
+mm-swapfile-do-not-sleep-with-a-spin-lock-held.patch