From: Greg Kroah-Hartman Date: Wed, 8 Sep 2021 12:37:53 +0000 (+0200) Subject: 4.4-stable patches X-Git-Tag: v5.4.145~29 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bce4ff918d66537b5ba8d2f2fbae8eb2fb1a9617;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: mm-kmemleak.c-make-cond_resched-rate-limiting-more-efficient.patch mm-page_alloc-speed-up-the-iteration-of-max_order.patch net-ll_temac-remove-left-over-debug-message.patch powerpc-boot-delete-unneeded-.globl-_zimage_start.patch powerpc-module64-fix-comment-in-r_ppc64_entry-handling.patch s390-disassembler-correct-disassembly-lines-alignment.patch --- diff --git a/queue-4.4/mm-kmemleak.c-make-cond_resched-rate-limiting-more-efficient.patch b/queue-4.4/mm-kmemleak.c-make-cond_resched-rate-limiting-more-efficient.patch new file mode 100644 index 00000000000..188143c6da7 --- /dev/null +++ b/queue-4.4/mm-kmemleak.c-make-cond_resched-rate-limiting-more-efficient.patch @@ -0,0 +1,37 @@ +From 13ab183d138f607d885e995d625e58d47678bf97 Mon Sep 17 00:00:00 2001 +From: Andrew Morton +Date: Thu, 14 Dec 2017 15:32:31 -0800 +Subject: mm/kmemleak.c: make cond_resched() rate-limiting more efficient + +From: Andrew Morton + +commit 13ab183d138f607d885e995d625e58d47678bf97 upstream. + +Commit bde5f6bc68db ("kmemleak: add scheduling point to +kmemleak_scan()") tries to rate-limit the frequency of cond_resched() +calls, but does it in a way which might incur an expensive division +operation in the inner loop. Simplify this. + +Fixes: bde5f6bc68db5 ("kmemleak: add scheduling point to kmemleak_scan()") +Suggested-by: Linus Torvalds +Cc: Yisheng Xie +Cc: Catalin Marinas +Cc: Michal Hocko +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman +--- + mm/kmemleak.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/mm/kmemleak.c ++++ b/mm/kmemleak.c +@@ -1394,7 +1394,7 @@ static void kmemleak_scan(void) + if (page_count(page) == 0) + continue; + scan_block(page, page + 1, NULL); +- if (!(pfn % (MAX_SCAN_SIZE / sizeof(*page)))) ++ if (!(pfn & 63)) + cond_resched(); + } + } diff --git a/queue-4.4/mm-page_alloc-speed-up-the-iteration-of-max_order.patch b/queue-4.4/mm-page_alloc-speed-up-the-iteration-of-max_order.patch new file mode 100644 index 00000000000..ed5901f22cb --- /dev/null +++ b/queue-4.4/mm-page_alloc-speed-up-the-iteration-of-max_order.patch @@ -0,0 +1,73 @@ +From 7ad69832f37e3cea8557db6df7c793905f1135e8 Mon Sep 17 00:00:00 2001 +From: Muchun Song +Date: Mon, 14 Dec 2020 19:11:25 -0800 +Subject: mm/page_alloc: speed up the iteration of max_order + +From: Muchun Song + +commit 7ad69832f37e3cea8557db6df7c793905f1135e8 upstream. + +When we free a page whose order is very close to MAX_ORDER and greater +than pageblock_order, it wastes some CPU cycles to increase max_order to +MAX_ORDER one by one and check the pageblock migratetype of that page +repeatedly especially when MAX_ORDER is much larger than pageblock_order. + +We also should not be checking migratetype of buddy when "order == +MAX_ORDER - 1" as the buddy pfn may be invalid, so adjust the condition. +With the new check, we don't need the max_order check anymore, so we +replace it. + +Also adjust max_order initialization so that it's lower by one than +previously, which makes the code hopefully more clear. + +Link: https://lkml.kernel.org/r/20201204155109.55451-1-songmuchun@bytedance.com +Fixes: d9dddbf55667 ("mm/page_alloc: prevent merging between isolated and other pageblocks") +Signed-off-by: Muchun Song +Acked-by: Vlastimil Babka +Reviewed-by: Oscar Salvador +Reviewed-by: David Hildenbrand +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman +--- + mm/page_alloc.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- a/mm/page_alloc.c ++++ b/mm/page_alloc.c +@@ -700,7 +700,7 @@ static inline void __free_one_page(struc + struct page *buddy; + unsigned int max_order; + +- max_order = min_t(unsigned int, MAX_ORDER, pageblock_order + 1); ++ max_order = min_t(unsigned int, MAX_ORDER - 1, pageblock_order); + + VM_BUG_ON(!zone_is_initialized(zone)); + VM_BUG_ON_PAGE(page->flags & PAGE_FLAGS_CHECK_AT_PREP, page); +@@ -715,7 +715,7 @@ static inline void __free_one_page(struc + VM_BUG_ON_PAGE(bad_range(zone, page), page); + + continue_merging: +- while (order < max_order - 1) { ++ while (order < max_order) { + buddy_idx = __find_buddy_index(page_idx, order); + buddy = page + (buddy_idx - page_idx); + if (!page_is_buddy(page, buddy, order)) +@@ -736,7 +736,7 @@ continue_merging: + page_idx = combined_idx; + order++; + } +- if (max_order < MAX_ORDER) { ++ if (order < MAX_ORDER - 1) { + /* If we are here, it means order is >= pageblock_order. + * We want to prevent merge between freepages on isolate + * pageblock and normal pageblock. Without this, pageblock +@@ -757,7 +757,7 @@ continue_merging: + is_migrate_isolate(buddy_mt))) + goto done_merging; + } +- max_order++; ++ max_order = order + 1; + goto continue_merging; + } + diff --git a/queue-4.4/net-ll_temac-remove-left-over-debug-message.patch b/queue-4.4/net-ll_temac-remove-left-over-debug-message.patch new file mode 100644 index 00000000000..df2b3cf0ff8 --- /dev/null +++ b/queue-4.4/net-ll_temac-remove-left-over-debug-message.patch @@ -0,0 +1,31 @@ +From ce03b94ba682a67e8233c9ee3066071656ded58f Mon Sep 17 00:00:00 2001 +From: Esben Haabendal +Date: Mon, 21 Jun 2021 10:20:08 +0200 +Subject: net: ll_temac: Remove left-over debug message + +From: Esben Haabendal + +commit ce03b94ba682a67e8233c9ee3066071656ded58f upstream. + +Fixes: f63963411942 ("net: ll_temac: Avoid ndo_start_xmit returning NETDEV_TX_BUSY") +Signed-off-by: Esben Haabendal +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/xilinx/ll_temac_main.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +--- a/drivers/net/ethernet/xilinx/ll_temac_main.c ++++ b/drivers/net/ethernet/xilinx/ll_temac_main.c +@@ -735,10 +735,8 @@ temac_start_xmit(struct sk_buff *skb, st + /* Kick off the transfer */ + lp->dma_out(lp, TX_TAILDESC_PTR, tail_p); /* DMA start */ + +- if (temac_check_tx_bd_space(lp, MAX_SKB_FRAGS + 1)) { +- netdev_info(ndev, "%s -> netif_stop_queue\n", __func__); ++ if (temac_check_tx_bd_space(lp, MAX_SKB_FRAGS + 1)) + netif_stop_queue(ndev); +- } + + return NETDEV_TX_OK; + } diff --git a/queue-4.4/powerpc-boot-delete-unneeded-.globl-_zimage_start.patch b/queue-4.4/powerpc-boot-delete-unneeded-.globl-_zimage_start.patch new file mode 100644 index 00000000000..f9c26681032 --- /dev/null +++ b/queue-4.4/powerpc-boot-delete-unneeded-.globl-_zimage_start.patch @@ -0,0 +1,38 @@ +From 968339fad422a58312f67718691b717dac45c399 Mon Sep 17 00:00:00 2001 +From: Fangrui Song +Date: Wed, 25 Mar 2020 09:42:57 -0700 +Subject: powerpc/boot: Delete unneeded .globl _zimage_start + +From: Fangrui Song + +commit 968339fad422a58312f67718691b717dac45c399 upstream. + +.globl sets the symbol binding to STB_GLOBAL while .weak sets the +binding to STB_WEAK. GNU as let .weak override .globl since +binutils-gdb 5ca547dc2399a0a5d9f20626d4bf5547c3ccfddd (1996). Clang +integrated assembler let the last win but it may error in the future. + +Since it is a convention that only one binding directive is used, just +delete .globl. + +Fixes: ee9d21b3b358 ("powerpc/boot: Ensure _zimage_start is a weak symbol") +Signed-off-by: Fangrui Song +Signed-off-by: Michael Ellerman +Link: https://lore.kernel.org/r/20200325164257.170229-1-maskray@google.com +Signed-off-by: Greg Kroah-Hartman +--- + arch/powerpc/boot/crt0.S | 3 --- + 1 file changed, 3 deletions(-) + +--- a/arch/powerpc/boot/crt0.S ++++ b/arch/powerpc/boot/crt0.S +@@ -49,9 +49,6 @@ p_end: .long _end + p_pstack: .long _platform_stack_top + #endif + +- .globl _zimage_start +- /* Clang appears to require the .weak directive to be after the symbol +- * is defined. See https://bugs.llvm.org/show_bug.cgi?id=38921 */ + .weak _zimage_start + _zimage_start: + .globl _zimage_start_lib diff --git a/queue-4.4/powerpc-module64-fix-comment-in-r_ppc64_entry-handling.patch b/queue-4.4/powerpc-module64-fix-comment-in-r_ppc64_entry-handling.patch new file mode 100644 index 00000000000..05b0da8ee8d --- /dev/null +++ b/queue-4.4/powerpc-module64-fix-comment-in-r_ppc64_entry-handling.patch @@ -0,0 +1,30 @@ +From 2fb0a2c989837c976b68233496bbaefb47cd3d6f Mon Sep 17 00:00:00 2001 +From: Michael Ellerman +Date: Sat, 6 Jul 2019 00:18:53 +1000 +Subject: powerpc/module64: Fix comment in R_PPC64_ENTRY handling + +From: Michael Ellerman + +commit 2fb0a2c989837c976b68233496bbaefb47cd3d6f upstream. + +The comment here is wrong, the addi reads from r2 not r12. The code is +correct, 0x38420000 = addi r2,r2,0. + +Fixes: a61674bdfc7c ("powerpc/module: Handle R_PPC64_ENTRY relocations") +Signed-off-by: Michael Ellerman +Signed-off-by: Greg Kroah-Hartman +--- + arch/powerpc/kernel/module_64.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/powerpc/kernel/module_64.c ++++ b/arch/powerpc/kernel/module_64.c +@@ -662,7 +662,7 @@ int apply_relocate_add(Elf64_Shdr *sechd + /* + * If found, replace it with: + * addis r2, r12, (.TOC.-func)@ha +- * addi r2, r12, (.TOC.-func)@l ++ * addi r2, r2, (.TOC.-func)@l + */ + ((uint32_t *)location)[0] = 0x3c4c0000 + PPC_HA(value); + ((uint32_t *)location)[1] = 0x38420000 + PPC_LO(value); diff --git a/queue-4.4/s390-disassembler-correct-disassembly-lines-alignment.patch b/queue-4.4/s390-disassembler-correct-disassembly-lines-alignment.patch new file mode 100644 index 00000000000..fcba00a9906 --- /dev/null +++ b/queue-4.4/s390-disassembler-correct-disassembly-lines-alignment.patch @@ -0,0 +1,36 @@ +From 26f4e759ef9b8a2bab1823d692ed6d56d40b66e3 Mon Sep 17 00:00:00 2001 +From: Vasily Gorbik +Date: Thu, 23 Nov 2017 10:50:23 +0100 +Subject: s390/disassembler: correct disassembly lines alignment + +From: Vasily Gorbik + +commit 26f4e759ef9b8a2bab1823d692ed6d56d40b66e3 upstream. + +176.718956 Krnl Code: 00000000004d38b0: a54c0018 llihh %r4,24 +176.718956 00000000004d38b4: b9080014 agr %r1,%r4 + ^ +Using a tab to align disassembly lines which follow the first line with +"Krnl Code: " doesn't always work, e.g. if there is a prefix (timestamp +or syslog prefix) which is not 8 chars aligned. Go back to alignment +with spaces. + +Fixes: b192571d1ae3 ("s390/disassembler: increase show_code buffer size") +Signed-off-by: Vasily Gorbik +Signed-off-by: Martin Schwidefsky +Signed-off-by: Greg Kroah-Hartman +--- + arch/s390/kernel/dis.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/s390/kernel/dis.c ++++ b/arch/s390/kernel/dis.c +@@ -2025,7 +2025,7 @@ void show_code(struct pt_regs *regs) + start += opsize; + printk(buffer); + ptr = buffer; +- ptr += sprintf(ptr, "\n\t "); ++ ptr += sprintf(ptr, "\n "); + hops++; + } + printk("\n"); diff --git a/queue-4.4/series b/queue-4.4/series index aeef3f332d8..595702eaeae 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -17,3 +17,9 @@ usb-serial-mos7720-improve-oom-handling-in-read_mos_reg.patch pm-wakeirq-enable-dedicated-wakeirq-for-suspend.patch tc358743-fix-register-i2c_rd-wr-function-fix.patch ipv4-icmp-l3mdev-perform-icmp-error-route-lookup-on-source-device-routing-table-v2.patch +s390-disassembler-correct-disassembly-lines-alignment.patch +mm-kmemleak.c-make-cond_resched-rate-limiting-more-efficient.patch +powerpc-module64-fix-comment-in-r_ppc64_entry-handling.patch +powerpc-boot-delete-unneeded-.globl-_zimage_start.patch +net-ll_temac-remove-left-over-debug-message.patch +mm-page_alloc-speed-up-the-iteration-of-max_order.patch