From: Greg Kroah-Hartman Date: Wed, 9 Dec 2020 09:14:17 +0000 (+0100) Subject: 4.14-stable patches X-Git-Tag: v5.9.14~40 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=649fd1987433b5daeabcce917b5faec1357a8a41;p=thirdparty%2Fkernel%2Fstable-queue.git 4.14-stable patches added patches: mm-swapfile-do-not-sleep-with-a-spin-lock-held.patch --- 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 index 00000000000..a07de2033da --- /dev/null +++ b/queue-4.14/mm-swapfile-do-not-sleep-with-a-spin-lock-held.patch @@ -0,0 +1,53 @@ +From b11a76b37a5aa7b07c3e3eeeaae20b25475bddd3 Mon Sep 17 00:00:00 2001 +From: Qian Cai +Date: Sat, 5 Dec 2020 22:14:55 -0800 +Subject: mm/swapfile: do not sleep with a spin lock held + +From: Qian Cai + +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 +Signed-off-by: Andrew Morton +Reviewed-by: Andrew Morton +Cc: Hugh Dickins +Cc: +Link: https://lkml.kernel.org/r/20201202151549.10350-1-qcai@redhat.com +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + 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 index 49f2d4d9395..00000000000 --- a/queue-4.14/powerpc-pseries-pass-msi-affinity-to-irq_create_mapping.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 9ea69a55b3b9a71cded9726af591949c1138f235 Mon Sep 17 00:00:00 2001 -From: Laurent Vivier -Date: Thu, 26 Nov 2020 09:28:52 +0100 -Subject: powerpc/pseries: Pass MSI affinity to irq_create_mapping() - -From: Laurent Vivier - -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 -Signed-off-by: Thomas Gleixner -Reviewed-by: Greg Kurz -Acked-by: Michael Ellerman -Cc: stable@vger.kernel.org -Link: https://lore.kernel.org/r/20201126082852.1178497-3-lvivier@redhat.com -Signed-off-by: Greg Kroah-Hartman - ---- - 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); diff --git a/queue-4.14/series b/queue-4.14/series index 6d59c8f969b..2cd95f53d26 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -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