All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] mm/page_alloc: correct return value when failing at preparing
@ 2021-07-09 10:28 Yanfei Xu
  2021-07-09 10:28 ` [PATCH 2/2] mm/page_alloc: avoid counting event if no successful allocation Yanfei Xu
  2021-07-09 12:22 ` [PATCH 1/2] mm/page_alloc: correct return value when failing at preparing Mel Gorman
  0 siblings, 2 replies; 7+ messages in thread
From: Yanfei Xu @ 2021-07-09 10:28 UTC (permalink / raw)
  To: akpm, mgorman; +Cc: linux-mm, linux-kernel

If the array passed in is already partially populated, we should
return "nr_populated" even failing at preparing arguments stage.

Signed-off-by: Yanfei Xu <yanfei.xu@windriver.com>
---
 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 d6e94cc8066c..e9fd57ca4c1c 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -5254,7 +5254,7 @@ unsigned long __alloc_pages_bulk(gfp_t gfp, int preferred_nid,
 	gfp &= gfp_allowed_mask;
 	alloc_gfp = gfp;
 	if (!prepare_alloc_pages(gfp, 0, preferred_nid, nodemask, &ac, &alloc_gfp, &alloc_flags))
-		return 0;
+		return nr_populated;
 	gfp = alloc_gfp;
 
 	/* Find an allowed local zone that meets the low watermark. */
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-07-13 12:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-09 10:28 [PATCH 1/2] mm/page_alloc: correct return value when failing at preparing Yanfei Xu
2021-07-09 10:28 ` [PATCH 2/2] mm/page_alloc: avoid counting event if no successful allocation Yanfei Xu
2021-07-09 12:26   ` Mel Gorman
2021-07-10 11:31     ` Xu, Yanfei
2021-07-09 12:22 ` [PATCH 1/2] mm/page_alloc: correct return value when failing at preparing Mel Gorman
2021-07-10  6:58   ` Xu, Yanfei
2021-07-13 12:14     ` Mel Gorman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.