From patchwork Mon Aug 26 06:40:48 2024
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Huan Yang
X-Patchwork-Id: 13777142
Return-Path:
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on
aws-us-west-2-korg-lkml-1.web.codeaurora.org
Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17])
by smtp.lore.kernel.org (Postfix) with ESMTP id ADC6FC5321D
for ; Mon, 26 Aug 2024 06:41:36 +0000 (UTC)
Received: by kanga.kvack.org (Postfix)
id 3E6446B04A1; Mon, 26 Aug 2024 02:41:36 -0400 (EDT)
Received: by kanga.kvack.org (Postfix, from userid 40)
id 396926B04AC; Mon, 26 Aug 2024 02:41:36 -0400 (EDT)
X-Delivered-To: int-list-linux-mm@kvack.org
Received: by kanga.kvack.org (Postfix, from userid 63042)
id 1E8EA6B04AD; Mon, 26 Aug 2024 02:41:36 -0400 (EDT)
X-Delivered-To: linux-mm@kvack.org
Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com
[216.40.44.14])
by kanga.kvack.org (Postfix) with ESMTP id EA7AD6B04A1
for ; Mon, 26 Aug 2024 02:41:35 -0400 (EDT)
Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1])
by unirelay07.hostedemail.com (Postfix) with ESMTP id 860A2160D15
for ; Mon, 26 Aug 2024 06:41:35 +0000 (UTC)
X-FDA: 82493450550.03.D402AB5
Received: from HK2PR02CU002.outbound.protection.outlook.com
(mail-eastasiaazon11010026.outbound.protection.outlook.com [52.101.128.26])
by imf28.hostedemail.com (Postfix) with ESMTP id 5A21DC000D
for ; Mon, 26 Aug 2024 06:41:31 +0000 (UTC)
Authentication-Results: imf28.hostedemail.com;
dkim=pass header.d=vivo.com header.s=selector2 header.b=apSnpYR5;
dmarc=pass (policy=quarantine) header.from=vivo.com;
spf=pass (imf28.hostedemail.com: domain of link@vivo.com designates
52.101.128.26 as permitted sender) smtp.mailfrom=link@vivo.com;
arc=pass ("microsoft.com:s=arcselector10001:i=1")
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed;
d=hostedemail.com;
s=arc-20220608; t=1724654397;
h=from:from:sender:reply-to:subject:subject:date:date:
message-id:message-id:to:to:cc:cc:mime-version:mime-version:
content-type:content-type:
content-transfer-encoding:content-transfer-encoding:in-reply-to:
references:dkim-signature; bh=gCk9RWMqjGElVQDWcnIaKv+aBGIjFY1dUGc0J7gz900=;
b=T+lrqwi8JJPvg4NVo/dHT0mDieUUro0JBwzHkSgsBsVHIPJDhDxKT8dvL7mtBoDY3tSCFM
PVnT4xlRdqAF7Qea5bbOkDUN6rR6HuirDfTVaTgF+BeGjiJAXZPoYGTci7AYxLfbdZAeeR
EVOKo2aNxiVYTuuOZ5Mo2MKV9QhzvB4=
ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1724654397; a=rsa-sha256;
cv=pass;
b=8gF1YlgR6wOCvN2TEHyWafHjcVLx1a45hpdgxwQ0EnMbJtQEKIFK855S1s3T1yOuF1OesE
z8f50JE1hA/YV3wa4O/meEqFOC+SEpfDginYiHdLa3gHI4y/RpbVjTptElxqxuseARfSrI
iENgsiGFq2XeS2c5+q3a/rWxNOl9dH8=
ARC-Authentication-Results: i=2;
imf28.hostedemail.com;
dkim=pass header.d=vivo.com header.s=selector2 header.b=apSnpYR5;
dmarc=pass (policy=quarantine) header.from=vivo.com;
spf=pass (imf28.hostedemail.com: domain of link@vivo.com designates
52.101.128.26 as permitted sender) smtp.mailfrom=link@vivo.com;
arc=pass ("microsoft.com:s=arcselector10001:i=1")
ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;
b=tv+DYQ7yO8sKumOizaTopFx7VLEClygBfD6d26qFXiI63PjGZJKG48CX5tvvy7aLlbQBDoa2C/4e2ET+zb5+63r1EAS3LQITmb9uzAjvNKfqBpvSO/RnYxBW/p1nrAWhQwhlQpeqIxZeTuOnkKDVn+EGmaK1FfNSxCC4XqmINtkLesSFHpho8EuuvRxxBj+6Xu48NqrnCDb9bboYE0S6gT+Qs5FyFmOdk6fosti2kcdOySIeTVjtOzsO1zPztCCBP6rjF6/PRXPhBQfXcJyuxdhKXeZ0/r065Pg2QHJWqTCFqqEUpsg1BIwBUuPofug/RXsRMUlvFuoyqhksbCby+A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
s=arcselector10001;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
bh=gCk9RWMqjGElVQDWcnIaKv+aBGIjFY1dUGc0J7gz900=;
b=jZRqAUUY2VvF4XfSyJy8NjyhnLqN8w7EWv7ecR71M52M6AaG2bymmMjZ//j1HZsCbH+l3+QL9LL5QPcixn1zCM3R48f5zRsvdKdRtje2kGkOlkZicY0i+EZSDTxIMfIVye7P4uy/xPPk3qdQKzAPin75jE0vsInrjgKz/Hq1W0nw315EN1H6AKZMhL4N31GINte8dCZryaXmXsgP86Nv+aLz6EwOimF2IDiZKW+7i0YwJL3vgSHuTaXwWMSYl8d7dNGccsK9jlPar8tbX8NDL8wHtYeLGmlvQ5+IT4CIFnPzmypETeRk6Db8zkrL6W8Gmk+jN2j3CWMg72vH999Diw==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com;
dkim=pass header.d=vivo.com; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
bh=gCk9RWMqjGElVQDWcnIaKv+aBGIjFY1dUGc0J7gz900=;
b=apSnpYR5rlRFk5O1GZMa/yVNYi6o5FVpMEnJSC/g8ytEqI0ox66WRvFbFQVQ0KCBAL4cGADnCSmw+9NwH/auTK2eO9hIY97ioMvFr1YDUBe5FnmBplJKcj025q6km5bgVMoZGRezXX0nONdtUbs9P3bopb03MZw1hmguMo5cvKTJwJ7xJEnEtvxUh5opcJDkepE0SK28cM31p328gKEUsimuDooD6e6KnvJeDvadEg8BgSI6F87yz7IEpmTfOtPU1RraFdZzvQMqJ7Pm7SR0dULFueyja7FW3tjjh3yYyGxGG0Nf3daPobny9q1W5Rjr5R6YLEBYlMhRuWCpFV4axw==
Received: from PUZPR06MB5676.apcprd06.prod.outlook.com (2603:1096:301:f8::10)
by SG2PR06MB4986.apcprd06.prod.outlook.com (2603:1096:4:1c1::14) with
Microsoft SMTP Server (version=TLS1_2,
cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.22; Mon, 26 Aug
2024 06:41:24 +0000
Received: from PUZPR06MB5676.apcprd06.prod.outlook.com
([fe80::a00b:f422:ac44:636f]) by PUZPR06MB5676.apcprd06.prod.outlook.com
([fe80::a00b:f422:ac44:636f%6]) with mapi id 15.20.7897.021; Mon, 26 Aug 2024
06:41:23 +0000
From: Huan Yang
To: Andrew Morton ,
linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Cc: opensource.kernel@vivo.com,
Huan Yang
Subject: [PATCH] mm: page_alloc: simpify page del and expand
Date: Mon, 26 Aug 2024 14:40:48 +0800
Message-ID: <20240826064048.187790-1-link@vivo.com>
X-Mailer: git-send-email 2.45.2
X-ClientProxiedBy: SI2PR02CA0029.apcprd02.prod.outlook.com
(2603:1096:4:195::6) To PUZPR06MB5676.apcprd06.prod.outlook.com
(2603:1096:301:f8::10)
MIME-Version: 1.0
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: PUZPR06MB5676:EE_|SG2PR06MB4986:EE_
X-MS-Office365-Filtering-Correlation-Id: 7cb13d8c-448f-4fe8-21bf-08dcc59a1a17
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam:
BCL:0;ARA:13230040|1800799024|376014|52116014|366016|38350700014;
X-Microsoft-Antispam-Message-Info:
O931kxG3RfGzthNHBluYetZXzv7XQ01OX/FeJPQlc4svRMyPzJKuePxyIIxK9wr3IMFryfBlGbcCH+5X0s9aQBl+KF5K54DZR6UbhzEQV/D6ngYDEkrtzVQwwEWDlVd1szPwPUMMR9hdzOO0V4h3jTlGunROvX0SyFslqrA5oQ/oex/fQ/byg6w2kyAEMuqJJdjVTihvQtFeQmTIQNnjX8rrL0wB8WrdhD3C3j1ZUq4coScryTcuQ72bvSKsuS4HBMUcf67MvfB1PrU5gPcqlro0F3zc6jvFrCU0RmyHqntnFO3X0Sg67a8sx5wpFlZLm2/R5zGj8VoH6s8Or4uYTdpEhz8m+1AHzDEEvLYYI3HcMDDPY7elbjFqUfeO/UUYY3Zqq/tImVCycP8nuNKJYGNp6KRN9LRIORay58xyWEbB4gjEFHnsT0vWA6Yb7LGjG5bx8J8bLfM11eC4SxrQ1yTZXnksKFYYSVWdV2QzAXR106NjOtqKDYLwPSmiMCzFBowp0LnNLgF84Uo0Onf/hEELm4qlcsZNwMsXFRav8BziRA5NmCcFfTlV2u2/0u3y2lNkqVvi9mVGnO5ct8YACj+gEDwuyQnOeWCnCFYNNPPuqKeA/n52XgzB4dVW1xXeDxNmeeCHfZRFTfPPajeysp7DEiak1KFWxrgbwEF4hYHpP1ZN77vYy5A/DuiSAIIA19fGvsOk6fhPBVwIWXgxcDG9psrCWK6h7cz1iTiOTzIVvKqVjzQhgCXqJKidZH+Nl79hDF2ttHkShWMNEOI5EVEkkcn6AcSyJwWEd9NoAZXbz8UiAIJfdTuw/LzKR13kj5SX58o4//uVjiNa3SuZIvuOj0o+HjTATfzbj0WNkUMC0IEmxNqJuob/a4eQlH844bcF2gdBrWM8/UGu7YpF//FQc8ftFHtA5jLfq74bnSxXDGR7d+H2FnCWAtS3h0xl9uFqst/czl4fOQMdF4SYK+bZREKtPw11PpHoTcup+ER6UnhGlm4bwdKxs7wg6eF1z0IyAi34goeTmNh1K1Hm1aUJMrcHxJWPcxASGV6zAovM/0AtsF1RGX5dQuaVKreapynNh8RzT6iEMucUJRl/99zLTIv//hyPqAryLovwTooq/mCibxArav5hjZJNQ+0iLK4s2HOJfn61cbnuARx+5Go7SB+t2X9nZl3pMzpisvVU4u8cFOlDjJwJhJBsll2gWr6+jjthu/1iyHwvBZw0TrALFpQ/U9Y9ImU8R3mK6ec0q9D+5VdG6WSYRWFg3/pCmTrsuyYd4+cje2WG9rfdEowlnhDtDwqcl3RGye1mpv3+oZYR40EKqKU0P4Uiar5GTR/ImJtt+ss9YgLwOyB+1QvzU+xgnAo6Ouoo7KDJdn5bHm4NU2L7oHESqlSywTxPHxWCDNr6vaafQStoS0URyQ==
X-Forefront-Antispam-Report:
CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PUZPR06MB5676.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(52116014)(366016)(38350700014);DIR:OUT;SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0:
PAz+JULD5E0UJquB6ubjxYalpA09fo5JgpKwCVi23Vtw4qMwVqErCWxOd+HK6YtmqklhN9ElX/PJsyG9fPlXSFGqc6oSU6IU2vs2c3Gy0Ri3hp1Q9ppRQ4UGG3skj2eE2PVK/jemQiNWmH4feaJ0SO10Ic63QeP5La7ZmAUroPcIC5c43b9EZz0DtWQKYOw/T2TX7MngSoWFOMwasQoo3zXUATDXFPRZl/+/UKJ/bQ8wOjfEn+R4KSWaTbAE0ah0cwJDqqmmpwnD0Ci8qXOueOL8OslWkIBGYKvECbCrnmRHf62YkXhHAKn+q7Pzd7dZzrNvm0YoD+UEmvAuV44OgeJ1WVFHcmwXb6pdUeTJUnmuUR/zj2TEVAFpi2mOoBucBVuWmSkGtWCAUVM7rx+n23beM7/2c02Qlv/GQ33pywy8JhrvQTS9VE+oklPJC1ZtHd7+lKTZo4sGzNBZoDEawB7Q9HLBiTN05Ul+oXnlZBkv7xAUY3CetfYIcz1OrgtfPHn5zGW0cK6/KAl7/kivvqXHMrz1tHdP/O3eTVNHCX822mpSKgcB3jLrFKXsHG8uTfZUTrCWpsvQRFfXn5y1LiboJdNGoJmpymmStWuoHByA+/462l3j8BW1RLmPrNTgiSj7d7V4uMsrpr1y+QkT0uneb9+UFRR+mTuW35F3R6PYSt/MXS3V2fqnlJb5/RYc8AVCTxeYppdFFnj/rK5XP1R1L4C+q7Kl2SalOIuyUlOqMLe7M9j+TPwbyp/b6uCHo3nc9FJRf4uMjaKSYZIkfQRVjXcq8FqSFLB6epTiYEtXanj2JpcFjl/JW7cupcfo3iFoPrxEdXc7patumizZp4opQo6uyr+EFXhqq4gNuX1PZKhmzZMRYaQ8m6N781F6yhqwZBVcNo98zOlzI5B7ztV0NAKYNoiqvA2bsyGWkPloKkgKxmzrNvJnHRyoOp2xF5WNnhR7SeSZ1BAU85tsHuMkt0qzAI1jwJnl28Bgp4qqDGrBb3fVajFHcPwx5GfcJNC9Hj0bpuUxsnWxF2JUL93EvmDhJ1cjs1HydU8ffwUJKz2TyVUM8E0VfYxSXeD2nNeIZRCsl79IGhsCRK+0b02jDRzXORAzAsSLdZJBNeA2loLif7UqmA2j7qYOZ0mNKL291S1waSawiVsrckB788TKdLrz3oB5yNaCh27TavnDl7o6TD8MjUnqT4V9mHk6iGxysjk/Bx30Yd9pH1iR474A1RH/xceItBQ17rOOe1mqmlsRBfMX9xaMCmkVNBqlYuzQCc2jUJouCAYUgoIUfpc4DJX2KTU3j9ozFngbuwfw3PFTqFqkWLIgCRN9xpjgL9qop2YhsMza2TT3DNI/OkJUhcsBrR0QAQcMsvVzkK6DsE3ULAYR59Yn0WbuQ40xmLeStcZ3R3Q2Q7/wlED6Gv0ncfiVqi3r2hhs4P2oQHA1GhFbOFmSqI+Yiif6zWyUd5Cl/UENAzW+XdoMFwtAIL3URfVH69uJUhHaHPFwthHoLeefKEKDYClnxtiXwemiwErjFdhNWGlyIk4KJa1dVM61L9N4dMIhH9fibsjCu2COUTRJpkxvDoQQCX+WcVBw
X-OriginatorOrg: vivo.com
X-MS-Exchange-CrossTenant-Network-Message-Id:
7cb13d8c-448f-4fe8-21bf-08dcc59a1a17
X-MS-Exchange-CrossTenant-AuthSource: PUZPR06MB5676.apcprd06.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2024 06:41:23.5908
(UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName:
LD8IUgfNW2u6CYfbeHloLkHOkAHW3KwCo/O2/b1P3o/7Xu8ZR3OghVMAugmXbu8cc7lwSvys6bunPkgeZ9LSrg==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR06MB4986
X-Rspamd-Server: rspam07
X-Rspamd-Queue-Id: 5A21DC000D
X-Stat-Signature: f3n4chcpyguudsks7iyyi7bdepzhdr93
X-Rspam-User:
X-HE-Tag: 1724654491-981712
X-HE-Meta:
U2FsdGVkX19m8B5MraTqCxx9g7OijSJ59XdUNvmjRZJ/dnxXrxltGyOFGxatUPJu9ungheY6IrTyYT6e7qKrYgxq9foGaacL3UUxqa2GboaUm7CgVofJGuUMnPXRLFPyMVNc48hXq3LoHrcQAwCa8qUH7VyE1eo8Q5f3SdRkP58h4HDZMELbDhB0/8kFvSsge3cIyHTFOqcZRNx5wTgoPx3I4wL4ptwdy7/OP9M8c70qzGoE3jsffMmPSkG8EIdEAOtFiQ7FspvbMV4K7WtAzaJFi7PzIPGYVSJXTV76M5WEPtDKrK0g23hhNBJoC15Rs75cU8NgTt3jhn8IlOxA7l0DAojBiRHGSAJZrKsSEeL+To4ypzHrsDAoR5cmOJlsY9oQPkoz86G1PfPu5r7EM6bRonybD5ua/MGodobpOlTEjlRTZIapS2l6SEg3ReS2gbdt58F6qLx4BwlaGJbYyiksqxFeFX714S4ioS/wolbxGWlwmZWx3/jHeSWZblm3IZU9r4F4loRbTb3wvtex7vRpFXQyFForDwKEMTlzb8xrvuo6CDZ+2OVoVSWsoaV3nL6WRyIroTQTvhuRzKU1HLCWYuCftruz9zQNwTP4FVTf9Nf17XzsD+W3SlpnDLVqDvTU/FeDPAVzK5iGNCEP8LwD7WsfxkkCtl5MmwxS+gaTMkNFiAvuPFAlVn3TaShn77kz+lpWI2o4x3O9nTAJfbhc6oz5iONnXuoxPPZ/zmBrkruL18QVZywSd+ISVaJh5xWnsVYTaVgj9lOHgtN/i4hPi4Rm/NjbWY2GNI+ngYfvDzNFF4h79/LHsQY+nO07F5IFbOiE3DLC504Q91fxRHlgo2YtrQHm3gcZ9kDq/usl70xiHHiQF7wkx7MCEIStlDcDlA567DMUgM7Gufaf4lKQduV9gNM+qPDkNRj2uuthABMmYi3VfybgrMz471edGdJZpfepK/0xhpjDCtD
4NlnPJBm
iJUFpGngjUgS/TeOY/cAQP1K+tn0n5tdzKutOLkjTfKY3DRPeDcYSf+TaeatJQlkkK3eW70iHXaO051dXt3AufZ4dwSMfnJfEaM35a4z/xdOcq/8kgTUsvWBYOYWThtg3OzOuaz3auksavMlkOWpwdg+SKsJY6tDEiPxuUCO5D9SAZlk8l0Haq5PeEK0xXHmzvwrOd3WJnjEiFwTGzCUB45MwGiYVF8VrnCIztyVJKGNex6enkprEjFSoliCfaslcwA3EcicpsuGkSDKIG+vrk4yPZ0agwQ0G+d86Au+cp+RZBV3ZenZ5yea1Xmgy3oH4L8c4/II5K3H5roWusOiRLpfsAMPzNT/eVIfV
X-Bogosity: Ham, tests=bogofilter, spamicity=0.000004, version=1.2.4
Sender: owner-linux-mm@kvack.org
Precedence: bulk
X-Loop: owner-majordomo@kvack.org
List-ID:
List-Subscribe:
List-Unsubscribe:
When page del from buddy and need expand, it will account free_pages
in zone's migratetype.
The current way is to subtract the page number of the current order
when deleting, and then add it back when expanding.
This is unnecessary, as when migrating the same type, we can directly
record the difference between the high-order pages and the expand
added, and then subtract it directly.
This patch merge that, only when del and expand done, then account
free_pages.
Signed-off-by: Huan Yang
Reviewed-by: Vlastimil Babka
---
mm/page_alloc.c | 35 +++++++++++++++++++++++++----------
1 file changed, 25 insertions(+), 10 deletions(-)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 023132f66d29..900b0947c6e1 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -1363,11 +1363,11 @@ struct page *__pageblock_pfn_to_page(unsigned long start_pfn,
*
* -- nyc
*/
-static inline void expand(struct zone *zone, struct page *page,
- int low, int high, int migratetype)
+static inline unsigned int expand(struct zone *zone, struct page *page, int low,
+ int high, int migratetype)
{
- unsigned long size = 1 << high;
- unsigned long nr_added = 0;
+ unsigned int size = 1 << high;
+ unsigned int nr_added = 0;
while (high > low) {
high--;
@@ -1387,7 +1387,19 @@ static inline void expand(struct zone *zone, struct page *page,
set_buddy_order(&page[size], high);
nr_added += size;
}
- account_freepages(zone, nr_added, migratetype);
+
+ return nr_added;
+}
+
+static __always_inline void page_del_and_expand(struct zone *zone,
+ struct page *page, int low,
+ int high, int migratetype)
+{
+ int nr_pages = 1 << high;
+
+ __del_page_from_free_list(page, zone, high, migratetype);
+ nr_pages -= expand(zone, page, low, high, migratetype);
+ account_freepages(zone, -nr_pages, migratetype);
}
static void check_new_page_bad(struct page *page)
@@ -1557,8 +1569,9 @@ struct page *__rmqueue_smallest(struct zone *zone, unsigned int order,
page = get_page_from_free_area(area, migratetype);
if (!page)
continue;
- del_page_from_free_list(page, zone, current_order, migratetype);
- expand(zone, page, order, current_order, migratetype);
+
+ page_del_and_expand(zone, page, order, current_order,
+ migratetype);
trace_mm_page_alloc_zone_locked(page, order, migratetype,
pcp_allowed_order(order) &&
migratetype < MIGRATE_PCPTYPES);
@@ -1888,9 +1901,12 @@ steal_suitable_fallback(struct zone *zone, struct page *page,
/* Take ownership for orders >= pageblock_order */
if (current_order >= pageblock_order) {
+ unsigned int nr_added;
+
del_page_from_free_list(page, zone, current_order, block_type);
change_pageblock_range(page, current_order, start_type);
- expand(zone, page, order, current_order, start_type);
+ nr_added = expand(zone, page, order, current_order, start_type);
+ account_freepages(zone, nr_added, start_type);
return page;
}
@@ -1943,8 +1959,7 @@ steal_suitable_fallback(struct zone *zone, struct page *page,
}
single_page:
- del_page_from_free_list(page, zone, current_order, block_type);
- expand(zone, page, order, current_order, block_type);
+ page_del_and_expand(zone, page, order, current_order, block_type);
return page;
}