Message ID | 20210709102855.55058-1-yanfei.xu@windriver.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [1/2] mm/page_alloc: correct return value when failing at preparing | expand |
On Fri, Jul 09, 2021 at 06:28:54PM +0800, Yanfei Xu wrote: > 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> ff4b2b4014cb ("mm/page_alloc: correct return value of populated elements if bulk array is populated")
On 7/9/21 8:22 PM, Mel Gorman wrote: > [Please note: This e-mail is from an EXTERNAL e-mail address] > > On Fri, Jul 09, 2021 at 06:28:54PM +0800, Yanfei Xu wrote: >> 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> > > ff4b2b4014cb ("mm/page_alloc: correct return value of populated elements if bulk array is populated") > This is a different return location from you posted. > -- > Mel Gorman > SUSE Labs >
On Sat, Jul 10, 2021 at 02:58:02PM +0800, Xu, Yanfei wrote: > > > On 7/9/21 8:22 PM, Mel Gorman wrote: > > [Please note: This e-mail is from an EXTERNAL e-mail address] > > > > On Fri, Jul 09, 2021 at 06:28:54PM +0800, Yanfei Xu wrote: > > > 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> > > > > ff4b2b4014cb ("mm/page_alloc: correct return value of populated elements if bulk array is populated") > > > > This is a different return location from you posted. > You're right, I'll pick this up and stage it with a series of patches that should have gone in during the merge window but were too late. Thanks.
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. */
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(-)