提交 66d92825 编写于 作者: M Mel Gorman 提交者: Linus Torvalds

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 b3b64ebd ("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: b3b64ebd ("mm/page_alloc: do bulk array bounds check after checking populated elements")
Reported-and-tested-by: NDave Jones <davej@codemonkey.org.uk>
Signed-off-by: NMel Gorman <mgorman@techsingularity.net>
Cc: <stable@vger.kernel.org> [5.13+]
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 62fb9874
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册