From 6fa479a64190ef3f6ac8d1e73f430793a0eb0516 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 12 Mar 2021 11:14:42 +0100 Subject: [PATCH] 4.9-stable patches added patches: cifs-return-proper-error-code-in-statfs-2.patch revert-mm-slub-consider-rest-of-partial-list-if-acquire_slab-fails.patch --- ...return-proper-error-code-in-statfs-2.patch | 35 +++++++++++ ...f-partial-list-if-acquire_slab-fails.patch | 58 +++++++++++++++++++ queue-4.9/series | 2 + 3 files changed, 95 insertions(+) create mode 100644 queue-4.9/cifs-return-proper-error-code-in-statfs-2.patch create mode 100644 queue-4.9/revert-mm-slub-consider-rest-of-partial-list-if-acquire_slab-fails.patch diff --git a/queue-4.9/cifs-return-proper-error-code-in-statfs-2.patch b/queue-4.9/cifs-return-proper-error-code-in-statfs-2.patch new file mode 100644 index 00000000000..9c2b831f09f --- /dev/null +++ b/queue-4.9/cifs-return-proper-error-code-in-statfs-2.patch @@ -0,0 +1,35 @@ +From 14302ee3301b3a77b331cc14efb95bf7184c73cc Mon Sep 17 00:00:00 2001 +From: Paulo Alcantara +Date: Mon, 8 Mar 2021 12:00:49 -0300 +Subject: cifs: return proper error code in statfs(2) + +From: Paulo Alcantara + +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) +Reviewed-by: Aurelien Aptel +Reviewed-by: Ronnie Sahlberg +CC: +Signed-off-by: Steve French +Signed-off-by: Greg Kroah-Hartman +--- + fs/cifs/cifsfs.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/fs/cifs/cifsfs.c ++++ b/fs/cifs/cifsfs.c +@@ -208,7 +208,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.9/revert-mm-slub-consider-rest-of-partial-list-if-acquire_slab-fails.patch b/queue-4.9/revert-mm-slub-consider-rest-of-partial-list-if-acquire_slab-fails.patch new file mode 100644 index 00000000000..ff2416baaf4 --- /dev/null +++ b/queue-4.9/revert-mm-slub-consider-rest-of-partial-list-if-acquire_slab-fails.patch @@ -0,0 +1,58 @@ +From 9b1ea29bc0d7b94d420f96a0f4121403efc3dd85 Mon Sep 17 00:00:00 2001 +From: Linus Torvalds +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 + +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 +Link: https://lore.kernel.org/lkml/20210301080404.GF12822@xsang-OptiPlex-9020/ +Cc: Jann Horn +Cc: David Rientjes +Cc: Joonsoo Kim +Acked-by: Christoph Lameter +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman +--- + mm/slub.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/mm/slub.c ++++ b/mm/slub.c +@@ -1833,7 +1833,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.9/series b/queue-4.9/series index 48d32c170f6..a8abde1fad5 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -7,3 +7,5 @@ can-skb-can_skb_set_owner-fix-ref-counting-if-socket-was-closed-before-setting-s can-flexcan-assert-frz-bit-in-flexcan_chip_freeze.patch can-flexcan-enable-rx-fifo-after-frz-halt-valid.patch netfilter-x_tables-gpf-inside-xt_find_revision.patch +cifs-return-proper-error-code-in-statfs-2.patch +revert-mm-slub-consider-rest-of-partial-list-if-acquire_slab-fails.patch -- 2.47.3