commit:     6ac83a2778d17a95e61f53637085d2c776a2f728
Author:     Mike Pagano <mpagano <AT> gentoo <DOT> org>
AuthorDate: Mon Jul  5 14:10:17 2021 +0000
Commit:     Mike Pagano <mpagano <AT> gentoo <DOT> org>
CommitDate: Mon Jul  5 14:10:17 2021 +0000
URL:        https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=6ac83a27

mm/page_alloc: correct retval of pop elemnts if bulk arr is populated

Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>

 0000_README                                        |  4 ++
 1800_mm-page-alloc-fix-ret-val-on-alloc-fail.patch | 50 ++++++++++++++++++++++
 2 files changed, 54 insertions(+)

diff --git a/0000_README b/0000_README
index 2bffadc..0f74eb1 100644
--- a/0000_README
+++ b/0000_README
@@ -55,6 +55,10 @@ Patch:  
2000_BT-Check-key-sizes-only-if-Secure-Simple-Pairing-enabled.patch
 From:   
https://lore.kernel.org/linux-bluetooth/[email protected]/raw
 Desc:   Bluetooth: Check key sizes only when Secure Simple Pairing is enabled. 
See bug #686758
 
+Patch:  1800_mm-page-alloc-fix-ret-val-on-alloc-fail.patch
+From:   
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/patch/?id=ff4b2b4014cbffb3d32b22629252f4dc8616b0fe
+Desc:   mm/page_alloc: correct return value of populated elements if bulk 
array is populated
+
 Patch:  2900_tmp513-Fix-build-issue-by-selecting-CONFIG_REG.patch
 From:   https://bugs.gentoo.org/710790
 Desc:   tmp513 requies REGMAP_I2C to build.  Select it by default in Kconfig. 
See bug #710790. Thanks to Phil Stracchino

diff --git a/1800_mm-page-alloc-fix-ret-val-on-alloc-fail.patch 
b/1800_mm-page-alloc-fix-ret-val-on-alloc-fail.patch
new file mode 100644
index 0000000..2f1b4dc
--- /dev/null
+++ b/1800_mm-page-alloc-fix-ret-val-on-alloc-fail.patch
@@ -0,0 +1,50 @@
+From ff4b2b4014cbffb3d32b22629252f4dc8616b0fe Mon Sep 17 00:00:00 2001
+From: Mel Gorman <[email protected]>
+Date: Mon, 28 Jun 2021 19:33:29 -0700
+Subject: mm/page_alloc: correct return value of populated elements if bulk
+ array is populated
+
+Dave Jones reported the following
+
+       This made it into 5.13 final, and completely breaks NFSD for me
+       (Serving tcp v3 mounts).  Existing mounts on clients hang, as do
+       new mounts from new clients.  Rebooting the server back to rc7
+       everything recovers.
+
+The commit b3b64ebd3822 ("mm/page_alloc: do bulk array bounds check after
+checking populated elements") returns the wrong value if the array is
+already populated which is interpreted as an allocation failure.  Dave
+reported this fixes his problem and it also passed a test running dbench
+over NFS.
+
+Link: https://lkml.kernel.org/r/[email protected]
+Fixes: b3b64ebd3822 ("mm/page_alloc: do bulk array bounds check after checking 
populated elements")
+Signed-off-by: Mel Gorman <[email protected]>
+Reported-by: Dave Jones <[email protected]>
+Tested-by: Dave Jones <[email protected]>
+Cc: Dan Carpenter <[email protected]>
+Cc: Jesper Dangaard Brouer <[email protected]>
+Cc: Vlastimil Babka <[email protected]>
+Cc: <[email protected]> [5.13+]
+Signed-off-by: Andrew Morton <[email protected]>
+Signed-off-by: Linus Torvalds <[email protected]>
+---
+ mm/page_alloc.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/mm/page_alloc.c b/mm/page_alloc.c
+index 5b5c9f5813b9a..2bf03c76504b0 100644
+--- a/mm/page_alloc.c
++++ b/mm/page_alloc.c
+@@ -5058,7 +5058,7 @@ unsigned long __alloc_pages_bulk(gfp_t gfp, int 
preferred_nid,
+ 
+       /* Already populated array? */
+       if (unlikely(page_array && nr_pages - nr_populated == 0))
+-              return 0;
++              return nr_populated;
+ 
+       /* Use the single page allocator for one page. */
+       if (nr_pages - nr_populated == 1)
+-- 
+cgit 1.2.3-1.el7
+

Reply via email to