]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 12 Mar 2021 10:15:14 +0000 (11:15 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 12 Mar 2021 10:15:14 +0000 (11:15 +0100)
added patches:
cifs-return-proper-error-code-in-statfs-2.patch
revert-mm-slub-consider-rest-of-partial-list-if-acquire_slab-fails.patch
scripts-recordmcount.-c-pl-support-ffunction-sections-.text.-section-names.patch

queue-4.19/cifs-return-proper-error-code-in-statfs-2.patch [new file with mode: 0644]
queue-4.19/revert-mm-slub-consider-rest-of-partial-list-if-acquire_slab-fails.patch [new file with mode: 0644]
queue-4.19/scripts-recordmcount.-c-pl-support-ffunction-sections-.text.-section-names.patch [new file with mode: 0644]
queue-4.19/series

diff --git a/queue-4.19/cifs-return-proper-error-code-in-statfs-2.patch b/queue-4.19/cifs-return-proper-error-code-in-statfs-2.patch
new file mode 100644 (file)
index 0000000..8451a23
--- /dev/null
@@ -0,0 +1,35 @@
+From 14302ee3301b3a77b331cc14efb95bf7184c73cc Mon Sep 17 00:00:00 2001
+From: Paulo Alcantara <pc@cjr.nz>
+Date: Mon, 8 Mar 2021 12:00:49 -0300
+Subject: cifs: return proper error code in statfs(2)
+
+From: Paulo Alcantara <pc@cjr.nz>
+
+commit 14302ee3301b3a77b331cc14efb95bf7184c73cc upstream.
+
+In cifs_statfs(), if server->ops->queryfs is not NULL, then we should
+use its return value rather than always returning 0.  Instead, use rc
+variable as it is properly set to 0 in case there is no
+server->ops->queryfs.
+
+Signed-off-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
+Reviewed-by: Aurelien Aptel <aaptel@suse.com>
+Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
+CC: <stable@vger.kernel.org>
+Signed-off-by: Steve French <stfrench@microsoft.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/cifs/cifsfs.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/fs/cifs/cifsfs.c
++++ b/fs/cifs/cifsfs.c
+@@ -229,7 +229,7 @@ cifs_statfs(struct dentry *dentry, struc
+               rc = server->ops->queryfs(xid, tcon, buf);
+       free_xid(xid);
+-      return 0;
++      return rc;
+ }
+ static long cifs_fallocate(struct file *file, int mode, loff_t off, loff_t len)
diff --git a/queue-4.19/revert-mm-slub-consider-rest-of-partial-list-if-acquire_slab-fails.patch b/queue-4.19/revert-mm-slub-consider-rest-of-partial-list-if-acquire_slab-fails.patch
new file mode 100644 (file)
index 0000000..927a1d8
--- /dev/null
@@ -0,0 +1,58 @@
+From 9b1ea29bc0d7b94d420f96a0f4121403efc3dd85 Mon Sep 17 00:00:00 2001
+From: Linus Torvalds <torvalds@linux-foundation.org>
+Date: Wed, 10 Mar 2021 10:18:04 -0800
+Subject: Revert "mm, slub: consider rest of partial list if acquire_slab() fails"
+
+From: Linus Torvalds <torvalds@linux-foundation.org>
+
+commit 9b1ea29bc0d7b94d420f96a0f4121403efc3dd85 upstream.
+
+This reverts commit 8ff60eb052eeba95cfb3efe16b08c9199f8121cf.
+
+The kernel test robot reports a huge performance regression due to the
+commit, and the reason seems fairly straightforward: when there is
+contention on the page list (which is what causes acquire_slab() to
+fail), we do _not_ want to just loop and try again, because that will
+transfer the contention to the 'n->list_lock' spinlock we hold, and
+just make things even worse.
+
+This is admittedly likely a problem only on big machines - the kernel
+test robot report comes from a 96-thread dual socket Intel Xeon Gold
+6252 setup, but the regression there really is quite noticeable:
+
+   -47.9% regression of stress-ng.rawpkt.ops_per_sec
+
+and the commit that was marked as being fixed (7ced37197196: "slub:
+Acquire_slab() avoid loop") actually did the loop exit early very
+intentionally (the hint being that "avoid loop" part of that commit
+message), exactly to avoid this issue.
+
+The correct thing to do may be to pick some kind of reasonable middle
+ground: instead of breaking out of the loop on the very first sign of
+contention, or trying over and over and over again, the right thing may
+be to re-try _once_, and then give up on the second failure (or pick
+your favorite value for "once"..).
+
+Reported-by: kernel test robot <oliver.sang@intel.com>
+Link: https://lore.kernel.org/lkml/20210301080404.GF12822@xsang-OptiPlex-9020/
+Cc: Jann Horn <jannh@google.com>
+Cc: David Rientjes <rientjes@google.com>
+Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
+Acked-by: Christoph Lameter <cl@linux.com>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ mm/slub.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/mm/slub.c
++++ b/mm/slub.c
+@@ -1830,7 +1830,7 @@ static void *get_partial_node(struct kme
+               t = acquire_slab(s, n, page, object == NULL, &objects);
+               if (!t)
+-                      continue; /* cmpxchg raced */
++                      break;
+               available += objects;
+               if (!object) {
diff --git a/queue-4.19/scripts-recordmcount.-c-pl-support-ffunction-sections-.text.-section-names.patch b/queue-4.19/scripts-recordmcount.-c-pl-support-ffunction-sections-.text.-section-names.patch
new file mode 100644 (file)
index 0000000..dab1328
--- /dev/null
@@ -0,0 +1,82 @@
+From 9c8e2f6d3d361439cc6744a094f1c15681b55269 Mon Sep 17 00:00:00 2001
+From: Joe Lawrence <joe.lawrence@redhat.com>
+Date: Tue, 20 Nov 2018 15:19:18 -0500
+Subject: scripts/recordmcount.{c,pl}: support -ffunction-sections .text.* section names
+
+From: Joe Lawrence <joe.lawrence@redhat.com>
+
+commit 9c8e2f6d3d361439cc6744a094f1c15681b55269 upstream.
+
+When building with -ffunction-sections, the compiler will place each
+function into its own ELF section, prefixed with ".text".  For example,
+a simple test module with functions test_module_do_work() and
+test_module_wq_func():
+
+  % objdump --section-headers test_module.o | awk '/\.text/{print $2}'
+  .text
+  .text.test_module_do_work
+  .text.test_module_wq_func
+  .init.text
+  .exit.text
+
+Adjust the recordmcount scripts to look for ".text" as a section name
+prefix.  This will ensure that those functions will be included in the
+__mcount_loc relocations:
+
+  % objdump --reloc --section __mcount_loc test_module.o
+  OFFSET           TYPE              VALUE
+  0000000000000000 R_X86_64_64       .text.test_module_do_work
+  0000000000000008 R_X86_64_64       .text.test_module_wq_func
+  0000000000000010 R_X86_64_64       .init.text
+
+Link: http://lkml.kernel.org/r/1542745158-25392-2-git-send-email-joe.lawrence@redhat.com
+
+Signed-off-by: Joe Lawrence <joe.lawrence@redhat.com>
+Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
+Cc: Manoj Gupta <manojgupta@google.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ scripts/recordmcount.c  |    2 +-
+ scripts/recordmcount.pl |   13 +++++++++++++
+ 2 files changed, 14 insertions(+), 1 deletion(-)
+
+--- a/scripts/recordmcount.c
++++ b/scripts/recordmcount.c
+@@ -401,7 +401,7 @@ static uint32_t (*w2)(uint16_t);
+ static int
+ is_mcounted_section_name(char const *const txtname)
+ {
+-      return strcmp(".text",           txtname) == 0 ||
++      return strncmp(".text",          txtname, 5) == 0 ||
+               strcmp(".init.text",     txtname) == 0 ||
+               strcmp(".ref.text",      txtname) == 0 ||
+               strcmp(".sched.text",    txtname) == 0 ||
+--- a/scripts/recordmcount.pl
++++ b/scripts/recordmcount.pl
+@@ -142,6 +142,11 @@ my %text_sections = (
+      ".text.unlikely" => 1,
+ );
++# Acceptable section-prefixes to record.
++my %text_section_prefixes = (
++     ".text." => 1,
++);
++
+ # Note: we are nice to C-programmers here, thus we skip the '||='-idiom.
+ $objdump = 'objdump' if (!$objdump);
+ $objcopy = 'objcopy' if (!$objcopy);
+@@ -523,6 +528,14 @@ while (<IN>) {
+       # Only record text sections that we know are safe
+       $read_function = defined($text_sections{$1});
++      if (!$read_function) {
++          foreach my $prefix (keys %text_section_prefixes) {
++              if (substr($1, 0, length $prefix) eq $prefix) {
++                  $read_function = 1;
++                  last;
++              }
++          }
++      }
+       # print out any recorded offsets
+       update_funcs();
index 02a7c7db7e88e084017f74d6c9f88191bf20b115..9806656e3013f916665b998a05162a2b03491850 100644 (file)
@@ -11,5 +11,8 @@ mt76-dma-do-not-report-truncated-frames-to-mac80211.patch
 tcp-annotate-tp-copied_seq-lockless-reads.patch
 tcp-annotate-tp-write_seq-lockless-reads.patch
 tcp-add-sanity-tests-to-tcp_queue_seq.patch
+cifs-return-proper-error-code-in-statfs-2.patch
+scripts-recordmcount.-c-pl-support-ffunction-sections-.text.-section-names.patch
+revert-mm-slub-consider-rest-of-partial-list-if-acquire_slab-fails.patch
 net-check-if-protocol-extracted-by-virtio_net_hdr_set_proto-is-correct.patch
 net-avoid-infinite-loop-in-mpls_gso_segment-when-mpls_hlen-0.patch