Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3990679pxv; Tue, 13 Jul 2021 08:23:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6fuBVe9CMO0cIcEkPXYp+FpBNpBjuKw6i1NCp43fhU+WS7CGxS5KLJGcZgphUPnqj8di5 X-Received: by 2002:a05:6402:1bd0:: with SMTP id ch16mr6384068edb.215.1626189793165; Tue, 13 Jul 2021 08:23:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626189793; cv=none; d=google.com; s=arc-20160816; b=jVX+tW4D7hOgZ1aFfPA8UYscGuvGWZkDjhSbElmdBuPAo4Frh5J/D8G/+cuHXM4Apk ZXyV6WWXC68JlIIOtXRclPvCKgqEbYi4x4RhxuYKPzsHWa+IKiWNnJBi/ZJAdO3lhN4m sorNn/xiTxA27aCebTdTYxuvblZDbu72DGE3JHkpG2uvuFkF3cR+ecVHKgYGDP2czBBs XuYPV4QbSTKgkkoGrTNwRwfh50m/cPCD16y+EU7JB54rI7bZDtYVsaAs6wDL1c96kqvw vSxSHeA1nxyLS4xfiWbQcx3mdHhh0817u99ehWPCX8nIAk3U0sB5o+/qH6VCfHJ5sEun 6yvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=1kbgX/lFltqv1Y82lJqeoGqHzU1W1sLR8Lb6mjVa/+k=; b=DzVBjUrvbyR3qchSaxMR/WeE/ey74MTraW38z8cIPTkZj+IfFOxwocX9JlM6nyVInI RT89pdDast31FM1QjXOydScvHJ6YwcjCgp64CdLYw/leNn7Smc54wjNvYPAc7wNvt3tW APY8qKMVhDu8zZfsej8RVktiNdi3cYWo+KG+Lus/bi1+H/n0T1SAKCTiW2fhkJ0XdbP9 NCQ2QRWEdP82DEfCpBP8RPqX41G8roeOu8mgC75vhy+jVV+Vhwf3UU9VA5m/vLHII24c 0xxmFZgPI07wVVwjXOXGSKv7lk5bjCDF8lx//rxOU32o98wy/2VUgwKFVofof/YxDTrk OHuQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e5si19658459ejm.62.2021.07.13.08.22.46; Tue, 13 Jul 2021 08:23:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237075AbhGMPX5 (ORCPT + 99 others); Tue, 13 Jul 2021 11:23:57 -0400 Received: from outbound-smtp22.blacknight.com ([81.17.249.190]:56887 "EHLO outbound-smtp22.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236901AbhGMPXw (ORCPT ); Tue, 13 Jul 2021 11:23:52 -0400 Received: from mail.blacknight.com (pemlinmail01.blacknight.ie [81.17.254.10]) by outbound-smtp22.blacknight.com (Postfix) with ESMTPS id 762B9148026 for ; Tue, 13 Jul 2021 16:21:01 +0100 (IST) Received: (qmail 14864 invoked from network); 13 Jul 2021 15:21:01 -0000 Received: from unknown (HELO stampy.112glenside.lan) (mgorman@techsingularity.net@[84.203.17.255]) by 81.17.254.9 with ESMTPA; 13 Jul 2021 15:21:01 -0000 From: Mel Gorman To: Andrew Morton Cc: Desmond Cheong Zhi Xi , Zhang Qiang , Yanfei Xu , Chuck Lever , Jesper Dangaard Brouer , Matteo Croce , Linux-MM , LKML , Mel Gorman Subject: [PATCH 2/4] mm/page_alloc: correct return value when failing at preparing Date: Tue, 13 Jul 2021 16:20:58 +0100 Message-Id: <20210713152100.10381-3-mgorman@techsingularity.net> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210713152100.10381-1-mgorman@techsingularity.net> References: <20210713152100.10381-1-mgorman@techsingularity.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yanfei Xu 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 Signed-off-by: Mel Gorman Link: https://lore.kernel.org/r/20210709102855.55058-1-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 6ef86f338151..803414ce9264 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -5255,7 +5255,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.26.2