]> git.proxmox.com Git - mirror_ubuntu-impish-kernel.git/commitdiff
mm/page_alloc: Correct return value of populated elements if bulk array is populated
authorMel Gorman <mgorman@techsingularity.net>
Mon, 28 Jun 2021 15:02:19 +0000 (16:02 +0100)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 29 Jun 2021 05:49:53 +0000 (07:49 +0200)
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.

Fixes: b3b64ebd3822 ("mm/page_alloc: do bulk array bounds check after checking populated elements")
Reported-and-tested-by: Dave Jones <davej@codemonkey.org.uk>
Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
Cc: <stable@vger.kernel.org> [5.13+]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 66d9282523b3228183b14d9f812872dd2620704d)
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
mm/page_alloc.c

index 15577fcd9f50dbf30f271f54f062c5b3d468b64a..0027dffeaf192e9bc4f01856eee27fb24cdaaf28 100644 (file)
@@ -5045,7 +5045,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)