From patchwork Thu Apr 13 23:14:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13210732 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 F29E1C77B6F for ; Thu, 13 Apr 2023 23:15:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2033B900007; Thu, 13 Apr 2023 19:15:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 18AD7900006; Thu, 13 Apr 2023 19:15:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D71A7900007; Thu, 13 Apr 2023 19:15:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id B90BB900005 for ; Thu, 13 Apr 2023 19:15:25 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 88014A017B for ; Thu, 13 Apr 2023 23:15:25 +0000 (UTC) X-FDA: 80677926210.26.C3F6A60 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf25.hostedemail.com (Postfix) with ESMTP id 265DCA000A for ; Thu, 13 Apr 2023 23:15:21 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b="0dvFtMF/"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="rFxE/ssf"; spf=pass (imf25.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681427722; 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:in-reply-to:references:references:dkim-signature; bh=Pn/uyozvyYbUQ9JbCnKLeYMPmrjAiQHRp1hAqucWDsI=; b=3Jt7N/MnHfryLaFNkByrLlzIFapZZuo/dgFEG76H+LBQjgZ8kGQ3dMexvESfD6j9m95N9Z CGnZlN/wCGS7OZ+m7lrrAUB8XACh4pmvj17bTePkHlGKhX9tNR8hLFvM2Dv9YBZoEpuZz0 3Dxi6NKvylvsnV6Ct9EETIpkpx9EQXI= ARC-Authentication-Results: i=2; imf25.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b="0dvFtMF/"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="rFxE/ssf"; spf=pass (imf25.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1681427722; a=rsa-sha256; cv=pass; b=OZgIv1F/iPmtj3SaT3uuuBg9q9j5RhJJ9SUxuSKNWzC5Q9WFZ/BkTwc8CcLAhWK/rur7We aWFfJVUNhpPHo8GuW0w1pVlrhykFtgY/sAfXLmUPOHGGXx5G6Tuao5HXOwaxqcU7gAYSWN wXl0YC3aKvPezutdtD218+wzmbFsYHs= Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 33DKx5RC012833; Thu, 13 Apr 2023 23:15:09 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=Pn/uyozvyYbUQ9JbCnKLeYMPmrjAiQHRp1hAqucWDsI=; b=0dvFtMF/fpryAsXldSwLoCOp18Z1Lyq4GG7YFBi5OOD9GFD9dmPWoZhZ8xM1JSx7L1SK eucmDj0bz0j/GwgndlPjy9NLDhn1dCueDVSgM2qaRibZ2dgUtevoHAb9kpj8LvOjETh3 uT4Gf6UsdwQ6pGfkIuU8A9dWGtsJpnjNVGwNzRFHwe2n9aZWR4rsUxB0I4OaicBpnb9g dvjTSqypsIrSl9FhUcQ61DWxqzSFFCl1+sHPf8KsR1LbK3s6zIkTZuJQ9ybb0dgnJtdC tknwBgnLaONdblIjyx0QxZNfzzUXL4AaVWl4ZhhImiF5D/psRNLeTPeHkDrslSqi08TQ 5A== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3pu0bwn0pe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 13 Apr 2023 23:15:08 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 33DM6C1k012738; Thu, 13 Apr 2023 23:15:08 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2045.outbound.protection.outlook.com [104.47.66.45]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3pwwgrs6sx-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 13 Apr 2023 23:15:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HpC8EINTOSjvKdPEXqqJ4dCdQTOGU+rpHjgjIjgZ+f7pL7QuaGEj7QvijeOspuic+yijS/Hum2LHfYNpR7KgRZa41gqmCddXKjF/+ZC9HJyQ+PVFQG4fpxy5g4wNsnf1vnIj+1+A+V7vQTE5Lu3gtQTZX5pNl8GTtmGT/AWu517Iwn5Q7oMcRgorDO7fX8uqZSsGXP5izzuuwFFMZWROXFcAD5znvfRSSkPViLA45f5hnTwTphjQaSaaQJW0kD34UzGijSltcHz9VeZCC2ufDcuZjurGQnskZaIPn0sRR2nnEVevZPOjyKKrzze7C4QZNhK3bTxlKmF+pn552+ml/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=Pn/uyozvyYbUQ9JbCnKLeYMPmrjAiQHRp1hAqucWDsI=; b=odF2m/tGzJ7Xj6pDKN3HPt+ZBMO8zpVQO2rgcG8qi5rkU+UPgpi/mFuBDZZq9YHhxefhsnl4wK7aNys8akWaQs33FfsYzxAA0uExkqgmACQF1/+3piE84LkEnOwF1HtB3+Up9Jq+JmaC93Qo4DEOHM2eN26DM8rCfLQcqnCbQOfZi4DtzvTpUXFSAtKaw2G5wZFg50UTUYg96FNYaqFHbV5gFnGQDEKBm3Obn920PnRpWMWvQfaF2VKbwEm5vksD41YapALrFIF24H4xGQBQ1ePTkvZ9RGANfywz73WPl4J6GUpRbR9Ruf3CptbJ7rgLX1YZ2AFtKdbqQWacsEpHcg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Pn/uyozvyYbUQ9JbCnKLeYMPmrjAiQHRp1hAqucWDsI=; b=rFxE/ssf9PHxMr7IiXgHAnbcdxEubXqJat1r2Gs19VXWzr6/aoAw06BXj+60sss296D2E0clgrFduh1S9IRKvyd8WEcKDL+sHSawlOWnr4WO8TqnFuT4SYRnHY20yYRsR/ojOiK1MPnd24lP9YBGaUIDSfO87+aSPOHyP4gy0fQ= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by SJ2PR10MB7058.namprd10.prod.outlook.com (2603:10b6:a03:4c5::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.28; Thu, 13 Apr 2023 23:15:06 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::12d3:3f71:5b55:c342]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::12d3:3f71:5b55:c342%6]) with mapi id 15.20.6298.030; Thu, 13 Apr 2023 23:15:06 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: akpm@linux-foundation.org, songmuchun@bytedance.com, mike.kravetz@oracle.com, willy@infradead.org, Sidhartha Kumar Subject: [RFC PATCH 4/4] mm/hugetlb: add hpage_shift to alloc_hugetlb_folio Date: Thu, 13 Apr 2023 16:14:52 -0700 Message-Id: <20230413231452.84529-5-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230413231452.84529-1-sidhartha.kumar@oracle.com> References: <20230413231452.84529-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BYAPR04CA0024.namprd04.prod.outlook.com (2603:10b6:a03:40::37) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|SJ2PR10MB7058:EE_ X-MS-Office365-Filtering-Correlation-Id: 0ce97d5c-a0b2-46fd-2b85-08db3c74ea9c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: w4/AiuRqqnVrhVz90TnGnmq8iYraqYbHQFN0ywLo01p+6Nkyxy+8APIkKnCCFF6NmncmBEr/T8MVygvqUz4VFRKo8inelt/eYNaTZwm/aGyZGjdxb3gyfuGDIRWUHZ7tLmKlJ1C1m/97jqgv9dSdY67VKWTyLurZAJl8uIXn6aJw/Vmw61BmlUkH9LgRu/axYCvwHLMONDALjQxAhH+13mMxYJc7GnzUTHeoq3tjnqzToPPOy49BNPPi640SCEBUB/tOA3ZJroQBgLhATkNKoeWahilbvv8xoYEFBi4NS5qdo/cyGy2DDYgZe4v+mn8Dro3Hd2ioa/GPiPupjaIGlfvWLMXki9KQ/e/9k1N9g3I5ptdlJKzb6t8l+Myay6rrNj92lgiQK0MPgd7NNQfi3muieRcVOiGkph4qo4p/6cQo7gLf3S/nW9qh+0JKAFMErcwax3CAf1cP3q9lF8/zDbCM935zGcslQ+yrx9vBrVbHqv4GDEB5Ps0eWOEDAVteTz0zb9RebLIck7H88GzvQpiwVn1xBDADCNxf+c5/v/9lb6w7eCt3SKr/wAGbbRGC X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH0PR10MB5113.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(39860400002)(396003)(376002)(136003)(366004)(346002)(451199021)(83380400001)(2616005)(6512007)(6666004)(1076003)(478600001)(6506007)(107886003)(6486002)(186003)(44832011)(36756003)(38100700002)(5660300002)(4326008)(66556008)(66946007)(66476007)(8676002)(316002)(86362001)(41300700001)(8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JLA2R/HKQ1Ovi0sGMJrv/ZiQJWrZNLyuYoFCe3zEHrwbPoSfB1deXXsnxuhfUR90wR3rJbOo0HvfDswXIQJ4QHVKeBs33qGP9wY6oX4xF4WqaJkKafb3EYs1rLRUPZj1b6vs22DoA6+C3gYKcc/lS0W/b6/2obMY579tzhiQ+LvjgjKfN88FEWCyWxNd86IRcFJHCrqiTaeGCF+BesjDkBEtdk3Mo9vlTW2aazFSicTYK/kaoHeg+43BYx0MzKu7pMB/fx7E3zqdfuq9A71OQldhQ9VWmIpxBUq2BS9f9lv781lyJVKVk0MBYMRghDBz1ER1cES7lz7uLw2FgWkIZDJu14ebbTWDYSje031r9nYPTOvBGjmZgEu9nu2N76UCS9sCCQrht37wRhwqoPPS6Q2Ru3z23j3vx0h68I+vQ+HYYnFfuHgIufHGbkbG5/h9F371LKl7JZtly0rNJ3Rgwne3OICbQKtG4mIeUmJFswpHmNyVPEGBJKx7kLtGxQpvSaWPJj3JEjYQSEzb+NLRmRYEv8AdNchM3w1J4narrZ0Atr+4wDgyqA7fpPHNzgLnhh8mT9qRnoC1Req7p0U= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0ce97d5c-a0b2-46fd-2b85-08db3c74ea9c X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2023 23:15:05.8760 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: TdEePQS+mOhZL7UIm+AP8kCmw+1+c6r9OJN8KAStDXoxMRRahulsj2xVVIi7v9fjKJmICLHNoIVmihkdzXKacavravfa3hWw2g9RzaLH0/k= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR10MB7058 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-13_16,2023-04-13_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 adultscore=0 mlxscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304130207 X-Proofpoint-ORIG-GUID: n6gWasBagPD6C4GIBWJiFpEWZl7Uo6re X-Proofpoint-GUID: n6gWasBagPD6C4GIBWJiFpEWZl7Uo6re X-Stat-Signature: njdyrcrogab3j18keb35sntwrr41rx4x X-Rspam-User: X-Rspamd-Queue-Id: 265DCA000A X-Rspamd-Server: rspam06 X-HE-Tag: 1681427721-924572 X-HE-Meta: U2FsdGVkX19UkKtMDK3GlfCg4Loq/eHyKwLeenxdQIf/t4429QlLcZvz7vuHrHAXjIKAyvkekk9ExQeEICG6F1jD+7EjaWxKOvRzqYJhhWKX6+9IP8MpIZzZkEtnGmqDShc16kL7B9D8pJAcoA+aGB3K5DQUZRGF1dqNC+Ysjpxuw2T5gOqy49vGhgGNNOFgaECuxJ6kfXapve0IWTNDPjdCxfawsaVLQj9H1Yb9C1RGjnpbY07RGeqC7wuLokFIUraANM7AVgajS5gcv82/n9e/a/n5y6GueZJBi48cXp+23R+IEIqifRuctjsBU21LTOYooToj24tnA6fbIOCwoP+hJfGq2xHwv2yzfp4QpceYIhdpS5981+BHA7cTOekCle5esCyVL0lWBMd06eWuO/n4xNhPx5QuaHsl08KhSpNb9gK5D8e27BmDVCdDnU6jo5VPiAe8HdRxKlj0nib/HokM7NkEinP1MVLXq49qE53WDHDERL6I6wr/n7BxeSjyz0IwYuUSqoFynPgx6tJJkuh0ZDehjNVjICk17QkYVuhgohVUNCTTBg7kHHmZAOhRanRAWjKkxJwRUtysIY9J6DmylSHkhihpmwRojvkscLM8igPeHHZcMAZrNNp7WLpn1ASS1WBRftsRSCF+k2ilePPs48I1WahpoDxDKViQZ9u/X9FF7FLwrpV2GlAIlehNcLJ8CQPPA/N833Z0H2jNzNCEH+G7YN9WHLpLo3nxnETEKbdTzkv+IZk7EjxgQNuovKdvcLxEG5OZfSnLfg9JQKryfSKwf5970FaK2ajcx8jxv9blbmLIu18DEGXpwp6HTN/HnSZA2RXX557zMmanVZRptbqFn/1dmAn1joCyFEw5r3Q9XB8YBfNwQTRMkJX6ZISjhYM0nA1wfDTOqr6E7aAnGCzTTwyMoU5eDklF/0gTb090oND4PuwBj9BYlfzcESaUqpqL3Cdmjjcx2AV W7l0J1zt 5DMwnZxGJ6BXIlpxRGp1jmml145BQ5rMJ8vKT607wzlOsSDqfmGha4GVH3hKazAOlzNO8UnhOezpufHN8pvrjKZLG4ygmfZb8IvdaxrZXcJwl1ir/oIdmUas4GIznByuOGKn0LjhH3s3Sn/Q73BoedisEl322EE2/iq/Q8CMWQyZijWeHLNR8Xbu/7TJpKT776hBDrpep0IfmrisZpW8jp8Lov9Mxx82LakhG5BdxmkxLLcAg/mUMXLEJ3GVp2qIbny0sDYuqkLyTqrLaNdZdOswzIIE2ngbx+wZXTkOx21Ez5G3+PXn96G0QXo7IYRWJBSfKFqbxN2jHwyxjfu07UIOwVn6QA26aEV4rADzOAsfLblczKPxWyDcB0iy+01pFTTf1xzR6b1LpFV2YAQyBBda9RLGkIdeVjX68ON9ugZ4TZWh54eh6bGGc0khpVTQqjft7 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: adjust the return value of hugepage_subpool_{put,get}_pages() by hpage_shift to be consistent with previous values. Signed-off-by: Sidhartha Kumar --- mm/hugetlb.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index a28fbdff886ff..258c211020c3a 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -2992,6 +2992,7 @@ struct folio *alloc_hugetlb_folio(struct vm_area_struct *vma, { struct hugepage_subpool *spool = subpool_vma(vma); struct hstate *h = hstate_vma(vma); + unsigned long hpage_shift = huge_page_shift(h); struct folio *folio; long map_chg, map_commit; long gbl_chg; @@ -3017,7 +3018,7 @@ struct folio *alloc_hugetlb_folio(struct vm_area_struct *vma, * checked against any subpool limit. */ if (map_chg || avoid_reserve) { - gbl_chg = hugepage_subpool_get_pages(spool, 1); + gbl_chg = hugepage_subpool_get_pages(spool, 1) >> hpage_shift; if (gbl_chg < 0) { vma_end_reservation(h, vma, addr); return ERR_PTR(-ENOSPC); @@ -4778,6 +4779,7 @@ static void hugetlb_vm_op_close(struct vm_area_struct *vma) { struct hstate *h = hstate_vma(vma); unsigned int order = huge_page_order(h); + unsigned long hpage_shift = huge_page_shift(h); struct resv_map *resv; struct hugepage_subpool *spool = subpool_vma(vma); unsigned long reserve, start, end; @@ -4799,7 +4801,7 @@ static void hugetlb_vm_op_close(struct vm_area_struct *vma) * Decrement reserve counts. The global reserve count may be * adjusted if the subpool has a minimum size. */ - gbl_reserve = hugepage_subpool_put_pages(spool, reserve); + gbl_reserve = hugepage_subpool_put_pages(spool, reserve) >> hpage_shift; hugetlb_acct_memory(h, -gbl_reserve); } @@ -6871,7 +6873,7 @@ bool hugetlb_reserve_pages(struct inode *inode, (chg - add) * pages_per_huge_page(h), h_cg); rsv_adjust = hugepage_subpool_put_pages(spool, - chg - add); + chg - add) >> hpage_shift; hugetlb_acct_memory(h, -rsv_adjust); } else if (h_cg) { /* @@ -6908,6 +6910,7 @@ long hugetlb_unreserve_pages(struct inode *inode, long start, long end, long freed) { struct hstate *h = hstate_inode(inode); + unsigned long hpage_shift = huge_page_shift(h); struct resv_map *resv_map = inode_resv_map(inode); long chg = 0; struct hugepage_subpool *spool = subpool_inode(inode); @@ -6939,7 +6942,7 @@ long hugetlb_unreserve_pages(struct inode *inode, long start, long end, * Note that !resv_map implies freed == 0. So (chg - freed) * won't go negative. */ - gbl_reserve = hugepage_subpool_put_pages(spool, (chg - freed)); + gbl_reserve = hugepage_subpool_put_pages(spool, (chg - freed)) >> hpage_shift; hugetlb_acct_memory(h, -gbl_reserve); return 0;