From patchwork Tue Jan 10 21:28:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13095683 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 DAB43C46467 for ; Tue, 10 Jan 2023 21:29:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EE894900006; Tue, 10 Jan 2023 16:29:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DCFD3900002; Tue, 10 Jan 2023 16:29:12 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B8644900006; Tue, 10 Jan 2023 16:29:12 -0500 (EST) 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 A64E0900002 for ; Tue, 10 Jan 2023 16:29:12 -0500 (EST) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 7200D1C8B23 for ; Tue, 10 Jan 2023 21:29:12 +0000 (UTC) X-FDA: 80340180144.30.A0498AA Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf05.hostedemail.com (Postfix) with ESMTP id 27868100006 for ; Tue, 10 Jan 2023 21:29:08 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=liQg+Oys; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=kApGot+r; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf05.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; dmarc=pass (policy=none) header.from=oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1673386149; a=rsa-sha256; cv=pass; b=FhLZbBsvfk2yXtjAB1Fm20gAewNxn9AuJrIB8Yymha1JaJrRMCX1FKO0Jdjk9Qnkc2mMtx cDZY+jH2bDImClOibuMUOyhqaEjTQX1HNJe9P5rJx1n9KcsOD19ksdxGkedwB973X2KXPT vzC+E/eyXUho3wbTjqTmf+zQUOaJ2Z8= ARC-Authentication-Results: i=2; imf05.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=liQg+Oys; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=kApGot+r; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf05.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; 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=1673386149; 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=8LXZYJ3IF5YwIJs7/2QVzJbgQ0tay2z86vhYBUXlFls=; b=PD3mEHMM6ASe+Mp5q/E94BbMaY2mmQS4TIfaD9FThawLWm0KKFwQi3MpkK0CXCY9uisGTg rmVLiaOs4Rhxcf7UfN9dU5rYYeoMAn2qACXNiKA8fUSZTkP3qUcSBvi1vJuPg4GkbJzJvc F6GkkgjiVrzCFFvLER8/uzAizrxLwPo= Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30AL0Pw0030230; Tue, 10 Jan 2023 21:28:56 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-2022-7-12; bh=8LXZYJ3IF5YwIJs7/2QVzJbgQ0tay2z86vhYBUXlFls=; b=liQg+Oyswq18i1XeSN3JWa52uLQp9deuM2P7BlKCXG78m0B9FlGi+QEWp5yI78W7ggAA HvGbPavVCePAhYF7ITFEHfuGOU0RR0iyRk4ME9oOBgnACOIhHbRfEPtSwfYlFX5fi0OP pdA0BvpJrQylVEkibI9nNIc4ft12AmuxoUfJkoYnUgBrqUZLI8GBUVYZJFoq/Hhgepwg tMebYCJUmJU7USUJ3C+5L/fAWI+Yd8jQEk/oEDM4sDo+R/LAa45ZVfnPIK6Us7qKduRI Pf6hMYVJtIkk/U1NXY5qZIl526QXzK6SKYZhC6PAZ48kksuwwtalO7sS08W9OZRerLK+ Bw== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3my0btpf80-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 10 Jan 2023 21:28:56 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 30AKY8kU022668; Tue, 10 Jan 2023 21:28:55 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2177.outbound.protection.outlook.com [104.47.59.177]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3n1f5x25br-5 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 10 Jan 2023 21:28:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=noEEqFT94ehjSChaYsvymqQ8m7qLp3FaARO3VVRR87U22ybv+PIOwc+wxM2rjraHSTAIksqcD3YvDcMljyapVJUN28I2y2VsW1oKciEkg6TNvWWE0xM7fZBfqFizwrir8CkoQ24bINKTJo5puuPuxzMGbaNcMAadh/tJQ/TVyD8jLppBCdpcmlZJl2La89V/SobAigcCDorlhG6yoDUFB7l2bXx/u7gKUZu3g8FVE4rMXBLedsd+nZm1LuNL/H1XmT2S2zuftxfIoBg4Gvj7soSA5h5VaD6me1vUmVU2fF7bI3BLgjKXQHK2//te+1p5lJKhUZvZaDnIFDUKoiZFpg== 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=8LXZYJ3IF5YwIJs7/2QVzJbgQ0tay2z86vhYBUXlFls=; b=GukLpCRdkDNd1+Q8Fuq5R4SmINQyUwfRvAlF6V2MyDC3Kjwc6OvyMN8sBRg0g5mTg/b5R9ygTEuvu2CPP1ShNHt19blV5f8A/sNGrkjQmbePAjtIksX2c2eDzUYY/5vCa/ulOtNcbH2li2ZhoZPfdZEDYxHL2krFCePKO8xuNcmD51CrQckckGNY+AiGOWZSQcGTs59kjaLPkSVvMABkDy+GJIEfcs+nMn5fFS5qa5qO81YQCHvWV7ueUZUuQJioKYn/gR8PbOZ3Xj5RDbmJuVXx1Lox4Sd2RU/0kly8iw1Te8U3FFozlAeAu85R6EP9nO0jCbpSytIn7AFvy0lZ4A== 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=8LXZYJ3IF5YwIJs7/2QVzJbgQ0tay2z86vhYBUXlFls=; b=kApGot+ru9Ozl1Xg/OMtUn9lilmbUIPbpZM1cB4k+bB8e4lQAdQbVOnIQo72hXx7Ndik0vw5EtHgemeAWWMStQwurPsB2TObXXRrfSTrGaDrf77YdE4ijHnrNaNT+PROorxBjm5rh9UpfJ3Kgirpwl3GaOuJGdeQb1VkwPxHCKQ= Received: from DS7PR10MB5117.namprd10.prod.outlook.com (2603:10b6:5:3a6::17) by DS7PR10MB5133.namprd10.prod.outlook.com (2603:10b6:5:3a7::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.12; Tue, 10 Jan 2023 21:28:40 +0000 Received: from DS7PR10MB5117.namprd10.prod.outlook.com ([fe80::93ca:e22f:aa6d:94d9]) by DS7PR10MB5117.namprd10.prod.outlook.com ([fe80::93ca:e22f:aa6d:94d9%2]) with mapi id 15.20.6002.011; Tue, 10 Jan 2023 21:28:40 +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, jhubbard@nvidia.com, Sidhartha Kumar Subject: [PATCH mm-unstable v2 4/8] mm/hugetlb: convert alloc_surplus_huge_page() to folios Date: Tue, 10 Jan 2023 15:28:17 -0600 Message-Id: <20230110212821.984047-5-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230110212821.984047-1-sidhartha.kumar@oracle.com> References: <20230110212821.984047-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: SN6PR16CA0041.namprd16.prod.outlook.com (2603:10b6:805:ca::18) To DS7PR10MB5117.namprd10.prod.outlook.com (2603:10b6:5:3a6::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS7PR10MB5117:EE_|DS7PR10MB5133:EE_ X-MS-Office365-Filtering-Correlation-Id: 13bb35ca-93b6-4bf3-87aa-08daf351a488 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2GxtNwQ8zfWyyIXBljBK/5885SE3Xvh1pSEOBIzJzuzMNDFhi4kaHwUtzmdkl88LwW3C/mkj8zDLKI7gXCDkVYdyP6Dp8R0gXSRpuzy6Fbxa6ikurUoPC9wRGl8nhrZ3UqUSsFo6mGc9Un7jhui/3fJ6qqn1cp0lwSAymhlzRGjOWlYJfWk2a0P1TpxvdqZ7xdP0/CpMa6L5QDDk8+ZbFvnTfeoiJ05iBzTZkmsFu45Lvwj1RnldFU+ZAwjDCeM6BWPAhUwO1ZcPw9z8jTf052BldLz90ezDQ+OISm6w1EXnlawF0NUSDUyMyHfZaIjk8WcUyzXeHFR0rvmilGyceeCicXY2W/ZpMKnJw8WSZDSWgd7udX/1f044EXVrATe5aNRmKCnP8l3O9inmlLJ/g2pXfSpnjKb7zwVac49qUsF0f69R6nng4qVrhm3AYKXcE5Wa1+4yQdY8kyoC0Vh63qhQCNvmxM9YtkfMMxaEoulIt5afP2FJosd0Wj0QZqbI3uviVZ4lTy00rfXP6vxJOGl/X1vqy3U5Uln5RPaNdTcWH70AG2W9UxiMmpm5JmPcVarnfbSHZgDPemR79FItLLmGK6IOm8M1hpSVqdR+dhQPuOcP4oMgewjPrS/duAODtfp/DjpOwpwBctH0dAIViUuufEtsDCR7ThgA4Fq38c4nKIlgPbwyi9KhGoNg6QiG X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS7PR10MB5117.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(366004)(39860400002)(376002)(396003)(346002)(136003)(451199015)(38100700002)(316002)(36756003)(5660300002)(2906002)(41300700001)(44832011)(86362001)(8936002)(66556008)(66946007)(4326008)(8676002)(66476007)(83380400001)(6512007)(478600001)(6486002)(1076003)(6506007)(2616005)(107886003)(186003)(6666004)(14583001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: tQUB09hrqR/ZraybNqzfdzZZp0FPodD0QdtV9aAQKyo0wvWBDVLLps0C73WQCdJZ4/mKxgzYxsZvxrtE4+I5PHaYBzmuHqWijfHuWdOuu0dHxYefP4HNTuzwIEoj4iNnn1fsQd27nMoU+O5OP2lfqGwoajC59dxbnQHqs5C4y0SIT7fzuzf6cvbVUvjlZsoESwLipPIorkhHpdvtcN6xBxHg7KqVSZTPX42icA+NkeYvnkLH2oalg4efiFqxv+noFRKPZr8VnHN4unCEeJUptjaYg9gbiS/Zh/zSJsYJ2vkgtDkt3Xf83mzoTuIjsMgnDs8y8C8ElRPlnwcflygI2VZumzp1CBXyDmzA9neEo0uU9RoMfgzARDkFC7kzHR7kmjA567QuJXZ03c1vZATtmytRnR7M4YTdpiT8nYnk6bdYmr64bENe2PN2ooAs+UIYeOpqjyqeuaBYhjXMK8vyzwfJIFqtkAH2kr1Q+li6yo/b2zGyaGa0Wz0+GzjhkGawakNjKtyyChYmCRdRljqSSHBEGNCNsRMT8sjrC4YxWDGMlZEjNDrHsYLIEyRbuxuA6Q7Kxd4UoL0W34tJNfl3TJj6MppJ60vMqPbe8uw3mMRhd26QbL/PVSzSLRZB7jNRxGIC0Vul2kafDDSYtATAvQfiMa57abDzyiO/SVagXKjPNsQiUHbnzBi5wOO+r9k2xMU9UgWOvXLVpXifDeLNus13z6Tl3xauwCxdXAaEQ0NpYq2O/Z4bAQWBbnaptMsoAGpHyj+6ekytGL3gITzO3nh7t/p8xKGE+Rir3HmqAaImejsaKgTJHkGbGatlgSRdTrAGciOCLVlBKeyWDU+20IOJccNaaVr9jjdQWuZn1K+a+W4hgS7SNagN6XxeYcmIBlBMV9l9bsfWoO3ij4VxriHur+jhO5HYi36venjZgJRo11nTN+Kne4yMIIqVZdtZimlPpTmqrADoRgIy6hCjlJtZPJ1wKhBGXEAzO4JK2/+vy43inrsldH+eX8HQp61UmcERGX1HoKQqi/j5eB7YZaAyNJFwh2EdkGwym4z5TdATWXEPTzDukMxilb/x7igrUzdrhyK7alEnnDNTP/18w0+nTLFsIxmUEwE7tsF2wlBPsscGbjFCd2Cas3dhjjoy5CxAlwGV61xxiftnoOhOGQmUtYCnKisHIzPnYwa83MJypkLPeXPQiQgs5c7X76zUK/6jO9YuMbZrb/QnxGIeipuPW8BatEqGoX9bxm173KoxYmTyFfu09yCfI0wBRy3N599CAbkaHb5cERwp46xoZfjbu7xlUVjVH4/zN2FPe/B2/ndqx4ddqQrY2OqhUlvDJWLWtnYThocfGPklc2m9W+0OGs/nZ/tJYpv8K8Lgo038PonWQd9qQGvCLH3O2ASNMfONL9pMhH8j8uPuWZsGSbpFGF4DjkRVxws1BID/D+/OKVv8ywIrgAzim293/cRvaBqmUMtIo0DROuBLUdFhKPhFHFjgseCojr3z5s27JFx6rLbFvcASWzAKwLAjP8DJux6o0caFQSpSTfNJeGWEtugziCpeJ7vHZdw855cw5mxlgSqb01RR3hO74BnBd4b2Fs1AosF8CJpbteL8tHg41nReSa6vMxMiVJadK3V8kXY= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: WLXKdyFDxDuZGgbzCmMs5l2Ck9vVGh95OE9yDUJqjiWqmaXnZng5WOZv7Ps9xRH5m4uLmbFqQdLuL/zhgnzWbNxqYe+jDgxnYfJhJOZEYrvWH0bv12sS8cWmXWm3CMgHSKKKBQ6Ftx6njDEgWPAsomAlMDEdKZYG9pBI1ZLc+CEqWpSBSJ/IkRNmtB8JRu3zMZvSzlDP1HRmbQ800X2c09g9/zRR4e1FJyu+g1pEJnjpAUECvT7v1yiOMkc92wjeNDex3e0DVEOzS+Mnhtwe4wWf0sRSnifVOXO0xP1zeHsbmB8KvycgYftbMiWwdmiaBVzledsKbZt187KHRoijSzLKMhoTI9bvzaCRhshB7MIdspq2tjo7G7dfePBC9MZNt/lVwPda8I/mNEJvS7hgxKVGUajBUbdyPflddgJO1yKxk+eDc5lzFvJuk484nz+4/DdB78Toimtv9w6G3RfBaHwF0H1oznySMfUMTE+07XTFEDW4HCi47yD6sQMaMEb1tWLYo47/1sAwTxKyIzEylUuuIiUlKx5mFoY9yPgsWF0vYjkt11H0xIigYklr49JRFfTdKvgd8ftYSNOrK9qUOcrkJfUDCF8/7U7X7N1082qzRniWyisJk6ygqp1HnnIIeEmwa0QK+ZG8AGJb2vt09TiJs07ggZe0I6IcvQjaLEw7WMV7yxeFcmT9MWU/SAPNZ4dnq2JT/O2/Gi/V5NRzUtEyjKujjoXoSeCCTUhA5yV0oaf6tPSbl1yToR4oSce46pqMYlfze0GpBiKSbOEn0+xYh8Go7l5F6evwsigwFvREbrb9kJa6cm/Qy8Yz6/gRfnKxGcmaaz833IOZsuR+tNdOPf0OK/VAc9xIsHvqsdN0rYiqM+vli/SY/XTpjuBu38x3Jx07AIdHUo51EAe2q6/cdfqaNbjq95w3Idv/k6YvXhz3N22hA+ipJyovpin8 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 13bb35ca-93b6-4bf3-87aa-08daf351a488 X-MS-Exchange-CrossTenant-AuthSource: DS7PR10MB5117.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2023 21:28:40.7313 (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: 0rNl2NzajHxHF2kx/Jsej0Ic4/Y8SdimmIcriQwIs0uCTwnBSXQPho0UpUa1mLMUm+2zDQP7PE0ALnTQYmG3gik8/maBieh6mENKZ/cxTUI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR10MB5133 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2023-01-10_09,2023-01-10_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 adultscore=0 spamscore=0 mlxlogscore=999 bulkscore=0 suspectscore=0 malwarescore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301100142 X-Proofpoint-GUID: X8_GjbM1-XiPd5aTgnVEMPyCWNJx3trr X-Proofpoint-ORIG-GUID: X8_GjbM1-XiPd5aTgnVEMPyCWNJx3trr X-Rspam-User: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 27868100006 X-Stat-Signature: 85isobo5r1a3isjkdscaxdps69g47yns X-HE-Tag: 1673386148-146487 X-HE-Meta: U2FsdGVkX1+VB3NFBqYx1gQDts6vT0a2Wg8laZeY6driaoWpqlbItXiP0cDXv77prQuWSKYAYPOK4xapzOxz5rN5kBwdnCgbLLHjicMFRBmqcALdaOLX9XrPIukjQ8Fve/3uEM8dsTo7DEcvkQBcS2t0egwWzzX7FQkbaVNMuF501aAbBMYrcG0SzOE+1M5y1sXhVPOZwbOhByiljtBPC0Y/jZV6454MblunwILwDsIB4w6hxCUeh4wEgtthCDptVcoP1Zre1PiWpyC3CIBKlgOauHCl5oCg6S2BVTpxbXX4xiDZv74Y/y2bSSZRARvpTK7LYWOByuJo6EDgr4X4x5dhbwdISaiGQZlScEVg1vLVw+Lzl06evx1/Z/VEovDH14AmcsiRfea3yubFlnPD0l6Q32Y/nv/9wMQFDM7Q6vsUkJEiV+a6HTPj6LxC7J4AZE4nvoNJ+cFVo1xNS1yVfzQT9BQdxcW8yzBsVSxOIYBEe8CDlD6IRyU5ZKoiY2rKF5prxK+mjCrVPYcY+2O5Td4s5ulYJ5pt9cZwbDDJ8Ki4qVFcol23gAMfQoE1K4MN/ALdATNm06fbP4yjKJTT3JldXW07uPJJmaVlp7mg1EROquENEeyrK75Q3XWDCr3eNcGD9JHRfOYxxMdi3vmNuVFdUSGWBy/gq/PS3TuipyYaeW4DfYfIPjQG4mySoVzP8vza8DrK4s0GVwnR1MlS1C0zSU/qcxUXD/Igjn3qHhSUyQ2+GDq5H9p91d/xf+iIJ9t0rODWaP/6+XJCoyMaAzcuxBWB40gXJciz22IrLM+XZA4OBpCln/FJn+pZVP7VNzuE8CMeW17xofZLAmRlTvm247DinInRlRyRlNmwtCv/84J33FCbQbtVmycwNPyy9oG8/IHRaW1Sj40oJ/EFkFWdqdEUfRwkkTmKiHu0Ke5PkZcQdidw0mNn+3Ac2Rw8WujNw+cA4+yDPfb73XQ 109hCspv FIiBRsMvH0yrjvP+ts4HwDR8hwlbJ/JtaSGMiBxwTf84v6B5hM4pC4NR6XP9fGFDze0e7/48Q+R1p9pK6lisS1/RXlbu5s7TiUDzT4goL5+43BRqGYCCIQ5pT6twJvudUcfqu3R9MnWQhh/gsRhaYU6SY0Q== 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: Change alloc_surplus_huge_page() to alloc_surplus_hugetlb_folio() and update its callers. Signed-off-by: Sidhartha Kumar Reviewed-by: Mike Kravetz --- mm/hugetlb.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index c206a8c1ddb6..62552172683a 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -2234,8 +2234,8 @@ int dissolve_free_huge_pages(unsigned long start_pfn, unsigned long end_pfn) /* * Allocates a fresh surplus page from the page allocator. */ -static struct page *alloc_surplus_huge_page(struct hstate *h, gfp_t gfp_mask, - int nid, nodemask_t *nmask) +static struct folio *alloc_surplus_hugetlb_folio(struct hstate *h, + gfp_t gfp_mask, int nid, nodemask_t *nmask) { struct folio *folio = NULL; @@ -2272,7 +2272,7 @@ static struct page *alloc_surplus_huge_page(struct hstate *h, gfp_t gfp_mask, out_unlock: spin_unlock_irq(&hugetlb_lock); - return &folio->page; + return folio; } static struct page *alloc_migrate_huge_page(struct hstate *h, gfp_t gfp_mask, @@ -2305,7 +2305,7 @@ static struct page *alloc_buddy_huge_page_with_mpol(struct hstate *h, struct vm_area_struct *vma, unsigned long addr) { - struct page *page = NULL; + struct folio *folio = NULL; struct mempolicy *mpol; gfp_t gfp_mask = htlb_alloc_mask(h); int nid; @@ -2316,16 +2316,16 @@ struct page *alloc_buddy_huge_page_with_mpol(struct hstate *h, gfp_t gfp = gfp_mask | __GFP_NOWARN; gfp &= ~(__GFP_DIRECT_RECLAIM | __GFP_NOFAIL); - page = alloc_surplus_huge_page(h, gfp, nid, nodemask); + folio = alloc_surplus_hugetlb_folio(h, gfp, nid, nodemask); /* Fallback to all nodes if page==NULL */ nodemask = NULL; } - if (!page) - page = alloc_surplus_huge_page(h, gfp_mask, nid, nodemask); + if (!folio) + folio = alloc_surplus_hugetlb_folio(h, gfp_mask, nid, nodemask); mpol_cond_put(mpol); - return page; + return &folio->page; } /* page migration callback function */ @@ -2374,6 +2374,7 @@ static int gather_surplus_pages(struct hstate *h, long delta) __must_hold(&hugetlb_lock) { LIST_HEAD(surplus_list); + struct folio *folio; struct page *page, *tmp; int ret; long i; @@ -2393,13 +2394,13 @@ static int gather_surplus_pages(struct hstate *h, long delta) retry: spin_unlock_irq(&hugetlb_lock); for (i = 0; i < needed; i++) { - page = alloc_surplus_huge_page(h, htlb_alloc_mask(h), + folio = alloc_surplus_hugetlb_folio(h, htlb_alloc_mask(h), NUMA_NO_NODE, NULL); - if (!page) { + if (!folio) { alloc_ok = false; break; } - list_add(&page->lru, &surplus_list); + list_add(&folio->lru, &surplus_list); cond_resched(); } allocated += i; @@ -3352,7 +3353,7 @@ static int set_max_huge_pages(struct hstate *h, unsigned long count, int nid, * First take pages out of surplus state. Then make up the * remaining difference by allocating fresh huge pages. * - * We might race with alloc_surplus_huge_page() here and be unable + * We might race with alloc_surplus_hugetlb_folio() here and be unable * to convert a surplus huge page to a normal huge page. That is * not critical, though, it just means the overall size of the * pool might be one hugepage larger than it needs to be, but @@ -3395,7 +3396,7 @@ static int set_max_huge_pages(struct hstate *h, unsigned long count, int nid, * By placing pages into the surplus state independent of the * overcommit value, we are allowing the surplus pool size to * exceed overcommit. There are few sane options here. Since - * alloc_surplus_huge_page() is checking the global counter, + * alloc_surplus_hugetlb_folio() is checking the global counter, * though, we'll note that we're not allowed to exceed surplus * and won't grow the pool anywhere else. Not until one of the * sysctls are changed, or the surplus pages go out of use.