From patchwork Tue Jan 10 21:28:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13095678 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 CE029C54EBC for ; Tue, 10 Jan 2023 21:29:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 40D4A8E0003; Tue, 10 Jan 2023 16:29:02 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 395A38E0001; Tue, 10 Jan 2023 16:29:02 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1E8ED8E0003; Tue, 10 Jan 2023 16:29:02 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 0A9E38E0002 for ; Tue, 10 Jan 2023 16:29:02 -0500 (EST) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id ABC33143ABB for ; Tue, 10 Jan 2023 21:29:01 +0000 (UTC) X-FDA: 80340179682.24.F90D31B Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf07.hostedemail.com (Postfix) with ESMTP id 749824000C for ; Tue, 10 Jan 2023 21:28:58 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b="iMO/PPaj"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=RiPI0k9N; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf07.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.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=1673386138; 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=Ue5KRszYjMTnj2K1AHindC7y6fInHEG2p6kUaNmTi8A=; b=RwEMxHA+yeWfkrx+GxfjOEvr/118gOw/FLkaM+ZsRaKZ55k/YveOeJVQOwsNqospXWZ0DV hjy/nyvJL85QYLdWsYICrn/ACbLztHStCB1WXAdLX0E0rJFSUGlFbjkyn2q3lf3oBZJq59 gdb/152iyWOB0QTs5PIa7uN84bTmkfg= ARC-Authentication-Results: i=2; imf07.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b="iMO/PPaj"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=RiPI0k9N; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf07.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.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=1673386138; a=rsa-sha256; cv=pass; b=Hc9ToFYEnbLU1cL+iZL1X/ZHurFaG/hERcE9CPpViQawLGCdFV4WQXivYcWagoeMVujSbO sxwmmfAquoIaiUBIh1S+YFah/M26u5kuljI1j31BPjbFcBMdlmm+ns8JBwsmV5x7KW4J2c EDb4xDfpn+2tkzwrBOwWbYZ4czSw/b0= Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30ALGkw3030256; Tue, 10 Jan 2023 21:28:35 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=Ue5KRszYjMTnj2K1AHindC7y6fInHEG2p6kUaNmTi8A=; b=iMO/PPajVxFO19BeECZndmlvYZIh0EAoodECKmu0hzspwbUcmQW0WBPLp1A3YNOVeTVT Bnp5CAmm6jFu4W/pnYgeF6Kkwt4tPnEL/9ctbxJaq8wkkulj956Tw/0TtsMHUwxgjTrl EWTMKxQCWGGP5eSINKkpKUwes74b07QTotrmVELXx8hCUONUrHpI/k7KU6CkV0SsxQye zCgUTZ+lp5mC0EEtOitZBpJWX7A/cjBxbgaap5bnca4uRQ8ddJlNKWC6CYjlvy8KyiRR +3J2tp5cz29In3YVCjNC/XysnVFcNviBp73Y0ZOZUOqvuI48aJ4WAy0mRFn/wLejJ5Dx Kg== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3n14nf9syr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 10 Jan 2023 21:28:34 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 30AJcce7024447; Tue, 10 Jan 2023 21:28:34 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2174.outbound.protection.outlook.com [104.47.59.174]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3n1ebume2q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 10 Jan 2023 21:28:34 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=chM2DfBur+/QebBmLXEUfooxLCLcIuQMMGhLtl4m5kaBlcxtqvjtmoxgJfpU2hn2nsnwBEKtqeabIYBmXOdl2VCGAcf2HagvcsB6rMyXgzv5l5zRfT5yK9h8JfqMNTrT5nyDdEknZPT54FEjE7JMIY8326vsFERL492YJ2iyynjbJS/olx5eOwg2mjfk04lvmk3LGPInEn7xwR+nPRlP6SH7N5rhZ4E8LccR7M4axqEPF9rs9BUItC5hA6dIQ0Ugl5AgBFoyW8/X4qZdd2xxb7tKnOGVyDTzVg7Knjx67fU81th37jmRllhVz0v+476TLat1gT4ShDAxbwOtGHQ8fw== 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=Ue5KRszYjMTnj2K1AHindC7y6fInHEG2p6kUaNmTi8A=; b=jLKNzCfihGbsy1d7IGSi/IFxG7vUsLMoC7ca8+3bbq9Cnp7fkJ8ZCpaeybs+xeGmFeLgzYOiPaOXbb+EvSYhKwyDoKyYRQCqdvUurOras3eq29KA4ZRFzXF27k2z/HA6l/ZEPEzm6uKY+1GeS4MxDvO2lfoFmsRbvlMGNJGxw7JJtq8QaDNn6pzBCvk+CVwkzoZqlRUI1pWhtEAD4v+Ita2X8UlIVoHvY+CBIOgZTjsCNilZPpYZKVvOBF7MLqREbowVAjdcHhPtFGqOKAkrmh2wyEYozcb0cKRbIkCvkllq+ZthQKdzdQb+jYP33463UmT9GiD4SmUtJFCuycZ+HQ== 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=Ue5KRszYjMTnj2K1AHindC7y6fInHEG2p6kUaNmTi8A=; b=RiPI0k9NV9G1CXpmf1US8IqMj6F6qK8Ya9sCjgIaP1r4wnnLNeWT01lv+90+94zE2LqB63/E+svEgJrjqekHaIILgnQnZBAOcU6Z56WvOgwktZHmpjXBAfEI7fYy//K6pRd8rsCboNfCdH4eg48dIGtXvYQU13vhk8odhZNosEg= Received: from DS7PR10MB5117.namprd10.prod.outlook.com (2603:10b6:5:3a6::17) by DS7PR10MB7153.namprd10.prod.outlook.com (2603:10b6:8:e0::18) 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:32 +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:32 +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 1/8] mm/hugetlb: convert isolate_hugetlb to folios Date: Tue, 10 Jan 2023 15:28:14 -0600 Message-Id: <20230110212821.984047-2-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: SA1P222CA0027.NAMP222.PROD.OUTLOOK.COM (2603:10b6:806:22c::11) To DS7PR10MB5117.namprd10.prod.outlook.com (2603:10b6:5:3a6::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS7PR10MB5117:EE_|DS7PR10MB7153:EE_ X-MS-Office365-Filtering-Correlation-Id: e7a814f3-84ea-412f-10f6-08daf3519fa0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: a5yDz8nknjeIaDQRw4n5fvsVxDpHdXxoqDwTrvyBc7qCFFoYkmXoBVjjIYnx/dCfTUaQexMh18WHh/0mf7lJjZD2NgdOTXXkME9lHJnDN7lbNrKOlgDuVc4Gy90eNWDqKA2DX01hFDPv9aSwlKcQtsHQJGbyWjdVKb0KRFseXdaktLk46SnDVB+rL+f2JqiNz0NeygOzPD3llRnmKbmIcoAHNCIZdmovOZcSbyNC9Xox7m9LJxLR/7vL8qtXpRKTNhBJpvoP5q4p+qgYK4FqatyXPjqtiBVlU9LoqE5Tnz/F60XOXSmRRaj76hX50CtA1mt3rhSr7qwFiRxXIzHXsRtbbxeAXv11LwrvW6TeZc20BrGggRly4DafCxZnwligd+4D+KouQXd3LkMt2FglYEgXBDS4gGQUtUI0fL2kkI+xbIBI2b750z7/YnonVJnbLEYNrYgIUr99bxbFch1NULb0WSTfrD+nPH2MHsrr2VQs7Jbe/JQk8/g/pbL/y5wR2FbIf+cbR9jyKOg9ndW6OCP5/b2gaTb1thD7iQa1zxxPF/bpUkzXrlT2BHt5DFayDn+QyhRptz2lPbkjTRoRFRAynJXGph++ZXWyryejVymSDytBJwepJoW4I5MP23Q0iLYMYGcoxkyoq8pVPtNhtQ== 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)(376002)(346002)(39860400002)(136003)(366004)(396003)(451199015)(2906002)(5660300002)(8936002)(44832011)(86362001)(36756003)(4326008)(41300700001)(8676002)(66946007)(66476007)(66556008)(38100700002)(316002)(6486002)(83380400001)(6506007)(2616005)(6512007)(6666004)(478600001)(107886003)(186003)(1076003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: zZnn3cBj7RDKUW3rBwjrXZ+9I/KAPKVnKOdi65DF2Aa3Q/qKYc7NMr7Z/atEHwTF5k50EFFs7C0Hr6aPriXqiZyCinXEptBiV7wJJAiRV+prG9b3yUdT/SWC2qltoQmYo9UIuT41kv7sJYhdWMj4jBtsbJIQwyBNlolQ3bZxPsN5NbsrSbd7E9PdaC6Y4zc74xGcmSwm2DTEZkPBzaBkIcEXGk8AWbIoZkeiID/wt1L4PmcQyBYZYLQ0XmNvERO1qhaSjVU2refiLPUXU+Mtp3oLyaWnwM50a9j87PaXThVHJDO77G2OTPwgU2oseUFlLkH11CeM4Sp08zfrrVhNjBsI1yGsZbhaatfWhRbiJKD0omgCj8PpqtQHhY+4eDxyLjjVRc9ljlC2G9az9UEX65AnV15d56CDKOidMbZYSWfGFG+PQ3CtXhSqsf7jvF41+i+5HD++XMpk5xxREx3BJ46gTCbTeMVfmI4lC+vHIAqB0ZLytnslxH8p6oAcAACIqp/wuVtvPKTWJs65IFpOgYp1DcdUq2dnefkfc5+gu6VygZBeB50+HcBE75pe/LaeTD+PnAMYYC0IJwLHSaNCYtT2//78q1JimhtYRYrUEE6OqYha1TPKx3bXqcQJ8K2/8kbdzUUKE3tF8HaVwE7JlXP4fZqCGiLsjVNXgsi2qeS/6dbwuxUtFwXarJHQvdygXzRH+k6GcidzdrqjwMOhBPqX50iuP3FfHbfdNHC8yf+AClXNsrZMpQyo+X6EEevDHZUEg7t2nBsqA/oeS8Jw6wGnOaq19N/6Sq8jN/cNf1dW7qt18iJbybdWeMKkRcQAoPowFfcX0GH126mvLsFpsHc1hep/txMk6yWKyaPx2YW/LVRci4eyKBbms9YwSeZlbV5jEE7d0fXJfCDK9DmWA7zZ4a+D+HEv7O/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rauOqqJzt1zhYnaPAt8FRyvesqiFWOgFAUpJGJFk8TY8jXyJQa/ReqWYCexDTcYEM5JOKC2/DH8jE0KESe7Qwk3Vr0HeZxBlMs8mIjFGhoPb2rZeBWdr960RvzT02SiH6m9qsI/iihxdFLJCDarDAAjt9v41G8a1J3zqOhE3bfhNcXNTFZ4ue5/5EzpWr6R7qlWIz3zFfftq7xl30/J2IqkXgAsvN4y6QYDzrg4by7jp/2Y5he10w+H/ChYIY+CWOk17OCq5EjXHQHmib1cRY1uIAVyJ9C9i8T0GSZ3VoF03v9HBliRT73adx/2QewPNtZ3kKrV0vG9GBzMFh7Rm5WkPD0IMyr2C3HLbyBchFCshuLSn2w47kqLjSllZjS8xXwU6vxI9QEmjKyLa/9i7HpYh+jhbDI3IAt/vFLwPh5CnpYAsHbfJ6rCANXwmkDAdWuiYQ6Vv2HhxNvYAzvjnlX5clg8YwVJwP4IZj1UUSBv1nDnhQCxdhubZTygkpAtYcypiDeIWsZCPj7wvNFmKCkUgfT1vUwizLulNWvKNL2/JYszeGBOrvoo/8A5VeR2Cx95IDlWJ06AWJ+TGSKvhMU7WMq4YdKX5l1jTVHbdDYTNgJFg22FFepmQnUXeti7onKpSC62rjmzzrN1t6SNnMVTUHZ37cwtDu+EAT6lvw2B X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e7a814f3-84ea-412f-10f6-08daf3519fa0 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:32.3720 (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: I3NNSGOHisfW3M20/hUTBQeNx0yW83pww5Zki1QfvD7QFD9by4wZbv9mV7gL/t3iqdBktJMo/gFApJrBG7uI0Ry7sRGQfB8dtIM1pVI6z6E= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR10MB7153 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 phishscore=0 mlxscore=0 bulkscore=0 adultscore=0 malwarescore=0 spamscore=0 mlxlogscore=825 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301100142 X-Proofpoint-ORIG-GUID: 0nUvyz0MlfwaLtX4PEUnXexhLEvWSstL X-Proofpoint-GUID: 0nUvyz0MlfwaLtX4PEUnXexhLEvWSstL X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 749824000C X-Stat-Signature: 54nfqsquefffwj5tiffdd6u99f3pa9hr X-Rspam-User: X-HE-Tag: 1673386138-650377 X-HE-Meta: U2FsdGVkX19ua9d9HqvzhuDpxHaM7BZ28VJXTixamqngL90BBvgoU3/JOb0dn8oVYJSLmvPO5/3aj0H3HNBHaUADYtjYRev8vUJAb+NrE7w3uyMYzGQqYKGSW3k9vl8CqBOQsKhIoFT7K2gLUeJcrpF8v7vIJ92LOtMQhCecgnyF6ICED8mhTRMv3dixFF+Q3dSJSN5VXZLCHhYaLcIHC5b3sejZf7OQpILsvCZA6JC60zTRTAXBHUBpumPC8c0wQCLoiMLYl3S2nW+fSE9+u6mORQxHyRffNGduhYr6hurcMWr5U98NMvfDxGtG8vPgW40piMAdw+0IBNLRkqqnVsnbmAF1zWv7o2VpSOrGRHn2jlOD0oq0Pp6pD6v8SCefUbXz/ZVpG02/7zo6fgNZbu6OBYAPtHG59j5TFG6F1hCsLHXTTHiB17KZ55Bc/+Epgc4/sTYFaGH+R7b7wSC3qMLm90sik97AcrIZ395gOnwHwJm6RhJd65zt1pf89ymSZkb5AaiSNUmZMpWTewnuPdDkRaaJmrOLODauloK7fFr0dSzMMzHZTGU/eamvf6EWYo/f42DbxQ3fiV5Vdzzg61I+q6UF+XYsNGPyd3r4fKxt40LWJ70q5Hix/tUYFYEn76rz++2wsRSv3A1FCgGrIMt8s2HSKDDM/9REYpXdoQQ7sDcpvjkbqC6yfZDjNlkhwZyWLFr7YxoGr3A205bVW4197g/lcy/obZn/Qepmo8wpx/Gx1ORskgVpF49KEGwCd+6NEvgmYyl6MzaGOJFRV5k6OcGKLFeA0w762eVoq0h/5FDPRnjlMlZuTT8l4MaQxKX4lEnQiZ4tbNI3Tr7Mka2wcZxJUZWkPvl9qFNL3fgUfQw2sGTwuoKAoRRbLoc5t007rw0JNG0DMgA4ps+EXBL1NsTsimN0sk3KYIZ5xoMlvfOe4Q6IJ7U8rVWPLcEPIDGbF9tBQuFn1S7NZVb vrKD6NKT 25J1uOqvwz/uQQeETffjPvnZu6k1UglKhuS2I2PQnB90FrbUGlEk+DtS/BwX+xAcP1l0SjkrbEmCsy9jO6/4iloWsqpFGgP87LsaltH4yz6EJBlA2wbAWilAXIJfj6bG1nvDcA9OyidM8B/6l8mu1W+5Beg== 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: Convert isolate_hugetlb() to take in a folio and convert its callers to pass a folio. Use page_folio() to convert the callers to use a folio is safe as isolate_hugetlb() operates on a head page. Signed-off-by: Sidhartha Kumar Reviewed-by: Mike Kravetz --- include/linux/hugetlb.h | 4 ++-- mm/gup.c | 2 +- mm/hugetlb.c | 16 ++++++++-------- mm/memory-failure.c | 2 +- mm/memory_hotplug.c | 2 +- mm/mempolicy.c | 2 +- mm/migrate.c | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 551834cd5299..482929b2d044 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -169,7 +169,7 @@ bool hugetlb_reserve_pages(struct inode *inode, long from, long to, vm_flags_t vm_flags); long hugetlb_unreserve_pages(struct inode *inode, long start, long end, long freed); -int isolate_hugetlb(struct page *page, struct list_head *list); +int isolate_hugetlb(struct folio *folio, struct list_head *list); int get_hwpoison_huge_page(struct page *page, bool *hugetlb, bool unpoison); int get_huge_page_for_hwpoison(unsigned long pfn, int flags, bool *migratable_cleared); @@ -374,7 +374,7 @@ static inline pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr, return NULL; } -static inline int isolate_hugetlb(struct page *page, struct list_head *list) +static inline int isolate_hugetlb(struct folio *folio, struct list_head *list) { return -EBUSY; } diff --git a/mm/gup.c b/mm/gup.c index 5182abaaecde..bdb00b9df89e 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -1843,7 +1843,7 @@ static unsigned long collect_longterm_unpinnable_pages( continue; if (folio_test_hugetlb(folio)) { - isolate_hugetlb(&folio->page, movable_page_list); + isolate_hugetlb(folio, movable_page_list); continue; } diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 0c58f6519b9a..540f33d8cc51 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -2781,7 +2781,7 @@ static int alloc_and_dissolve_hugetlb_folio(struct hstate *h, * Fail with -EBUSY if not possible. */ spin_unlock_irq(&hugetlb_lock); - ret = isolate_hugetlb(&old_folio->page, list); + ret = isolate_hugetlb(old_folio, list); spin_lock_irq(&hugetlb_lock); goto free_new; } else if (!folio_test_hugetlb_freed(old_folio)) { @@ -2856,7 +2856,7 @@ int isolate_or_dissolve_huge_page(struct page *page, struct list_head *list) if (hstate_is_gigantic(h)) return -ENOMEM; - if (folio_ref_count(folio) && !isolate_hugetlb(&folio->page, list)) + if (folio_ref_count(folio) && !isolate_hugetlb(folio, list)) ret = 0; else if (!folio_ref_count(folio)) ret = alloc_and_dissolve_hugetlb_folio(h, folio, list); @@ -7271,19 +7271,19 @@ __weak unsigned long hugetlb_mask_last_page(struct hstate *h) * These functions are overwritable if your architecture needs its own * behavior. */ -int isolate_hugetlb(struct page *page, struct list_head *list) +int isolate_hugetlb(struct folio *folio, struct list_head *list) { int ret = 0; spin_lock_irq(&hugetlb_lock); - if (!PageHeadHuge(page) || - !HPageMigratable(page) || - !get_page_unless_zero(page)) { + if (!folio_test_hugetlb(folio) || + !folio_test_hugetlb_migratable(folio) || + !folio_try_get(folio)) { ret = -EBUSY; goto unlock; } - ClearHPageMigratable(page); - list_move_tail(&page->lru, list); + folio_clear_hugetlb_migratable(folio); + list_move_tail(&folio->lru, list); unlock: spin_unlock_irq(&hugetlb_lock); return ret; diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 63d8501001c6..cf60c0fa795c 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -2438,7 +2438,7 @@ static bool isolate_page(struct page *page, struct list_head *pagelist) bool isolated = false; if (PageHuge(page)) { - isolated = !isolate_hugetlb(page, pagelist); + isolated = !isolate_hugetlb(page_folio(page), pagelist); } else { bool lru = !__PageMovable(page); diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index fd40f7e9f176..a1e8c3e9ab08 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -1641,7 +1641,7 @@ do_migrate_range(unsigned long start_pfn, unsigned long end_pfn) if (PageHuge(page)) { pfn = page_to_pfn(head) + compound_nr(head) - 1; - isolate_hugetlb(head, &source); + isolate_hugetlb(folio, &source); continue; } else if (PageTransHuge(page)) pfn = page_to_pfn(head) + thp_nr_pages(page) - 1; diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 61aa9aedb728..4e62b26539c9 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -601,7 +601,7 @@ static int queue_pages_hugetlb(pte_t *pte, unsigned long hmask, /* With MPOL_MF_MOVE, we migrate only unshared hugepage. */ if (flags & (MPOL_MF_MOVE_ALL) || (flags & MPOL_MF_MOVE && page_mapcount(page) == 1)) { - if (isolate_hugetlb(page, qp->pagelist) && + if (isolate_hugetlb(page_folio(page), qp->pagelist) && (flags & MPOL_MF_STRICT)) /* * Failed to isolate page but allow migrating pages diff --git a/mm/migrate.c b/mm/migrate.c index 4aea647a0180..6932b3d5a9dd 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -1732,7 +1732,7 @@ static int add_page_for_migration(struct mm_struct *mm, unsigned long addr, if (PageHuge(page)) { if (PageHead(page)) { - err = isolate_hugetlb(page, pagelist); + err = isolate_hugetlb(page_folio(page), pagelist); if (!err) err = 1; } From patchwork Tue Jan 10 21:28:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13095692 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 B498FC54EBC for ; Tue, 10 Jan 2023 21:33:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4A5AD8E0002; Tue, 10 Jan 2023 16:33:27 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 456318E0001; Tue, 10 Jan 2023 16:33:27 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2A8A08E0002; Tue, 10 Jan 2023 16:33:27 -0500 (EST) 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 1AB658E0001 for ; Tue, 10 Jan 2023 16:33:27 -0500 (EST) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id D0C32160510 for ; Tue, 10 Jan 2023 21:33:26 +0000 (UTC) X-FDA: 80340190812.19.A8CEC1B Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf23.hostedemail.com (Postfix) with ESMTP id 8D8CC140002 for ; Tue, 10 Jan 2023 21:33:23 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=fTNoAIxR; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=iWkdDCSA; spf=pass (imf23.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.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=1673386403; 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=ia/pKYvs485DK07VT5Hlv1uptsr6AIwYUeTt8NNpORU=; b=0PfmdLr4LRRxuZmNK6ssLdRFVPB3wGZFmWBXUxO8UvQBO39a7W9mTxjYSa3/IGGkTdIs8c EUoHHIP1A/5BWYV28kcyW1YW+iVYnBERrGxjsBOAswODbHAhPWI6nSm4anTej2hjj1mGLA rgomsuHjtr1+Ew1X1AaeE8CEVPc7bxg= ARC-Authentication-Results: i=2; imf23.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=fTNoAIxR; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=iWkdDCSA; spf=pass (imf23.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.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=1673386403; a=rsa-sha256; cv=pass; b=vQKthKXNv1ecmqlwokmY4NohQzq9tKd8qDs0r9R1/CN3zs+9rJeJbo3cvi+MWsClDpShD9 kJrExC8VESeFsBS/A+KAT+2wltfUWMK8LrrbzVPBM21cmqdxza9YQOlFJcb4dExB6kTN/q uDvs85EPn99TNSW7X0JEHHLUaHqIhGE= Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30ALURlI023382; Tue, 10 Jan 2023 21:33:10 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=ia/pKYvs485DK07VT5Hlv1uptsr6AIwYUeTt8NNpORU=; b=fTNoAIxRBkWp+dRlqkY7ujQX9WGEtZJDvbyhlydkZfv53fbfajR067Rj3a6dcNYpU3W/ jUFl/9/NIG/RksQkLoRhM8XKR8ekr0jYPCVdcV2k/yuPycrfpzaFu+zZqkVFylq7lUa8 zoadp3gd4wZgFcyfmzOsK38lJygxwzLX8Aio2e9i+vILQAn56P3BNnnYxuDuePQJEDQL 2TyWkN3/LQQhqjWyDTHTVuP6s1OZfMKdbNdqXFhJCpoT9isVp/1W6beNtxfiFHZH/CTz FOpRIa6Cv/+GSWUg6/RBh8J7mKybr1EAiNKMbmkYuYb7JKTA0xdqPF34sNXJKv8gFgXx 9w== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3n185t96fy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 10 Jan 2023 21:33:10 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 30ALOdsJ003116; Tue, 10 Jan 2023 21:33:08 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2177.outbound.protection.outlook.com [104.47.55.177]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3n1fwera8d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 10 Jan 2023 21:33:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YddkCwTs2WJx6lF1QYlWr6nXo9uq68Q3IaF65ne9uA3+55ALdKrRg8LeEpYePctlEMvN5t3r+DRrdFT4ptitq2v0b4ImzS13/AafEchnCbFq3VObCwjLQdmDiikUH3QtLD0/AqWlxl7WVcGOjCIlqMTvI/yqhU5S/F8Wt9On/0neVbsN4ZG4MMRCGP0wEJl5NYSXpnVmDpGKPfXJDKq4GZBq+Vc42MF3t8kC1S3ttXz2X/XD1zdzjUpiJ2hU3IZcyDK9XVn3bEPH6ty0znyD3e7JB93BlJKDSOPpc0K/U7AX3Gcs1F7lyS8m4YQfRd4MQWaO3r8ycNzxGHaJlqebOQ== 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=ia/pKYvs485DK07VT5Hlv1uptsr6AIwYUeTt8NNpORU=; b=jspRWFq/I4w6EYaofsW5E0iB+XkSyEiox23EmSmaoSl3KZd0CSw+upZRrAoFx17FCCNgscI64gbvn87Vpn4kG02Ff2G++7SOt/5Blldp+k54cE54ccT3QmplpOnlDFCyeXuv2OPjMJT6qR/S6aUht27+LTvi0+weEDdsDSanPIkHfQp/CdgiBsTmBntXKmt4p5PXTn6iEzckuJoxGE/BG7SH4vO48Ky93EVzZSG5t+zOVKOFO4jRP+V0rIwfUrkxht2geCQ03bU8L0wpEXRk4IgHkFbekuvcP9cYKVoFo1OjPz7879Z+j+7M2Yel1Sb6ehGUlorunfI6Rg6tnbgprw== 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=ia/pKYvs485DK07VT5Hlv1uptsr6AIwYUeTt8NNpORU=; b=iWkdDCSAFFZ/Q9I9TVULsXtOXbWVvCss81IOOTDw8Q1zqQ7DiPVENV1JHsX0ytXZaBFlSVUYDWkhGqJAGadOJ12Z53tqWOvOujt1heeGZ43q2/ckRUI9CC9qXbvMrnm9tB/W4EH8p23q+8PHUrkHIf3Fk2tMkf4fQ7t3GHWm6ic= 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:35 +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:35 +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 2/8] mm/hugetlb: convert __update_and_free_page() to folios Date: Tue, 10 Jan 2023 15:28:15 -0600 Message-Id: <20230110212821.984047-3-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: SA0PR11CA0109.namprd11.prod.outlook.com (2603:10b6:806:d1::24) 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: bdae4b27-ffaa-4b77-deea-08daf351a15b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mI9lrunfJ2xs+JpKSSar20cyp8EwLL/4pNDZMnyrtDBiBX4zxs6ILAMWm77IIoiOIPSia23SFowSIY8KTV+Qk9kLPmn9jkQTh4Lr4Xu2Ggc71mOh3kV5KMYcvfaGXCe8XRZdkVU4VawuhNItrwA8olsA8tugZ9k/HcQy0kHyKb3ocWdFZHW7B0wBgl3gs3GrJAPoO5eL/oUiSo2u8J6Prlz4zFnsMqEhyEU3BFybmNNl0HTGVevc0DRvk+i7muIWaO5lYAcES/CEiS+lx643uDYS0DvlpHkU8abQ1LH3AYrCsfTciVg1it/5rfwDXT8cN91IpArIJoyJmeuz39s6279EHW3tA60eBIhcvcnL7KPeaBV3VjGGjTQJyij25YQfLVOSFI/T8sUZYlHp+foLufpsHuJadD34+52g2qW/JXcygKUJxAbGogj8N+MluZVViEjVMymRSUp1EKvlVHbktC4AMWIlfsvn//PvT13EH+bMhUkp0JzbTMMTsVWTVIuMosD3malqjhZp+zi16JlB1U9V2zqkYu+G9mW6DKkhIIft6U+UpWZ5sMfn6T5ZWhOaCEMOoWUXnQbMm4/PHuItaNvTESjd2Vz1xgHdVvQQR/ZjlXtsXYFoNUxXuAx3wf/QVIr5S+sHBwjO8WX4SqAlTg== 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);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1pf4ss0ZXrngEpP3s6Fad79txZOqDpBBGjLpdipeLg6G8e9jy+polv57fGNIxaCl0sH+r81aV/734H5ZSrhKMseLeczA6POCv6P64E/rR33aI33+eDIow7P8M6hxIdZxcbCawbgZeuAZPSYHs+9Iwm0aet+CQSYu/YF/inxuRys2xXV1fuIdgv5rdJKdlGDJPcfZxPxE7G30NB1ZuIYDrruavIeWDkm0L6s8dLO1d/C77HsSfgEF5VOXHRpoPb7bc1FruBO8Fgh2FYp63PNxQqpQbX8c/eiu9QVQK4aJK/P7jiwvRw6FsIimWAj4uRMy5G9qvlNV/taaLrIaq3Jw6Z/W2tSa9VksuMDIaGQvXiZ1WqahA3MHzur/f61XnJ3CKM1mnXbyTlMs2KbPQv8chO3UiKOFCRGf5BjJKh15rz5VeloitGZGJnE5OQNqni1nbd7Y0OAszuPJrYQ37gTwP3/i7YJoRz6aA7mr1t6XI8pagzgtkX4GEgLvQzHj3XAMWeYD5RHdoTtJdat/Bfb/sYGOKSX9iUv68mz9wiVRmERmIzwMpzMRT4bYuMjn+rKKhtdqFY72+5WKFmwv7SXMERkIIyetDrvupWWQIg9Z29tmbDt2L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pam-ExternalHop-MessageData-0: JSxArzg/iEwXMYb7PqUj78oZCdfqdmOiDDVqEj3AtaJWGs8gVz6eq+pViM5srd+6qv9IjlJtU0l+FkA0Gc/7uCmUctofGpJs77Xy7tgvCNWLYZNc72QmzgliGIfgKZVtrLHN4S2bUJy+8oT6n0lfjAAuOjDG5eb5/uPCIlFBkqcQ/f5mEvdvcbKJNxfEw3qhzf2v3F47ow6cz4DZRurr80e/ukoLjyB8uxbPJKglycSLSBa80aqYHclQdbflqXg0WkjEwhp7Y3iiULxMg+hBzcnjiNz7FhdWGV+kI9GYVEGTTeYVpYGi/jb4GSUux6lj+a2jlMbJhjV4suKRNiYf8z2YbRQ/amaEq+7tAVxiZm1a8xdianEXaCkJJ3qKGvKfDXy8JQBeS/mPth/EVEfXvjZKyay79zVHoBVI65xsQC4m0h/jOpg67Xva5dEe2uLgTy3HZ5ipfM3UsRU/wUri2GSUcE7x4m1HISrtY9ehWdl2F0aowd9g1gd0Xxw8P2CSYuFKT7OUzgWZtcV5G7Eg2EWkkZXWl6JMFU4bi2mCp/mPM4bjEB/idpKTIQZhSUeZZmdDJ0L080ZzFzB+iOcRUctY/hj0xnPnuKKAkH/o38PbwDOpZgwZkWBKn9erlSYGSboK9MK4XOW6/uBRJlJIv9A6lRoZbRt/VBJ7XnolW3W8FKlIdAXpFXqXQCXB1Llul1CFXVmsaIVPMG0BCnf5m1fxoUomItkW+PXeOghyGMI90OoFTPA1vEWEtxEaBt78mD57VYTEGqMgzIUYdj/BrJEYdQTl82lSXK7i1Vfts5O+LmcUEMo9KUvXIlOUozRcvvki7xXwWR+QEpfCG92smTUX73XdP5pSz8oqKAI4MWa8YiqLLY/LLa+iON5Op0vFveD+BCINdO+BMeMpR7yzITXxz4J6ZziyYQePY2SqmMqXBNT+EG8vK8Lps1eQbuGw X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: bdae4b27-ffaa-4b77-deea-08daf351a15b 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:35.4055 (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: 4gd9ZhhDq8ibECPYdu307LtwCie3V4cksyW2DRS9ZjCXfrypo9HejW878+QpbCFwjE5bN0FPnewofDgZDAJEcimmPFKNQX/E1zKu4VdamcU= 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 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 phishscore=0 suspectscore=0 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301100143 X-Proofpoint-ORIG-GUID: krBTCGsmoZ1qLCk89MOoVIMewxOellAd X-Proofpoint-GUID: krBTCGsmoZ1qLCk89MOoVIMewxOellAd X-Rspamd-Queue-Id: 8D8CC140002 X-Stat-Signature: e3oyize8oznymb1prc6fzq4qmdkr8zf1 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1673386403-536829 X-HE-Meta: U2FsdGVkX1+IBTJBOpW61k4QBwp6T+a+HSDYWSPIiPvYU67VEAR77cF9ZQtseKaT0cII3sd8qI/sXTqtdQj3xayn2PiDkajP97zk0Tw7UBQIZ+0/j60L2ye6bTFGvPDN9knorEXuRH+6q7k8Cdd4ZZLrWvZYvrPqn724fCb5fLyKPEPfYjH8s/AW8dnlgLchZ6QInxLRr+EUt8/T4j9ppMDCmaY1MZiWp0yA3EuLZpAdxJb8dQW5h0xgDCth2COR8/xYV6Nre5jf6bKmUNcoeOxARa/hHXDB5x8JfrIISi1OC9a7lKRxQa7a0QTtUC4BdTymP8lZIM27J2fFPU4cwHn70O7H/cErKbcYf+mzAX/jJUKf15Q3qft1jNngsdhJ50boTrg4FYE7Ts4yIyARuKpT6q90yv8Qtquf1aqV69+omyQoAPh2pQoKvW6/rwUgrZBvUR+8hZG1xkPUIta/PfLifxGPoLf2xbsCXjEbSYev4db9zaQn/jheliZauVln68CjZ7S77azQLfzrJzIGBVnFDkQxyC50YarGgYZ0O+PNeus2kGl67dbkHue5dw6mzUMVddOe4WKXt1jrB0niF6UpyyEmlMuwt//mQf4TMdMLeEyfBjTSMfjLHB9guxG9JDRuwZf7cbo1hFkxEg1ItDAr8paf9QSWTksud+Fj3KEyerc/1xKYR+dUyYWl69cbIRFIcx3l67K9yU8fG9G4IRr7YjkxIp4ySHVrS+Ih8S6ufHv95kkAyH32IZ87QOYqNfr+rfhLE98PQ79u4yLneFWs/8F3XANp+RkapLidoINtjv9d7DrapFW7dVKgktxzQBnnpzh1g0hXKBK8ZdDkRPcPrhzrG302M5SaFgVGvJlCTjZTGTl9R6uj3TTBYUuZ3PU0zY7o3stZn7rzH6QHWHUVXbdquB+iw1KZQgZCnMg03SKzvUkY3oxcEhWeUpksrTxtxiCPtIcgkAxp0Ut ScZsCWcu h9/EVfejL2ll65YTkcqgImn4ZnPkMLTbKLbAbwDQ8VkRhNJZeEFqwKzmzRTD6jb6urfUO7t5YtRwR8YJHuj84c2kHuGIiw7yaN170UrE6iwFN4QlkigmBS/sVZHSqxm2ClVp3JRH9Y/qRahuFhlKNt+E4Bw== 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 __update_and_free_page() to __update_and_free_hugetlb_folio() by changing its callers to pass in a folio. Signed-off-by: Sidhartha Kumar Reviewed-by: Mike Kravetz --- mm/hugetlb.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 540f33d8cc51..9155bb5ee570 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -1556,10 +1556,10 @@ static void add_hugetlb_folio(struct hstate *h, struct folio *folio, enqueue_hugetlb_folio(h, folio); } -static void __update_and_free_page(struct hstate *h, struct page *page) +static void __update_and_free_hugetlb_folio(struct hstate *h, + struct folio *folio) { int i; - struct folio *folio = page_folio(page); struct page *subpage; if (hstate_is_gigantic(h) && !gigantic_page_runtime_supported()) @@ -1572,7 +1572,7 @@ static void __update_and_free_page(struct hstate *h, struct page *page) if (folio_test_hugetlb_raw_hwp_unreliable(folio)) return; - if (hugetlb_vmemmap_restore(h, page)) { + if (hugetlb_vmemmap_restore(h, &folio->page)) { spin_lock_irq(&hugetlb_lock); /* * If we cannot allocate vmemmap pages, just refuse to free the @@ -1608,7 +1608,7 @@ static void __update_and_free_page(struct hstate *h, struct page *page) destroy_compound_gigantic_folio(folio, huge_page_order(h)); free_gigantic_folio(folio, huge_page_order(h)); } else { - __free_pages(page, huge_page_order(h)); + __free_pages(&folio->page, huge_page_order(h)); } } @@ -1648,7 +1648,7 @@ static void free_hpage_workfn(struct work_struct *work) */ h = size_to_hstate(page_size(page)); - __update_and_free_page(h, page); + __update_and_free_hugetlb_folio(h, page_folio(page)); cond_resched(); } @@ -1665,7 +1665,7 @@ static void update_and_free_hugetlb_folio(struct hstate *h, struct folio *folio, bool atomic) { if (!folio_test_hugetlb_vmemmap_optimized(folio) || !atomic) { - __update_and_free_page(h, &folio->page); + __update_and_free_hugetlb_folio(h, folio); return; } From patchwork Tue Jan 10 21:28:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13095680 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 07999C46467 for ; Tue, 10 Jan 2023 21:29:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 96407900003; Tue, 10 Jan 2023 16:29:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9144C900002; Tue, 10 Jan 2023 16:29:10 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 73FD0900003; Tue, 10 Jan 2023 16:29:10 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 5E350900002 for ; Tue, 10 Jan 2023 16:29:10 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 07EE01604CA for ; Tue, 10 Jan 2023 21:29:09 +0000 (UTC) X-FDA: 80340180060.22.A7A26F9 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf08.hostedemail.com (Postfix) with ESMTP id B9095160015 for ; Tue, 10 Jan 2023 21:29:06 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=gRaCsTfU; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=IczihHzO; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf08.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.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=1673386146; a=rsa-sha256; cv=pass; b=kEzLBVRCbYcRMQC55LKS3kzlzLivJmXI3sVKin1CIAL/oPNX2Y1FNtg5gaxtQLco9XgM/n nWaQ5Lmqa4W8sv4NVLcrt51ft4mKPHKe0xBWCYHosawL7ncmvlOhCX3akciU3mJ0AYPC4P FW+p6QeqmpH9T4SRW2UD9g0inEH9s6Y= ARC-Authentication-Results: i=2; imf08.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=gRaCsTfU; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=IczihHzO; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf08.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.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=1673386146; 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=HWdBF1Wlcs9D9iqHgpLX6ouOUWk7M0HHi9i4cwaLOUU=; b=fs4M/tMQwO9WIIO9djfP6qcwCvA4hdyKDefZo1Nq1g4trGb1D0m3s9atoGZRoNq+BW98uo +db+XPktMM+dTcqYOgZgivfd7wsDJdRmC3eu9DHnr+4DzDA57W4Nd9qL+IJXL/Rvfg4tHz QFlovchv3nOZKt086o4cBfmN/pKU5ms= Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30ALGs7j030302; Tue, 10 Jan 2023 21:28:53 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=HWdBF1Wlcs9D9iqHgpLX6ouOUWk7M0HHi9i4cwaLOUU=; b=gRaCsTfUIBzx95Yz7G2YzaxsO3ttrccPO0pbzgPbu4JOYwEXa9TfgAxiKYZb/+5GbPZ0 KltVcuBZj0vDBbkBEsLXi2mp2kQvEy/648iBPi6ZA5a3YMtmrb+PcHks7D6SM/FKlde1 xfhI+XpWviHZU4ohce0sJ36z5i+TH78jK7LIj1HNSmfm029a6TQn5lx0T1vG5ZJep0Eo yAr2RLDc6SjRva+ft+qQv0Jo8J0xXQdv7FsJcpWtTeckUY/G6B8a1k6A/WWuDVfUz9MV YQEJnkH6lGWkTOqjbHnTs+0MJtgF12XLj21Gn7iqKSBscMxVb8DAoNFN24e4/D167KDu zg== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3n14nf9t20-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 10 Jan 2023 21:28:53 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 30AL8cBX013069; Tue, 10 Jan 2023 21:28:52 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2170.outbound.protection.outlook.com [104.47.59.170]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3n1fp4gngq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 10 Jan 2023 21:28:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=enYiR0rA6BOEgu8ucj18ec30RZOSZIdqztKuksE5kdnhwS05oCjYwD+ADBQ9223Vw/PT23VzQJY9Q/TFtvFOVnRv0XlLlYiNRmYvs2TsPTF8utx/6l/lmFDtiSm+0OwEcBpyUEOI2kTXB2r+/IbgYqw7P5r7bDTawGMO87KHQqdTzOyyLU+O8pBsvd+b/u7iKBGSv7LYY4rO5SBvXEJthcjGgyZaSHgiW2a/3tldG2qQb7IJJ/7SqNFHFrfGmAEGV9j5l1nPh9NocnRkhNSFaXZmhh7vTXIraOwxjS/AbntoFgz9pz7ux5jR1sNZYEhOdT36y1pBtIoOplksx+l5bg== 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=HWdBF1Wlcs9D9iqHgpLX6ouOUWk7M0HHi9i4cwaLOUU=; b=Jkzie+AX+KOu4xGrzjPpDEaDxp4IIOMtF8mtVCq2ToUXX5widJDWI6vNZlKdZScJ8ccFEgHozI5U87zmBrlPKP9T7b49PTw16RcC1MBve/PuHs0zPT965nzmO5bV0eSok3plo54QPw9DWq4oTAcW00LwmpEj6X/G1JlpClkN67q1DLjLJmi6a5+0g7p/THBMwCfNEa7yfmFpTVrTdzHQCMYAoJLuJhHaqPQD+77Lg6Rzw/qVXPBBhJoNjCqhHVONpz5OvmtJKmkwFfzJDPwjvLtrEg6HxmUx+SHGZMOCWuGuWUaFqm1/egmlpKBfDjSl2u4Sl2ysyx7bbNLVu1gsWw== 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=HWdBF1Wlcs9D9iqHgpLX6ouOUWk7M0HHi9i4cwaLOUU=; b=IczihHzODhEkVWjSMY8OhzRFtwbT4+YeHNryldNrNyRTBcTle+iq48p//f1svgYOwQ+OsB//xnZAmo7T6b6O8tjI8xby7IU9PG8NXMSZar+dzjIXwpqcTzU2qAIY45W/eHKmPgNvn7oY6clbdzQ+acM6YXc6PL1GSe0A8buBw1A= 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:38 +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:38 +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 3/8] mm/hugetlb: convert dequeue_hugetlb_page functions to folios Date: Tue, 10 Jan 2023 15:28:16 -0600 Message-Id: <20230110212821.984047-4-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: SA1P222CA0016.NAMP222.PROD.OUTLOOK.COM (2603:10b6:806:22c::8) 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: 1443c24d-3124-4b07-f278-08daf351a2dd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /Zy0KqXr5QXuevtZouKUoXH/g+00Z74A9TBRoFB4mMgxpT0EgIAU3PzqUgtQCcK1T8E5ZLaQlBXu7AEkVbqGRw6B1hRbaowgIfDqjxivKTSI5Jirpx80bXB+/CuSPY137hKyJARoEKeDAiTm7JqQqe1YbqqEzGxbju0EOcgMo1U3qJB79t2HzAeUacKMacHmUAQU6eg8vfeXldEAIdYRnEzOp0ysjhSD07Uuqow5ri3sHcu4ENHgERtSecR11yENJrHn0BIuUtW/J/4e2nHJUu10wlDMvVAgypOF4SVwEJaR9HKDvL3NdMWt0JFF7XpPoL0d5uBcL+4AJGweYt91GNFA6yOe4yZ7pEYDJJ+8BzQ7il3z6dj3KN1bdbapJJYFeHC5n7Hjc7WdLAU43OHhPuGBGQmTb3YkfKVt5j/K95Ic5ElJqriW3219a94dTY1U4xyTBlVBlqtmEogCiXoTzLOTEZYlsAeBJmMs9y+lC+E2xmVLXQfRpgcKDZ5xIIj0v5BB2Wh9WZvG9nyKpxZIX/pJL7Qt7HFJBvaXyNuyxv34WFxcxOCV9zmFCB0In4AXXeQtSZhZ/7hAShNotI5ewhtV0VPp2wcYFgm+MUKzSlc4fK+HEBv9Y0ar9cBmWTRtwyq4cOSgDatcr4hVVg5yOg== 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);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount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CKkYz+A7ovZv2dPmv+pItxsfbAxeyRebg+2YKEFtAch+xOG1eDQaQKSR67drfxnqk3nsdHnX6pUn9XOue6TwU2X+NO61CJiBzVcb36ogcYL9oWqEqqqCoyjrtRXJj+G9fA9VozXBKRzak0XwrsfXO8xUxmBjxXrfpRZi3fudvCqN85tNH4cJ2TB8zvCvWdCMF/zherDUMfpoUM/yIvu9L5o/5BtEQQgjSMlXkbxcNj+vMgCXxekJTSiLXz//msec8aEuYSn99DxZier0FRUgwgM9vHJOLiCf4JD/uoD/0B5yHsIe7LhVJvAQeU9peEG1zjTUT09nK5539k/phFyf+WiaaWLZLWbcitJ3pkJscmo4KYXdODjaAtu5rULzJU65QvsZPLhYhYAKX9sssExChrPIp+A8Yulp95QxdobctquQzcQF+iJgIAyrCNSvSb4Yl41PGE1E4htNVRl1RQU8/t3KJOUIkvOvPz6sVfCW7jZEPCGLTTf0RPC+yKsoWyqT97DQXFEsVjclfV4TqQewDNnfamiiagPRbLmNzTWFyh0NXdq4g5/V5EXbJVzD+1fUB2qPM= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: wC3G+f4Oh53egn+YRzZ426/KOrVQrxBwBcmsBwiwKq1inEzs1CI2OyLiXP8YJWXlWXq+xqeWjdOXFSxvw+65nKnNWQO2dx/OTAHTv1Ip6Tn7ZW+UX1TX/IIU3paR6weNaJNDhZFciIArqKjsMJakEPVouGo0qAUeHLEvLe6tGNB3PfWb/qEHIF6aTitgSNKe5dgL+Xjnb9HMR2Xei8txhlHsdThZ/vlasJikYW1s+Hx+7aFRr2cS7TevkbFSPxy3eAkpFtHRXSzWSSzjnLw4p1Mx8srMgrIWp7GbMHpPHJxD0wBp3pMCppDQ7fJAD7654yRSZxE8U1LHZkvyb/r0d0F95CdAkyQkz0jsysaVWtzY4xke2ABAJfIw+1neIZL7287kwX8dQmHs0AHvU76xNbygPdPi3T3szKXWyHMM9m2c0eu0L/LuyOpOo2xmsqjOEIdN0SdrdOPee9bMY+S5ZJj0rEs/Tkfd2Ma3WxodapzzrmUURUwCUrsiCqdNQi4A9t3ODonCSqXA9RIUTiK3/Q4wRL+9IBqtPQIegbbTDxTzoZxfcTb9yqxnt+Gd6yjqFmnlSYqboqQPmifq1dutN4JqnULj4bW4Tlzn6gKvbYbshqsMV/3ABmUEjSjQS2m1Wh71b12xnTYYtjMm25z0pNYOJMFthpRWANRli81tamNbgjIYcwmUR3n+jHSOkRCrgklz0n98aZO23hQ96ZpQmmfyiE/6ufXi2CcdNpbgTmsf9XmQyel6XhlOPd6tUsXEaxJHxB5kD27q6l0UVBl3716Qt6lvvs0eLkGLrkXexYeFxvriQkQy92Qq2NTeR2xfIVDesKV6tJwEwRtioWTXL/H6w4cykVwA6HqU3XefpuFA9XpTOPCc+waCHMxIaJmlPHDueXmRcF9QhbuGiB4DsR+3QkEmXRtwh1I30bFixHmEzIWoYznLDSiJ6rCweXoM X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1443c24d-3124-4b07-f278-08daf351a2dd 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:38.1700 (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: gXKdbphwEECgzz85cTJlsHLqAubDRk++Tw3AnoTHsXrjFuo9sWB93nj+sEIXfBiSl00LJ99BlU49tT6wC/U/n+YN4a0VmdytxQ59MfdW6IQ= 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 bulkscore=0 suspectscore=0 mlxscore=0 mlxlogscore=999 spamscore=0 phishscore=0 adultscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301100142 X-Proofpoint-ORIG-GUID: F8pDYTWsLqR7dy66Ea6uKUhzx4AvaDMC X-Proofpoint-GUID: F8pDYTWsLqR7dy66Ea6uKUhzx4AvaDMC X-Rspam-User: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: B9095160015 X-Stat-Signature: s13rwyhm341cji79qfe9gcdom5ybutzc X-HE-Tag: 1673386146-233877 X-HE-Meta: U2FsdGVkX19Ei/bRJ5r5b02sxGn+GgT5zknGrRL1OS6dLyEJUxyIud5T5iRgcMyFN9BnXuA+WvipWIHTBQeM9QjHeQNg8XgLw0jE3T40oTJcgw+HMm9z5MAWntFKJOkMlO3n8V6uVmqqQLVqF38tSLWlK90JTkfpOnOugKWRKbpMnSbVrk/p2KAZ/WPautHmvR79lKByxdqaGlUIx6KfKpdQPJ+zFNk8lRdeZq0bMXO+7RWPE+U2N8aeFUzgIeCY1Uawy5UYPSS3dHJIRUu9NKI0J3lMX9Ctbvv2gdkK2DFlpj2r1vwAzRrWB7tvrzLrK1hgOMu6xnZNTtE1gO0JecAu3Fzrkyyyu/AeMnhDMlpkJhl9hPENjKSFByINV7/61VCuSSgC1r2lLM4pVYgBvhxFPSTdjMeE6zO3I3hhCY6nLvmh6ugpA0DoIZc0cuLpvu3LCpIGno66G/1wAfhQoH4osrIKhoVZDN4/Rb3G+MFr13mcIsBeW7byzWidBElZWQ45tDu3cHScdsSYXu4wa8wypOjlUMhrqOmS2w5nEbBTfUrIuZDGrordUfNb0b3A3/oW51wtPJmN3XaBON2WvIqcT6ZqqiryJwfTiu9b5Oc3GN0/bc7l6k5FvKDgHfvhp1dKe77XWv2Bvr3K/6CqPf+iut/PO7l+9HOLzUn4R/ap3Cvn5lV0RP+38cngfdgfNtD3sCPZVvC6ZdTmsDLH28jTOhLlih2d+mFJQ5jwmb7VhcDaqN62uxinX73VuZcYp3ctqR3JSxWuPKS0L4Ep4JzLmiGNqbsLHqhi2/n7iiFQL/4rIO55QDbmQDnUwcp4kLzsRhwvMPuhmaMPeXbIfis+SfgvD45105Mcf98wEgDnvFPpfyExO0dxdKSXsvyWctd7vFekrdvxaNJGWZ3b+1Wbc/vBIqkP7mS7WJhLpQdPg2UYPf/wOcHDfNp4Io5oG8NStqvVC9af+Y2Vizy a23ECbvX 0N2qq9kdzseeDvJ2WRGf0Byx3hDMD81DvhcCZKoNT9f5lsZFSNVC6fJD3X0AEXWn1B4fm+HlqXsdL2q368bbZTJspLzvpTzBPooK83gU8fzcb3buKmjhzC5ovFxxmGV9+yPzldtcKVOv2hgO6uUOVnytlkA== 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: dequeue_huge_page_node_exact() is changed to dequeue_hugetlb_folio_node_ exact() and dequeue_huge_page_nodemask() is changed to dequeue_hugetlb_ folio_nodemask(). Update their callers to pass in a folio. Signed-off-by: Sidhartha Kumar --- mm/hugetlb.c | 56 ++++++++++++++++++++++++++++------------------------ 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 9155bb5ee570..c206a8c1ddb6 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -1140,32 +1140,33 @@ static void enqueue_hugetlb_folio(struct hstate *h, struct folio *folio) folio_set_hugetlb_freed(folio); } -static struct page *dequeue_huge_page_node_exact(struct hstate *h, int nid) +static struct folio *dequeue_hugetlb_folio_node_exact(struct hstate *h, + int nid) { - struct page *page; + struct folio *folio; bool pin = !!(current->flags & PF_MEMALLOC_PIN); lockdep_assert_held(&hugetlb_lock); - list_for_each_entry(page, &h->hugepage_freelists[nid], lru) { - if (pin && !is_longterm_pinnable_page(page)) + list_for_each_entry(folio, &h->hugepage_freelists[nid], lru) { + if (pin && !folio_is_longterm_pinnable(folio)) continue; - if (PageHWPoison(page)) + if (folio_test_hwpoison(folio)) continue; - list_move(&page->lru, &h->hugepage_activelist); - set_page_refcounted(page); - ClearHPageFreed(page); + list_move(&folio->lru, &h->hugepage_activelist); + folio_ref_unfreeze(folio, 1); + folio_clear_hugetlb_freed(folio); h->free_huge_pages--; h->free_huge_pages_node[nid]--; - return page; + return folio; } return NULL; } -static struct page *dequeue_huge_page_nodemask(struct hstate *h, gfp_t gfp_mask, int nid, - nodemask_t *nmask) +static struct folio *dequeue_hugetlb_folio_nodemask(struct hstate *h, gfp_t gfp_mask, + int nid, nodemask_t *nmask) { unsigned int cpuset_mems_cookie; struct zonelist *zonelist; @@ -1178,7 +1179,7 @@ static struct page *dequeue_huge_page_nodemask(struct hstate *h, gfp_t gfp_mask, retry_cpuset: cpuset_mems_cookie = read_mems_allowed_begin(); for_each_zone_zonelist_nodemask(zone, z, zonelist, gfp_zone(gfp_mask), nmask) { - struct page *page; + struct folio *folio; if (!cpuset_zone_allowed(zone, gfp_mask)) continue; @@ -1190,9 +1191,9 @@ static struct page *dequeue_huge_page_nodemask(struct hstate *h, gfp_t gfp_mask, continue; node = zone_to_nid(zone); - page = dequeue_huge_page_node_exact(h, node); - if (page) - return page; + folio = dequeue_hugetlb_folio_node_exact(h, node); + if (folio) + return folio; } if (unlikely(read_mems_allowed_retry(cpuset_mems_cookie))) goto retry_cpuset; @@ -1210,7 +1211,7 @@ static struct page *dequeue_huge_page_vma(struct hstate *h, unsigned long address, int avoid_reserve, long chg) { - struct page *page = NULL; + struct folio *folio = NULL; struct mempolicy *mpol; gfp_t gfp_mask; nodemask_t *nodemask; @@ -1232,22 +1233,24 @@ static struct page *dequeue_huge_page_vma(struct hstate *h, nid = huge_node(vma, address, gfp_mask, &mpol, &nodemask); if (mpol_is_preferred_many(mpol)) { - page = dequeue_huge_page_nodemask(h, gfp_mask, nid, nodemask); + folio = dequeue_hugetlb_folio_nodemask(h, gfp_mask, + nid, nodemask); /* Fallback to all nodes if page==NULL */ nodemask = NULL; } - if (!page) - page = dequeue_huge_page_nodemask(h, gfp_mask, nid, nodemask); + if (!folio) + folio = dequeue_hugetlb_folio_nodemask(h, gfp_mask, + nid, nodemask); - if (page && !avoid_reserve && vma_has_reserves(vma, chg)) { - SetHPageRestoreReserve(page); + if (folio && !avoid_reserve && vma_has_reserves(vma, chg)) { + folio_set_hugetlb_restore_reserve(folio); h->resv_huge_pages--; } mpol_cond_put(mpol); - return page; + return &folio->page; err: return NULL; @@ -2331,12 +2334,13 @@ struct page *alloc_huge_page_nodemask(struct hstate *h, int preferred_nid, { spin_lock_irq(&hugetlb_lock); if (available_huge_pages(h)) { - struct page *page; + struct folio *folio; - page = dequeue_huge_page_nodemask(h, gfp_mask, preferred_nid, nmask); - if (page) { + folio = dequeue_hugetlb_folio_nodemask(h, gfp_mask, + preferred_nid, nmask); + if (folio) { spin_unlock_irq(&hugetlb_lock); - return page; + return &folio->page; } } spin_unlock_irq(&hugetlb_lock); 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+NkeYvnkLH2oalg4efi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UlvDJWLWtnYThocfGPklc2m9W+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-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ZcQdidw0mNn+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. From patchwork Tue Jan 10 21:28:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13095685 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 83B83C54EBE for ; Tue, 10 Jan 2023 21:29:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A2B6F900002; Tue, 10 Jan 2023 16:29:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8A723940009; Tue, 10 Jan 2023 16:29:14 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4F69D940008; Tue, 10 Jan 2023 16:29:14 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 37990940007 for ; Tue, 10 Jan 2023 16:29:14 -0500 (EST) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 12FE6A08AB for ; Tue, 10 Jan 2023 21:29:14 +0000 (UTC) X-FDA: 80340180228.18.8721BC8 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf12.hostedemail.com (Postfix) with ESMTP id DFD7F40005 for ; Tue, 10 Jan 2023 21:29:10 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=mOdAsIBV; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=PReBubmr; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf12.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") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1673386150; 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=ON8r4iAi/C54BL7LxCnv7ms9x+EBmJEmmOUIFctdR/Y=; b=EsSz2LX+Zbvy1O+UWyU+FW+G131Xy895OY7UELrHZaK8nNIn/BfwsFQGSpNNbByNCxTs+b 3lnqAybFVVu98X+vtS7daapEoqGRSiLmNFf8XuBDqi6Y5OP8wwjEE+j27G3Xw18cT+Qpcw u0NsP/+OETnQH0c6D9mHZDHjQ34fRQE= ARC-Authentication-Results: i=2; imf12.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=mOdAsIBV; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=PReBubmr; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf12.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") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1673386151; a=rsa-sha256; cv=pass; b=AdSxB1DnxGYuYjwUgaDgIHklWHx/Qt4Kab90lgeM1RLBh5E25OjmNi0JxF+rpPew+3jJrL b8+oiuL0sp+kEa819kgPI6k85+KoWF/x7Z1nH4KBr8Km4+GaQgzYxztpixvn1XJkplbfPH m6Gm5yZQfdRpRX64nVJL1cQe2I7SlH8= Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30AL3ccn011294; Tue, 10 Jan 2023 21:28:54 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=ON8r4iAi/C54BL7LxCnv7ms9x+EBmJEmmOUIFctdR/Y=; b=mOdAsIBV+cT382pE6Oia/JAR/CyKuOIoItJHs1+lWj87QqQjBcvfBcj/o+PPadRdox0k GKrmbyTHZDOagxh4IZJKk1V0DKZErXWQB1Ptxpq2995dTmMGnW3oysxGoHPZsnST2bqH rVhb7/Jqv5mIdYADWVJsgP8kuZB8CtOvI5NBe85PPP/KmZ/GiA/ulr5nGy/tyLXGKu06 dH3g7UQPZN/qG/XTA/YecMqVLNUc4KtOrsEimWrFJ3Ironco1r3F9Ko5deRwIjKvd+gO jMrwOrvMhK4Ym5oqLQHC8h9n89EkNeisoAURV1ihtQwxSRAwURI++FAPLBXrAzl0OqNz 8Q== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3n1fe5830w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 10 Jan 2023 21:28:54 +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 30AKY8kP022668; Tue, 10 Jan 2023 21:28:53 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-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 10 Jan 2023 21:28:53 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jGFv7gtGJxVlGP5fjxefIKdR16jZc62au8tQ/K0FmydO/DuymeTFIpIc8lX2dwTHr0K46lMQxuHXo6vRK7Ns/3idYGKY2DqUgSVIOEy14bXKqb6tfAcwfZGpTzx6oKqUVJJrpDtN9eJbQEln5I9vgxkyLYDQA9HYoWQpxDMBUZkRSS3rrEFWKXm9/Zw9U7EJJ/+r++fKW3k2YrlnLshbnZpcqwFIvP/C6lgcVoFMITeTZu36KDmNDzUTZjaV4/LJE4Lm7g4kbN+Z9JKNcCuVATERA9Ag3F7YFvrxUcgG6rBfpFx268ICB49r/xhOElD9e9svKbk8yJg9beo3sNnB8A== 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=ON8r4iAi/C54BL7LxCnv7ms9x+EBmJEmmOUIFctdR/Y=; b=YmhBIMFU7/nDvYkt158LloSqj8GC2rbUsEL4Kg97r5UkU2PUT8pzF6DgRo1I5Yw34LULJOQ74cWB5IZy1SXhdaE8GZoNyo4SbZ58YjN1E8z0+wwkJ0cVSR1v70uzXn2jdoVy1R3yrGCDY3yEQKuc8yZTByEgqPTOT32iYkIEQKOdrfegp25PEJBmyCwjMntnFB90rd3lHfcMwWofDIsuVa6QnfrY8HZXEEhznCZQKz2p3GmeRc1+YZrFshNFfVN36wVeiawz4KYd6qulRyvTYyz1pvFOkJ+1I+fTXQOscYJlR3SHlYNUOqcEt4HZBfxFs1qeiHsFSktnHQ4+U4y9Xw== 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=ON8r4iAi/C54BL7LxCnv7ms9x+EBmJEmmOUIFctdR/Y=; b=PReBubmr2rq5V/Xo4W4IU/JIW2qKsSnxndx8v5oV/DJH27ePUrSpYanBy2e/MM4DOb+8jEB7K0ZY/KYolKH+OO5ubZ8SKmtPXj5hT7mmmZis6E5T7bY77dAN532Bie96rz0FzxWI1C4H4jQgYeaeWT2gwCwNeu/23/KhR88rApc= 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:43 +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:43 +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 5/8] mm/hugetlb: increase use of folios in alloc_huge_page() Date: Tue, 10 Jan 2023 15:28:18 -0600 Message-Id: <20230110212821.984047-6-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: SN6PR16CA0053.namprd16.prod.outlook.com (2603:10b6:805:ca::30) 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: e13fcf2a-5eb9-4d70-5447-08daf351a61b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: UTILyRM7v1NDC4eyaE36NrJ0kqnkQjBiuW/ffcN0ovNVVNFCCnr2nWFFOTPJVA4qH3FVcHTkQXue+OqWWANRJZCyxafE0s3o8gFRce54NHAJ6kiHiv9UCk0u78yK3BdjHddlsR7873/AXSAiMONRox/s0y39+Xfp2B/UsXpCyIcBXUsPeL4nftP62i9MFPMlno1YDN44aPUJzubYXFCwcx1h2cM96Kk7enPjCWhTccwCQSilyrfNWBoiUQSeg3mCVcqTzPihKaDSEcxZ8EW8JMHcE/uWZHo9yHqhEgf9CSfjQUJx6yXoRSd0OKReKyN+RHTwoBVuzCZCaJpz+rAKw+ZZswlZNtY3T0XhlXHBuoLAjzovp08lTjtn6w1MA0qAZ8Sh+9kY4AITNckOvuI0+b6QV/5SpwTP5Iiw00Kdi6nkEGtMkDhg1oRLhhfCWniC02kJsvVlX/XPnXrLwdG5jIl/ahy/XgEeRjw8RWQUGXyVO5raPSt6VWzgtcyHFcRXJFACU8/P1LYzakvS10c9E6jfw2aJRp8VUnfRYOB8t0udaNEI7QWsOeJf/jGAw/6Vkbqs7ML9D7HpDi5xNUVh9F8dD/K24ducCJYG7MH2Cz9q/SshgF0EkC0nPHQzSC4BM7PIW9Y+zj6vNdA0NM2QVPf+ApYZa087xi8LrjTuZjX6D2OY/GK2mWWAXgVplSk6 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: uCHurwADmS/zdCWzGip5P+tGn7009sNnsPA1wpXmYIVwz8DMlv6ow0L81wbX3Xi1crPDgWy3VjgDiIKmNTRS19WdFTjlWfAwPQn++KGSKzc/UwVmuem+Mqye5F0LKG+wOl67XAaU595Zg0Gh32276qHMHsu8qKwQnv4PgpwHoyGq+E8zbnJucxT4IZCICaapQTT5x2OF+9Ar+6T2PxxDjlkSCascWkCiVCNu9Yh/oj9+Z5xpDaouhkBqtTDLYPtNeV3DBuXhGo6Tyelqzsc5DralmSGIuMWt2cH1QsWI+TZXyShDsBrPDCjTnnDaiXrgtijf+DJKAsea2n0ediquqnqJxOR4c8aTrkAU94jVhziMwDn97A1QLginqmtXMVlrAFuvygfG8BkT/sFRym1/qZy13YH3htTJmyka0wl8xUdo/8XpU6tTAPstq8ipa7GUAf9hhSR9a4y3wuGHYjxqhalvgCDOBb7w43x1EcFHVrJgDy0sr+Zzy+fDd/ZxvpFgPAsYEowl9G+dQATfqhwtGxrjsnJzGylknv4eYbxZ9lcXOfnkDvpB59Y5PSLa67tGzkDE8/SHPiUesPzcWtW4nykEgs3qThhg/QllQ4Jnr0MFRyfAVPJRIL6KctcbYudixQ5uoBPpuP7JTK6kNc1P5MnzzYhcN9P/MzNR9P3rdOiovtdM6gjx3ZhCxUtYgktND4oYMCGFm6ikllcYiGinS6eFPez0fA8WQUgVrWKS3MNeM6gmF61yO9+lLIr6EiyJ3faE1Y7q5Zn/vicPvN4fGN9AdYZMe44s0xzNcW0KM7urMpmLUgShKBFjqDr3wEAMlzR9+l+hlVLceFwQ1wBaKBpoWObHW89qfm3Jra9PNXjWxy6k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MfC9f35uhkx9utnnkhi/1b22iAiJGa/mDdwF4VZPsvVKmIO6wjMu9GMLKxT7xYGA1P6YTmIZtqrzMmpubGlCGiSyXvRcBRUaghaIFDuQgiS7YI2q3CHG4qF3vFVwHtB/0cJD9RoW4awCDrDyM1tXTxTCE1Ew3r53p7R841wI1R39oJrRHcnpYN1w0X4Eyt3g4jfkw59Ni/Gl8pdUQJoKjRgvJ+vSs5Bki702R09Qb2KAecEZ3OoUwoOFKq6F8Tq7b209VJ2Xe0DYQW2Dwr8U7kZ8yKXOAuzw9++ZqzRQkI0/HvCeYbpdgh0yV/VztW9v1s+Xn/TmzIqawfmMVPKhkVRvKVWFRkO86Z7lCIf61E5pEENTfwd0x3Heb5z/GhKMf6eiw594dgEjNWcXyI/Ukp4bGkt/g0qRUk54kdOJmXjYB9Qbrh886TSNJO/7OD3dpFQbUDNqdUX0AFgQxJMuT6UlvynWrWpQhUNjvumRGG0WyTJHsn+p1R9c+hK/O9eviwbnS+iwsYKsdudrVZCDYYjBSnUryz+ApVOcZwkOHUBF7F3SrTmlhViueIZ7O94ItfNZvZteqQx9AvtRpyABnbCp+abmjJui2O1TJ6uVGiXswa+Cm0/kYdh338llTAGlSb04JIQPZodNaQgRXgC3sd99cut4TYHx/SVxWARGeFbaA9eEMrFVsXeLbqA37hMibx4GVlV+V6O5Cqa3pAll88R X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: e13fcf2a-5eb9-4d70-5447-08daf351a61b 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:43.2774 (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: JrMchX/CdYxNIYn0ONyzoN0RbbLX6ilnoBiRFi85YnuXOsIUmDiEI+dnKn/b83ujdBpc6v2/aovH931Bl2+lwCvtxke5W/H/1SN5MHHeNpE= 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: 8SP4qecE-oqOC2h013PD0HmLHcddQYM2 X-Proofpoint-ORIG-GUID: 8SP4qecE-oqOC2h013PD0HmLHcddQYM2 X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: DFD7F40005 X-Stat-Signature: t56oduj9m7q7afjz9nozaukd7unui1w9 X-HE-Tag: 1673386150-625256 X-HE-Meta: U2FsdGVkX19CqE8PVOP2cCEO571VvQgitgd51o8K3c5YuMwssfriAlNYToWBp5FG/Y0TZj5n383zsN2aqnAbMw5ez5En8UmOliyEScRl5jwgFJB1MsaGgsg957bJJh0Vt+buG3jbxFodeNmTVHQofGfihWKa88oBRYf9mxUX/yAofpWd86Lt3oWzxTeAqwlO4i6QWlZUi5vgk8OiI9VP0BiHreZT8TC53/F6pMfWLug176QYtA8WgWd5ygq45xDaCSopXG0wmTmiKU1y95iKKNjigi+EDsT2JVUvtM+8TkW3wpjs3uC8MyqtLU9TWaxKURFRJTLXsh/sfMYOY/gu4keIxMZD+jhOpVH6JtWr1OUfpRRa2AL85OYAnr+Pv6sMlUTPfrwPXXo7JU6WZgDpYGCQusoJfMh0Sqa+PNjhKFn+U855QRVZeZvC1vX1hSivin/IzatOX7jaOBJYy3JyrRHJHXj/4V6z2dG7fUQshJoCuq3zh3AWl9Ivpr+k/magzVJVBe3O9ye1bdYKNrIK0IQd45PrK9J6cs0/27aVrrUjz7iKUqVjkQWlb+/YIl7a9VRd1diopF5BB+74U3CWhQAT3XsaRf+YNmRXZ8wYZwJbF7IsFP+L33FNInByiAbt4weudQnU/RG/INSJe8X9QYjh4xg4wEwxV0Oo7s8f/5Ev6P9EeSnRNDml+L6owHKs4C5hf/qjH+1pKjOOdkPEmG/umlbWWQH2lOx/1iJhLWMIsp6OAZBGbJllwPbMRqxj5Z0/QARc6obg6RSrfxFSWDArhP87Jc3rHkPhS/c96nuzDO6WxQdSQg4FE1smGLLeZpgEA3D7Zv6Y1pmTgkbGBaaRvBqOyMPvsvvm0wXHg5fRuR+36dglKeGbFDX0Mav3adhb2XLDyxpWCLy3E1OVVeahaZ+o6dDAsL01WdL62TX7GNLWs90KxgQx1rruyTUSS7Na4zzqNMRGFssoR+S UfaZYLqE vZlwU1sxTD1NUzefbyHr0Bzq2K77c+NS+SPAz9ciEWODeNTw4ZNaS6RzMU+bMVdR0Y1ry4MPjrO14Xg4mzJfdg9S3BPMbr0TKpeTxHzWNMUYvWHF8z73OlfzIXii7iXoMcfhfNpF1vjR458QSd0wR/e+GDA== 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 hugetlb_cgroup_commit_charge{,_rsvd}(), dequeue_huge_page_vma() and alloc_buddy_huge_page_with_mpol() to use folios so alloc_huge_page() is cleaned by operating on folios until its return. Signed-off-by: Sidhartha Kumar Reviewed-by: Mike Kravetz --- include/linux/hugetlb_cgroup.h | 8 ++++---- mm/hugetlb.c | 33 ++++++++++++++++----------------- mm/hugetlb_cgroup.c | 8 ++------ 3 files changed, 22 insertions(+), 27 deletions(-) diff --git a/include/linux/hugetlb_cgroup.h b/include/linux/hugetlb_cgroup.h index f706626a8063..3d82d91f49ac 100644 --- a/include/linux/hugetlb_cgroup.h +++ b/include/linux/hugetlb_cgroup.h @@ -141,10 +141,10 @@ extern int hugetlb_cgroup_charge_cgroup_rsvd(int idx, unsigned long nr_pages, struct hugetlb_cgroup **ptr); extern void hugetlb_cgroup_commit_charge(int idx, unsigned long nr_pages, struct hugetlb_cgroup *h_cg, - struct page *page); + struct folio *folio); extern void hugetlb_cgroup_commit_charge_rsvd(int idx, unsigned long nr_pages, struct hugetlb_cgroup *h_cg, - struct page *page); + struct folio *folio); extern void hugetlb_cgroup_uncharge_folio(int idx, unsigned long nr_pages, struct folio *folio); extern void hugetlb_cgroup_uncharge_folio_rsvd(int idx, unsigned long nr_pages, @@ -230,14 +230,14 @@ static inline int hugetlb_cgroup_charge_cgroup_rsvd(int idx, static inline void hugetlb_cgroup_commit_charge(int idx, unsigned long nr_pages, struct hugetlb_cgroup *h_cg, - struct page *page) + struct folio *folio) { } static inline void hugetlb_cgroup_commit_charge_rsvd(int idx, unsigned long nr_pages, struct hugetlb_cgroup *h_cg, - struct page *page) + struct folio *folio) { } diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 62552172683a..f3e1d052b40c 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -1206,7 +1206,7 @@ static unsigned long available_huge_pages(struct hstate *h) return h->free_huge_pages - h->resv_huge_pages; } -static struct page *dequeue_huge_page_vma(struct hstate *h, +static struct folio *dequeue_hugetlb_folio_vma(struct hstate *h, struct vm_area_struct *vma, unsigned long address, int avoid_reserve, long chg) @@ -1250,7 +1250,7 @@ static struct page *dequeue_huge_page_vma(struct hstate *h, } mpol_cond_put(mpol); - return &folio->page; + return folio; err: return NULL; @@ -2302,7 +2302,7 @@ static struct page *alloc_migrate_huge_page(struct hstate *h, gfp_t gfp_mask, * Use the VMA's mpolicy to allocate a huge page from the buddy. */ static -struct page *alloc_buddy_huge_page_with_mpol(struct hstate *h, +struct folio *alloc_buddy_hugetlb_folio_with_mpol(struct hstate *h, struct vm_area_struct *vma, unsigned long addr) { struct folio *folio = NULL; @@ -2325,7 +2325,7 @@ struct page *alloc_buddy_huge_page_with_mpol(struct hstate *h, if (!folio) folio = alloc_surplus_hugetlb_folio(h, gfp_mask, nid, nodemask); mpol_cond_put(mpol); - return &folio->page; + return folio; } /* page migration callback function */ @@ -2874,7 +2874,6 @@ struct page *alloc_huge_page(struct vm_area_struct *vma, { struct hugepage_subpool *spool = subpool_vma(vma); struct hstate *h = hstate_vma(vma); - struct page *page; struct folio *folio; long map_chg, map_commit; long gbl_chg; @@ -2938,34 +2937,34 @@ struct page *alloc_huge_page(struct vm_area_struct *vma, * from the global free pool (global change). gbl_chg == 0 indicates * a reservation exists for the allocation. */ - page = dequeue_huge_page_vma(h, vma, addr, avoid_reserve, gbl_chg); - if (!page) { + folio = dequeue_hugetlb_folio_vma(h, vma, addr, avoid_reserve, gbl_chg); + if (!folio) { spin_unlock_irq(&hugetlb_lock); - page = alloc_buddy_huge_page_with_mpol(h, vma, addr); - if (!page) + folio = alloc_buddy_hugetlb_folio_with_mpol(h, vma, addr); + if (!folio) goto out_uncharge_cgroup; spin_lock_irq(&hugetlb_lock); if (!avoid_reserve && vma_has_reserves(vma, gbl_chg)) { - SetHPageRestoreReserve(page); + folio_set_hugetlb_restore_reserve(folio); h->resv_huge_pages--; } - list_add(&page->lru, &h->hugepage_activelist); - set_page_refcounted(page); + list_add(&folio->lru, &h->hugepage_activelist); + folio_ref_unfreeze(folio, 1); /* Fall through */ } - folio = page_folio(page); - hugetlb_cgroup_commit_charge(idx, pages_per_huge_page(h), h_cg, page); + + hugetlb_cgroup_commit_charge(idx, pages_per_huge_page(h), h_cg, folio); /* If allocation is not consuming a reservation, also store the * hugetlb_cgroup pointer on the page. */ if (deferred_reserve) { hugetlb_cgroup_commit_charge_rsvd(idx, pages_per_huge_page(h), - h_cg, page); + h_cg, folio); } spin_unlock_irq(&hugetlb_lock); - hugetlb_set_page_subpool(page, spool); + hugetlb_set_folio_subpool(folio, spool); map_commit = vma_commit_reservation(h, vma, addr); if (unlikely(map_chg > map_commit)) { @@ -2986,7 +2985,7 @@ struct page *alloc_huge_page(struct vm_area_struct *vma, hugetlb_cgroup_uncharge_folio_rsvd(hstate_index(h), pages_per_huge_page(h), folio); } - return page; + return &folio->page; out_uncharge_cgroup: hugetlb_cgroup_uncharge_cgroup(idx, pages_per_huge_page(h), h_cg); diff --git a/mm/hugetlb_cgroup.c b/mm/hugetlb_cgroup.c index d9e4425d81ac..dedd2edb076e 100644 --- a/mm/hugetlb_cgroup.c +++ b/mm/hugetlb_cgroup.c @@ -331,19 +331,15 @@ static void __hugetlb_cgroup_commit_charge(int idx, unsigned long nr_pages, void hugetlb_cgroup_commit_charge(int idx, unsigned long nr_pages, struct hugetlb_cgroup *h_cg, - struct page *page) + struct folio *folio) { - struct folio *folio = page_folio(page); - __hugetlb_cgroup_commit_charge(idx, nr_pages, h_cg, folio, false); } void hugetlb_cgroup_commit_charge_rsvd(int idx, unsigned long nr_pages, struct hugetlb_cgroup *h_cg, - struct page *page) + struct folio *folio) { - struct folio *folio = page_folio(page); - __hugetlb_cgroup_commit_charge(idx, nr_pages, h_cg, folio, true); } From patchwork Tue Jan 10 21:28:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13095684 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 27777C61DB3 for ; Tue, 10 Jan 2023 21:29:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6DCDA940007; Tue, 10 Jan 2023 16:29:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 63108900002; Tue, 10 Jan 2023 16:29:14 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 25E72900007; Tue, 10 Jan 2023 16:29:14 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 05D9F900002 for ; Tue, 10 Jan 2023 16:29:14 -0500 (EST) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 607FA832CA for ; Tue, 10 Jan 2023 21:29:13 +0000 (UTC) X-FDA: 80340180186.24.7D453E2 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf11.hostedemail.com (Postfix) with ESMTP id 322DF40002 for ; Tue, 10 Jan 2023 21:29:10 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=eBp22SYB; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=wOwCSzhr; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf11.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") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1673386150; 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=/QULkUox5rmihInJovSFDI1yjAOFhDzEXSOdbMBjXi8=; b=USM0Jd7tXznHqMLX2tv7RrJgVCBjo8N38L6T4i86WI46+7pegVQOhqrTbTU+u1GTGWLLE7 KfSCeyfVj/Qq0rqh+aRztOVpEgB5Uj9BaRzROLIE+HedWKnZliVAQiVDbA4n0/A7b4K35M 6oZmNuU0eotXZ28Q04FTs1v/7lu0wYE= ARC-Authentication-Results: i=2; imf11.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=eBp22SYB; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=wOwCSzhr; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf11.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") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1673386150; a=rsa-sha256; cv=pass; b=tcuHJ2XxFEXf3e0+68D74bAdk3u3YlZm9Tx9STEFb/LXLIk4ytzK8fIHXtepcApEmtNFNB RW850uG47CCHssW5PyOrLACijfw9KqY8j2nWsd/Vt6bgms4FlZpkAy0hdXTnQKqMVJV65Q B/2d7IO15Y8qsu46vh68OYQmYk7/7hQ= Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30AL3cHe011301; Tue, 10 Jan 2023 21:28:55 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=/QULkUox5rmihInJovSFDI1yjAOFhDzEXSOdbMBjXi8=; b=eBp22SYBtvNKEZ6zOprjdyIyBSwdb/3z273+jMBssMP1Okfy1mUL8kBPSM1Gv0hY3TnQ wSEomke+4H9hQppoydCfvgDKVmk7D85tVfzmeg/GCSorOP9xI8gHo21Dr05AkvRKlBSg L3Faf6Y60oK8vgxwdIYAY5824ClAXfoCBLc5Z2P6HGFRYFSJxXO62FcgaJJIh8+kGjRg e78EWlNhWybGV1WreLzVMt0yAjaoUfdb4QKWuWjNaFWHTiCqu7KBiQ42LPeDuqXqcut9 w/TcFnmRSUaANd/6kDLYou4zBvVJGh1S0P5INzij1Ksu8swXwBOOqIGD06lLYMnheNIY YA== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3n1fe5830x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 10 Jan 2023 21:28:54 +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 30AKY8kQ022668; Tue, 10 Jan 2023 21:28:54 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-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 10 Jan 2023 21:28:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MeSmqLawREU9WB+NmaDkjvt3fVoAV39/HkUC+wGMFw/8IaQ88aKt/druCCT1C7kqta2NazqsxcDeHSv37bD0PoGBezTQfTI4SF689Z9902pLe/KrdIsYIazWshlBwRMLavBPurmbino7McaneItpuhS5jT+w8FTNLCWtOQEZJEWzKUBAiNajptLYrGhaxQ2/cMHuFlSgYAEixVumqqbZkpdYf/P+4JR2AT/JeLJf/LHIgQzEEzTidU0YFbnRbrny3bjjywgHLdX5SGeK5J2MRq0abdcDxtgAhrpJN+SFXeOAkheVFDCu1gbsYuCFBTdo1oMU716WuUlWz5pbhFJtlw== 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=/QULkUox5rmihInJovSFDI1yjAOFhDzEXSOdbMBjXi8=; b=GirLEpTHL9Vyu8eipOnHfKDPdlzHFmgvcdIgeZ88diB+QObIe8YQqX/SOV4S+wwibEHUxMXqWf0VWQOHTLZsI1+5Dwvq/0p7TwbHuwIidXrXutu/SgQKa3rqr532kjI0Hw/m69Lnt5ZYxYaz/gw8hJG+fLXbXRgIlmlwjiKuHDnrMVDJygkb5Klk1W/8FKdmJN7u4t2ViDqw58/Lakzb7Oz4dzhbicO2i6qtmuaf/DCmXfIYHW4Ag3W0w1V4nWkYKuU0zljZn2Ks9E59huz8vxxtm8GpoV319t2OTBEdsOWlzD4qZsLQ8sZGxhm2ye1nCnj7RQ+TqI0h5+tjRvjpMQ== 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=/QULkUox5rmihInJovSFDI1yjAOFhDzEXSOdbMBjXi8=; b=wOwCSzhrSDm5sM4iJ4hMhPgXHZFFkCA0su5HSt5Tuj8MkP7KDmDVbqzo9POoJjc0BhL+lPCIKcfzlkmr/b1LWoQIznHm/S7LPXcIvLOQOBcurLkNZUHkDuFFWYDMjr8oDfYRWD7DcLvkyqt/LhCWlZStTs4o24iBFvF3FBUJymI= 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:45 +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:45 +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 6/8] mm/hugetlb: convert alloc_migrate_huge_page to folios Date: Tue, 10 Jan 2023 15:28:19 -0600 Message-Id: <20230110212821.984047-7-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: SA0PR13CA0029.namprd13.prod.outlook.com (2603:10b6:806:130::34) 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: 5d520678-d78b-4982-8d93-08daf351a796 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HlGY2VRmQt1jtAqr6txqzH723D1txWZd7Q1oyO2nJH5eNBSPayQPIq4WO2tlL1isVaZgFzMO6MT7ZPPj58uwraEU8HbLqeNMIQw4U4x4yH0UHnYqh18uG1vlXnKRieksSa9y3CG9Uz29BaK9UAV5gMxnTuYg+CotPBGCChrr4CYfDLPMxTXofT4/rY1q7Y5KIKdbtMXscrpKXvH7OdbZnYP0Six5S1HxBUxTr8V5mR2VqB334MHhhRBnMXHQfzCQk4u/b+FbgWFNzwZ4Otd1HTuG5p2N2mdzTiO3GCSFn4p6jJC7cXMstwZxt+rj13uZlFLFJjsC6PH8+yt4AP8YZZagw77pedHaydMbTiZ/WMVvzVm8n6JyDYrpz1SCsrZX6wYixUn/Pg76LzOsxu0N/hn6d221ZLcUelK2kts5IN63f5uzZzd1Hi87A7mEkKp1qASsUer+OAR9B5z7+xPgIzuyg2stCqSe47PCK0Zg+Vi1Zm+0vFGpTnamD6Kz35BUFFpVmToliv3Rnm6YJSaTmYISt0oJ2nIgkEmHFrtiSWo78ZRRcwzkJthEUALRp+M6IoYRNFLzz50xd4OqyqX5D8BZNbxogq037tRIbgGPa+OS0rtU6VKhaghXp9MRmxrJ02aFTiBJkIrCee8DsDJlmQ+NFgkKjA38Fbv441k0DAL2XQe0NO8rnIfUdLIJ2sId 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: 7LIBioIc03Vjh6qEcvWWmobp+Axm8JVNcyNppew+iqYv8I7buyvg11hhfy1cPJItgzUJtcPGTGEs7iJ53hGG7ERZ3Od0iiLnFv+hoCav3/cJdxz774E6u7Em20bdjw2m3oCRn83SYw3+btqrMc0d98w2k7We5B0i6pjQWJmunQ8Tb2ETuyy2PNcX1G3SCkSvb4smtWHqm76y33TuRkK4QxNFSTkywYO5S646m7p38d62olk4wQBhLujej1wWZOJre7oUxeAJRZ+o3/HrzyAEgdzjg7CdMRWZ5qNo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h7nvplqoOYyGDypPL+ei/5TAniUohlow1Ez8QCfWecN41RjsdBiYhTmA+CQPR11u/kXvlCUAMoS+LOi0fItghC2lyBAMtjkrf0LkU9RExaIcjk+MLZ1J6DLeiTMpWDran6D/OLMFP93pBBLdroXqyZnKEewKbeuVVDapAtQDnfBr2ozKx2Z1GKGEL/hilndisaUvTIRZSEfxXloywcEVEK7qJYKJOtB+TOARp3LbG X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5d520678-d78b-4982-8d93-08daf351a796 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:45.7783 (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: LFJznWQHR27S4a41dMgZ27GkYO0X18py7ywBMWPzMlzgzx4MV4xlHX9OsMVClLaq9RKp0CzmsxYpWDAiTsC3tKqLJl0XXJOX+rPxaf7oWrQ= 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: zZBcUxr38dw456bCMStSmob7VO_kQPnR X-Proofpoint-ORIG-GUID: zZBcUxr38dw456bCMStSmob7VO_kQPnR X-Rspam-User: X-R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MV2Il iqYcLyI5 BK99y0xQGp5nuW+EEBIyeJEQNGYiIbn73y1eHHcYiW7NixEPuIwSd7osrsLHr7XEh/5BVEYx8FhLV0NIpL9eLzHC8n7zPQlxwh2fABNFW4SWr4Mt6h/P9z5Zr1DTkOOZB+ItQsaOeky/ZswvsxULtju1D/g== 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_huge_page_nodemask() to alloc_hugetlb_folio_nodemask() and alloc_migrate_huge_page() to alloc_migrate_hugetlb_folio(). Both functions now return a folio rather than a page. Signed-off-by: Sidhartha Kumar Reviewed-by: Mike Kravetz --- include/linux/hugetlb.h | 6 +++--- mm/hugetlb.c | 18 +++++++++--------- mm/migrate.c | 5 ++++- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 482929b2d044..a853c13d8308 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -680,7 +680,7 @@ struct huge_bootmem_page { int isolate_or_dissolve_huge_page(struct page *page, struct list_head *list); struct page *alloc_huge_page(struct vm_area_struct *vma, unsigned long addr, int avoid_reserve); -struct page *alloc_huge_page_nodemask(struct hstate *h, int preferred_nid, +struct folio *alloc_hugetlb_folio_nodemask(struct hstate *h, int preferred_nid, nodemask_t *nmask, gfp_t gfp_mask); struct page *alloc_huge_page_vma(struct hstate *h, struct vm_area_struct *vma, unsigned long address); @@ -1001,8 +1001,8 @@ static inline struct page *alloc_huge_page(struct vm_area_struct *vma, return NULL; } -static inline struct page * -alloc_huge_page_nodemask(struct hstate *h, int preferred_nid, +static inline struct folio * +alloc_hugetlb_folio_nodemask(struct hstate *h, int preferred_nid, nodemask_t *nmask, gfp_t gfp_mask) { return NULL; diff --git a/mm/hugetlb.c b/mm/hugetlb.c index f3e1d052b40c..c0cfb075cd58 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -2275,7 +2275,7 @@ static struct folio *alloc_surplus_hugetlb_folio(struct hstate *h, return folio; } -static struct page *alloc_migrate_huge_page(struct hstate *h, gfp_t gfp_mask, +static struct folio *alloc_migrate_hugetlb_folio(struct hstate *h, gfp_t gfp_mask, int nid, nodemask_t *nmask) { struct folio *folio; @@ -2295,7 +2295,7 @@ static struct page *alloc_migrate_huge_page(struct hstate *h, gfp_t gfp_mask, */ folio_set_hugetlb_temporary(folio); - return &folio->page; + return folio; } /* @@ -2328,8 +2328,8 @@ struct folio *alloc_buddy_hugetlb_folio_with_mpol(struct hstate *h, return folio; } -/* page migration callback function */ -struct page *alloc_huge_page_nodemask(struct hstate *h, int preferred_nid, +/* folio migration callback function */ +struct folio *alloc_hugetlb_folio_nodemask(struct hstate *h, int preferred_nid, nodemask_t *nmask, gfp_t gfp_mask) { spin_lock_irq(&hugetlb_lock); @@ -2340,12 +2340,12 @@ struct page *alloc_huge_page_nodemask(struct hstate *h, int preferred_nid, preferred_nid, nmask); if (folio) { spin_unlock_irq(&hugetlb_lock); - return &folio->page; + return folio; } } spin_unlock_irq(&hugetlb_lock); - return alloc_migrate_huge_page(h, gfp_mask, preferred_nid, nmask); + return alloc_migrate_hugetlb_folio(h, gfp_mask, preferred_nid, nmask); } /* mempolicy aware migration callback */ @@ -2354,16 +2354,16 @@ struct page *alloc_huge_page_vma(struct hstate *h, struct vm_area_struct *vma, { struct mempolicy *mpol; nodemask_t *nodemask; - struct page *page; + struct folio *folio; gfp_t gfp_mask; int node; gfp_mask = htlb_alloc_mask(h); node = huge_node(vma, address, gfp_mask, &mpol, &nodemask); - page = alloc_huge_page_nodemask(h, node, nodemask, gfp_mask); + folio = alloc_hugetlb_folio_nodemask(h, node, nodemask, gfp_mask); mpol_cond_put(mpol); - return page; + return &folio->page; } /* diff --git a/mm/migrate.c b/mm/migrate.c index 6932b3d5a9dd..fab706b78be1 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -1622,6 +1622,7 @@ struct page *alloc_migration_target(struct page *page, unsigned long private) struct migration_target_control *mtc; gfp_t gfp_mask; unsigned int order = 0; + struct folio *hugetlb_folio = NULL; struct folio *new_folio = NULL; int nid; int zidx; @@ -1636,7 +1637,9 @@ struct page *alloc_migration_target(struct page *page, unsigned long private) struct hstate *h = folio_hstate(folio); gfp_mask = htlb_modify_alloc_mask(h, gfp_mask); - return alloc_huge_page_nodemask(h, nid, mtc->nmask, gfp_mask); + hugetlb_folio = alloc_hugetlb_folio_nodemask(h, nid, + mtc->nmask, gfp_mask); + return &hugetlb_folio->page; } if (folio_test_large(folio)) { From patchwork Tue Jan 10 21:28:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13095681 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 E4427C54EBE for ; Tue, 10 Jan 2023 21:29:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1E9F6900004; Tue, 10 Jan 2023 16:29:11 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 19A15900002; Tue, 10 Jan 2023 16:29:11 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F2E58900004; Tue, 10 Jan 2023 16:29:10 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id E0BF2900002 for ; Tue, 10 Jan 2023 16:29:10 -0500 (EST) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id C0C4B1A0D50 for ; Tue, 10 Jan 2023 21:29:10 +0000 (UTC) X-FDA: 80340180060.12.FFDCAEB Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf03.hostedemail.com (Postfix) with ESMTP id A7EA42000F for ; Tue, 10 Jan 2023 21:29:07 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=bjHs6MOm; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=BVjtNSEA; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf03.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=1673386147; 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=JSuCthEGD9mFVQwtGBQpQYgIPpxHUVzJky4kAU11Yd8=; b=2y+DTaQkcrS0cv7uBLDTofOW+ji54p/hDCMht4nrm8Gl1Rh0Oi3orkrLv/Ot+rqxhX8vOM 8ZvF/46oeJ9j8NcaABgrluzp9YworLwaDxI0s8w8CjGG9J3+3Z4h16XRWLehioF5MUktfM C9VcHsk8C6FBLUslkV2LHVB3434ZXm8= ARC-Authentication-Results: i=2; imf03.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=bjHs6MOm; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=BVjtNSEA; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf03.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=1673386147; a=rsa-sha256; cv=pass; b=RCYwBHKsHAIK4Rlveu4YI8L4Hg23yQr8Pc23NFO6UwFAsXgwkP+Lc1HzrtIOG9SnXzIJgZ lVTYAxO8UgJLmuI7MF+oRQAlIrUZweiWTP2gA6zVlS7p5sBxu5WG0iX1/cVo+QV1/C5oUy S6SvTImAI40qTV9o6YpuKCTQiTg47WA= 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 30AL79oc003394; Tue, 10 Jan 2023 21:28:55 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=JSuCthEGD9mFVQwtGBQpQYgIPpxHUVzJky4kAU11Yd8=; b=bjHs6MOmTGzeiHevdYCLp9OUxMfy+MIR2ELZC4G02tYO9Fsc5HJSaL/bg9gPquqGyNfh cjL1Np2LC6r3yLb8c8HO4HCWxI0Lua5qbozQH+g8D+jzPK9YNWF+lK2LUrEbWsEuXLx6 uecQYGYq76DDu5dIedNOA3Gz01RB2U9UcICLB9vFuK2TCt3N6XBcsdxjQUONKsKiyCAU jjEWcxtv3MqYrb6yGOzbj8evabR5F4trPt8Bv//NZn0R+D+vAb02sL2UKdQgMoqOeDnw 2mMuphu55zSmVx+n7FYOtvazjNIAJnQB/CiWgwHHNtpMpcqIRvRmKmWOibUnulzPwVov 9g== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3my0scedt7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 10 Jan 2023 21:28:55 +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 30AKY8kS022668; Tue, 10 Jan 2023 21:28:54 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-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 10 Jan 2023 21:28:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S5qV87XunAXGbyq6K7n/4PFOCelgPxU+ic+HyQrcTVq2GzfrNpvPPU96qdl3sRGbIFtR3y8wa8uVEUOS0zH9ESBSqpwyifjBjhKJANvuD2Oc1X4cck53jeKBfGwwy9euu+bpjtRkfQ8fhmO5vjij8YiPdCMWMpmz2a083tRm+WYW9VBVmEfOp4B6ULKe9ROhNUP6yj4CEoye27pWdW/1GGjKAWyY1vEhCR40rQ7K8NMM9v1485F/NRauicrYmde7Sd6tN1YnEPzUIoRgNpUvjamD7le9QFB12fmGYiRMBH7GsWwgXY60paebmYedCcB0j3exYLx8RYwCWcvLaABxAQ== 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=JSuCthEGD9mFVQwtGBQpQYgIPpxHUVzJky4kAU11Yd8=; b=O8SOIX+4kAZVGhWCM45Wk0DvCAs2QMcApXfCZiuQy/I20HQPGWdajE1vP3Q9yRI2bH+DnRV5jgJI5KhXQIDQtVXRgpMlpky29I0k7ti3/hnqZVa3GYYQ5qADSV7c4RKPolNZg6/biPsSxp3e/w3qPQt3a8M5liLXKGdF7ggvp0+lM2L5l8mep0SzPpa18LzchOWiZcUyx0iemGTVmxredMwxVsnpOQWSBuUkFxa4epbNhH/BiqGHGDIFxfw0YA4pRUG1+1/1gnyGL8eY/TK+6z8RNg9bYGVuEj57sEnjaP7G/25SzjBGoo1jPBUOVyqS/ZznmT7DtarefGU0wbFlfg== 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=JSuCthEGD9mFVQwtGBQpQYgIPpxHUVzJky4kAU11Yd8=; b=BVjtNSEAMruyUhcWbt80p6WDBx2GX9o0sPxu6vfc58yh9NA9JbPQpdCvN3QnCur4BdmjUwiUdLV5p6Jz6XdIHFZmCclHP11ERNs5YKuNGCVpgH+Od5+yuCDRplQ+nlG4HkGihtWWvMOJjavtD0fKW8ekdjfNr4JqPZ5lLzE5CKk= 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:48 +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:48 +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 7/8] mm/hugetlb: convert restore_reserve_on_error() to folios Date: Tue, 10 Jan 2023 15:28:20 -0600 Message-Id: <20230110212821.984047-8-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: SA0PR13CA0017.namprd13.prod.outlook.com (2603:10b6:806:130::22) 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: 931f2644-3f35-4a0d-76e5-08daf351a8f2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7Op1fJXOAhxt/B+MP2vi8aVDyrKQCCF16EDsX4LgqB/PPrt9PF9DDVGfeVLiuIjioLTYPNFllbxfN/t/IhjIoYPsgu+Wsr6CXgX4Z6nuf+VRiUCF2QGOq0/bdXt0CMr0azBjSXGrXMnjopwT52E1lwEtKLx8W4C5i7UxjsreAo45ZzWuiBkplfDuXZBiinx1XYaHOtPjvCu1Xrm5a291uCgEcBKX+d6ayMLx3tO+hMARjjKBTu+falnCjcFZ3P9f+ezao1r+amHUCu3VgiN/KbdBXonQ02uIXGKzZ6pqU8tSmCqmkPdIMYnjgq/s4W8JTvPG1U/4G40IG6o1cG8Nay5wCPkjGoFfyFj+V8GPxSFFEcVHYGlNMrDbTKyEssCN+tXhVpXwb2Q1Nc/QCnmjB+ZmTvqVRVzxpZvER0S8myHhVN2DfVOksyL36M0N7xkLnNvGqqM+UwdTXXSZL8EMqW/5OOWhEZdVJ0g3ZWSPc3bwnBoBV31/mFj4DlEaB21GSOwIvk3Cv8y+xGWwdKKkhnvc8Pp1g/sPMcEke62ZD014rn7TC9XR0uqnQeQYHUQgmfXAUZHNZ9H3Ph10RAs2uWQFWYSm9DFoAZzCjCMWGHvBZ40f6oIIE//655Rakwc/2JMGy+y5IIalGp5PVFxgXQ== 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);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 7iTJpskraAojz1GbnE2AT2KG5kENru52V+8Ww0Lv8DFjHudNUWU0CAOleQRiY2nX+ZND1lQ1lZYvxo3xXiWrb6Ccrg0FECyBpgEzNb4k9VBJHX4NxCeylKGV70jrXixozeJ+SqEux7wZvOd6+OipxFNyLxTlHqWmflgg84AIu6hUicNWq1lTr2fsplPflTqgdlskYg8vBoTh8SwS9Gq05JnzpIaWzoq9BodNJUt8gOj3VovrOrJ4bTKK+2Q8w3RvG/yiGlHi4vzLRWKYCuIqgZyjAXRSaErCDpPmAhWrlZFdELt0QropSaRN5mbslF6PAP8AJqdhTyqhPwrpWn5w5VCQR4xZYu5a2emskWR+IYgdrkV2z16D3qRzXBMUZfKEeos0x5eOD/svweiYWGgEueKngBZBsnb3kdF2rB7SHl/YtOzy/xS51SiH14oJRNbpbReGD5RCb/pLs/irfZQGGQRbOTSghjdoC8Sc/NT+9u93YjsAXrLse1XZmmyZo+ktB0+ZUuHIX3P3san4LOcYUy08gRtBKjCztnA4ABRcIhAvnRg0+4jMK5Qc2vaiceGjvx0jAoSMeHu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ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: bRDofkayIcbX0J0MrCaEGjj2IcQyMu1AY6ZZ9k6XDgrbGn2SSgqexySob4tDgzg6BsFmEkyGF+sPzUGeBLbpEuXQv69iqdmeVeDHB4tTrFh13KmFsJrRVSBAuyzBhWkKwZrhkuhs4V2smS9NAjcVPEFGyZ23QDM5fQ51Rxpg8tlEkETHgBf2dPSPR7e+Yz8TPTOBONM2MTQgXzW4+9fW54MopuDRj4L4yAqIqSpuIk1y0XMj47L5rKDadvc4OpKnUlb2zFEOw3C8l7CUAfSK/dQj6aCusnGmKflaWuRiamdKE64/zvzMP9WKWhZ6q7SbG+ngceMJ+ngj9OobWYl2K9HOh8Jp+7r2ZxHle75zNu6/4csafbi+zRdf4R/eOpUZoOEcihxej/o0Qv/D7ipvk1fZWRF+GTuL8HKwCoFHVUk6UPWk4jKcCdPnEGlQwX7exKb9L5ed5uwq0ki8HyYm/fNVfxVVBbHmHCSDMeV33rWIKJvG0LN1V97SomHhoZ4U8JWV31oq5yOdziyrbqDyCuIBO5Bm2zUr3aNbWcTp4f/kGBLMu8RYsc0ZVjYw5OfgtFkRNrhtPIOsVywrTV43CESzh87JcSi2ck9kh5O7LR8kS2rBN5rIrlYBfOOKzb4WjQmYnICEt+Upq/3iJGy9413E9iKYYAr93yfyhR+kr04rDX+Q5dGbfV9bfNk+MG/eQOfxlcNmzKOedRJrfMGESHwdkQFftATL0PtyEEgmgktLEkxeM5mS5vz1dzxXkk+ozm8uR+tjZhllyZMssxxjqqayeBEjS9yq+gEzpGwfbxRLVGNB3EX5of0AVBrFHdkqhhW4kDtjcp+TpfdPbcSj4QCYro/Bx/VH+zk6UVRN4gVULqVG8TXbCpLkL09y1yFhzKyGecaB7HM4ykB3a+HxxxxdliBC2H3qakNaAs4W7MzpPdWjoN1gtsnxi6EhyIX/ X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 931f2644-3f35-4a0d-76e5-08daf351a8f2 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:47.9959 (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: wOsK31rU8axA2Cv8B8kDQsG8IaEwd+oQ0zNcUBdkQlJJyDCPTTplFYGX2VK/PfgZoyTlXPfEm53Ss5+d7eOpgya0gkjUKz59fKu+pJsSgTw= 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: cPj94O7dIZTjnwK0wnKPwlQ1Wwdctz9p X-Proofpoint-ORIG-GUID: cPj94O7dIZTjnwK0wnKPwlQ1Wwdctz9p X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: A7EA42000F X-Stat-Signature: k3zwz9fzuwkut6eqt5xzs5cgx7e3z77h X-Rspam-User: X-HE-Tag: 1673386147-751787 X-HE-Meta: U2FsdGVkX19fIgM5FHoQtQODVmU1+ePDZXhDtGpHSOrAkPfaNWjxgt9ZEsiZq5+PyqiGXYNnUQGaLABt2MQe+0CDIf8mUVEI2062vkHD4xAQN4v/CCihqzsPtWOvxnXxb3lAmu7bGurGk6nvswM0BaYr4pWY0Wp3mDz2UWm7ZRnClEWyUbcWfvo09oy1xu5FncODibUyOJblKXwnvseFp2iXrUMqBRdChjsDuJESvKcn3UfQP/Qy6kog8Q7R3uFzFZaeBy6sxadmChNfrmPMjmYUkdiKYOF9/5SGVLAmgT/CGfTqj9ulPKQ7WvviauqXkwXrkBWIaOkvBLxskFxdoWFnv0UO2fbCPuf1GLGFat49qVKMF40sxLWHuGWkcME/+x7t8i9eNXGuYziFWhGkNmogte3ip97+m7eE1G+5SxwwD1YtRBAE/y2PH++Hx8myw1wVaIgxa+9NGbpny76CMp7J67EZ3KRnZf9pXdAVYUInT5lXe8OY0PA3Gur42JnQGpU4U19nD6T8AFgcgppxUiBHKU07hp2XopRu04kPVVp33Z8zPwOGbdhMHd2KHk7A24919tM+fWcCl43rhWr2KlH1VudUwSI9NTERN7+uETb2eEWc7yzrvzeDiY7jlvw2DZvIaZ0XjMgVkpkijRxOUkYY5aOpBEHhmqGaiuZC99+qtaRwsJ7ilcWPOmJzZ9riGtVHyIZcHPOO2t7ce6R4zNYm1gOoxmod6hsacIvm18TnqDzqTHHQK57Ycls4cg/NAqV0tMilDfVvNf/N9qwmceeM7svEdIwhLsDZq78rXcqauIPZ/p4r9WWLeL2Z91GRpT9oqo7DJN/f+MJaic8Xam8WL3wdsfvMSoArL33dANPtjk04GDqemYuMSD9X5PlctfttfwH36MVNK+S2WC/KOIFz9a9qS4G+5Ybc4+QiYBH/HG8wQ6b9MPSh8Bws9rvXu4RI/rLqpXIdsO3ew2k Q8W/CQOy Ho4y/tgp9+ake8EmdPUKyWNK5MwuHnta0DWB7YxqeqYiXm35CPshQKiaIB0V6Era9+F4dJdAi6RIijQzJ31VeDZ38+UEgS0QjpH94ZtKrXpPzK8lL3/i+zg2B+zc0FRS1rM+u7PCnwdIIHC4EypwedLkxzQ== 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: Use the hugetlb folio flag macros inside restore_reserve_on_error() and update the comments to reflect the use of folios. 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 c0cfb075cd58..f8cd0c694fe9 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -2675,22 +2675,23 @@ static long vma_del_reservation(struct hstate *h, void restore_reserve_on_error(struct hstate *h, struct vm_area_struct *vma, unsigned long address, struct page *page) { + struct folio *folio = page_folio(page); long rc = vma_needs_reservation(h, vma, address); - if (HPageRestoreReserve(page)) { + if (folio_test_hugetlb_restore_reserve(folio)) { if (unlikely(rc < 0)) /* * Rare out of memory condition in reserve map - * manipulation. Clear HPageRestoreReserve so that - * global reserve count will not be incremented + * manipulation. Clear hugetlb_restore_reserve so + * that global reserve count will not be incremented * by free_huge_page. This will make it appear - * as though the reservation for this page was + * as though the reservation for this folio was * consumed. This may prevent the task from - * faulting in the page at a later time. This + * faulting in the folio at a later time. This * is better than inconsistent global huge page * accounting of reserve counts. */ - ClearHPageRestoreReserve(page); + folio_clear_hugetlb_restore_reserve(folio); else if (rc) (void)vma_add_reservation(h, vma, address); else @@ -2701,7 +2702,7 @@ void restore_reserve_on_error(struct hstate *h, struct vm_area_struct *vma, * This indicates there is an entry in the reserve map * not added by alloc_huge_page. We know it was added * before the alloc_huge_page call, otherwise - * HPageRestoreReserve would be set on the page. + * hugetlb_restore_reserve would be set on the folio. * Remove the entry so that a subsequent allocation * does not consume a reservation. */ @@ -2710,12 +2711,12 @@ void restore_reserve_on_error(struct hstate *h, struct vm_area_struct *vma, /* * VERY rare out of memory condition. Since * we can not delete the entry, set - * HPageRestoreReserve so that the reserve - * count will be incremented when the page + * hugetlb_restore_reserve so that the reserve + * count will be incremented when the folio * is freed. This reserve will be consumed * on a subsequent allocation. */ - SetHPageRestoreReserve(page); + folio_set_hugetlb_restore_reserve(folio); } else if (rc < 0) { /* * Rare out of memory condition from @@ -2731,12 +2732,12 @@ void restore_reserve_on_error(struct hstate *h, struct vm_area_struct *vma, /* * For private mappings, no entry indicates * a reservation is present. Since we can - * not add an entry, set SetHPageRestoreReserve - * on the page so reserve count will be + * not add an entry, set hugetlb_restore_reserve + * on the folio so reserve count will be * incremented when freed. This reserve will * be consumed on a subsequent allocation. */ - SetHPageRestoreReserve(page); + folio_set_hugetlb_restore_reserve(folio); } else /* * No reservation present, do nothing From patchwork Tue Jan 10 21:28:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13095682 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 70476C54EBC for ; Tue, 10 Jan 2023 21:29:13 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 63139900005; Tue, 10 Jan 2023 16:29:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 608E2900002; 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 37141900005; Tue, 10 Jan 2023 16:29:12 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 178F0900002 for ; Tue, 10 Jan 2023 16:29:12 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id D84B5122D3D for ; Tue, 10 Jan 2023 21:29:11 +0000 (UTC) X-FDA: 80340180102.05.24D89D3 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf20.hostedemail.com (Postfix) with ESMTP id B64431C000A for ; Tue, 10 Jan 2023 21:29:08 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=njljbaOh; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=tH9NMA72; spf=pass (imf20.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=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1673386148; a=rsa-sha256; cv=pass; b=iDEImj8gGkTxa0s+OiVh/8Pb2jgjpU2xNFhaxgqZBywYeMrXraPc1Fw8b2ntUF+CAB9SoZ FWoRdb3ObLwMOgm3mr5eDbr7ZZOJ4EmNgyM/zkR/vp3MR5oxz6XEQQzSEBDXK6XTVcvnwW PXNNQKWTrhYk5K0JZqI23DzOtIvJgQM= ARC-Authentication-Results: i=2; imf20.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=njljbaOh; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=tH9NMA72; spf=pass (imf20.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=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1673386148; 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=0HbIDU9gvROZzz6/UYBDpx1N31Qr4FGP4cShMjeUTgc=; b=1l2dGtjSVUwR7s9hMYC1kP6PDDDISY8aWJWTD09PmTvKDH+ZY1YrCG0SccDCY5+RPUhN9q qSzsDvdZo7EVDRsOoxeAXlbgKQXqWNYoqOyvWWtsyk+kNdIHSakN9XOZsoLU6qKFbHAtbi x69QvHrG/RiqofV34t2fggk6XEPngic= 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 30AL75TY003384; 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=0HbIDU9gvROZzz6/UYBDpx1N31Qr4FGP4cShMjeUTgc=; b=njljbaOhL3N5YeyKZeNnCX6TrY2musWjLmR5Rpl1V0OPHc6pkph8IpEE2VlfpkF6LziH 7AFSviSYFNDb7B/2+e373lCxzxwlsaHxDwqxuvVNZZyHn6GQx3OHOE8Q5Z6BkhVqf39O tuKw0iHg4RdDyAUURi2NS5bm3KZaESngj9DJcjxeqbw41kUrGiZgNKP62PGTdknQ9yF+ plxQgYECpWUnoVYiuhVTSBBhiVQqJDSnUnaEHRBkNqECN5OhR23LKKAovMQmWFchVCXe iiQUgPQNEcrZJm21KueCBpn5IiZOq1vOVjdJrAZKeXhuqDm5O8e6Hha7oWw/tAMDj7xy Jw== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3my0scedta-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 10 Jan 2023 21:28:55 +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 30AKY8kT022668; 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-4 (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=nRBJjOOnvG1jserSMLEHUEEH68giFPpMa1AAvA0PWSbAgeERLuKaIglq8GdzJoLrOWjUTpep4JGs8I9ZJcCQkSFCxwVmUk2kQi2KHuIr8oh7prL/rFNcULP7+9v0EpA4t/tK2oPDttLkksnau+yTNJu00SVPZP5GMp51Y5+lLzuT/9ishVPMagvk9WVmnxracJfhK8aNGfq1RCaX+Rp8wnLsId5HLbVmf5a7oQBccNq7ORZl4hdbShUo9Unw3Reok99s/mGvsAzXbOMreo1IgXpiJ+aKALlBYWvnMK+ORCbHCHu4f1VJwXzs2ZJhSZQ6tcz9Z6AJmGHy8T07YsixBQ== 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=0HbIDU9gvROZzz6/UYBDpx1N31Qr4FGP4cShMjeUTgc=; b=JDo91oBPJ6Jjz0DywgB1Ag/gxsSNG5B8Kn1sRiuw6jBvajE94bv7Co3Jhh3W/ktqJCTrzx/TXULgeNBOA3UidsFzYS5hdAN+tsREn2BpyoN/W4WFrJAU5KDbxPxNR3FqOzRKMwPew2y151WBkET78Wthk6yKVhQ4cBSFDkXG3r9cZofvrsj483Em9VuCvEzI0cu6cMOyNKad3Q30psVDLIoiUhFiVXsF8thy0RQHlZ0X7IWmkl2x/GjmbhFGP3lSt0ZfIqNTUBuEe1C+M+5RbZEJqhe4JgKpD/9abBCu0PrnQ/TtAWAAnFnrFrT7dokFCMwmEP98/BAE38ZoCFS28g== 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=0HbIDU9gvROZzz6/UYBDpx1N31Qr4FGP4cShMjeUTgc=; b=tH9NMA72cmOPxLCU/xr5C4XarjTe9y8DGDVxrA9dZ9OGcpfZdGdhOG3PA4z/Yu1q+xTPgwPFSu1DvP61EmgHo4lq7EQVcyUx2fPy8OqsI5iiX0VixxU3Pz/fA+H93LCs5Diyao/2QKR5YIIbugbTezeBsERNPGiyuNyyxkXsEIs= 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:51 +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:51 +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 8/8] mm/hugetlb: convert demote_free_huge_page to folios Date: Tue, 10 Jan 2023 15:28:21 -0600 Message-Id: <20230110212821.984047-9-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: SN4PR0501CA0109.namprd05.prod.outlook.com (2603:10b6:803:42::26) 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: 43935b9b-26fe-447b-7543-08daf351aac8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7mNVaNsS/guQTrxyy2p95G+lLeWq/OkTCtVnsik/T7HgI8wWsIQb9gn8bI1gNgz/xx1KxJ1k6Z/VKiChOcYX5V5FzJcQC5ld5BCsLFUoSQ2chfbxQb5dk3lEX0w/3VYRZ92EtqCSOELTD8g1QX7XlLlgDAUkmCMe62dJTcBXK7tfhgFVDBQ06ndDbZEqaHEnINTQJurvopEsKFnmAONj/GzyJrvUhpHbJZuyDGFnat/uu7fCQZPTXbodq7tdTJAYHX+A1vZYIe1bi2cq92Klllx5YuN3xvUQxHr94viLEZOP2Cc3TkYlqpGGw8Weke8GMNrrb7IZBTookoP37eYaPmfgpHQV9fjTXkeolkoU6RLk8jsKoLRWg0SsJifhuEIVbD2WMeGiAGNsdWcFb3xx0XL/k1ocuD4BGs3wmxy/F3eAQfpQr0e3Nlfj+owEOn5LzsdMfmM+MmwgkaLuZo7kqfGlZDDBwndz9wNJb8eKyLWYnAV8cHDQYwq0vrooKsg4707rjjK0AtDnL5ClFLY8HMmmXopR85158lvpNk2sh515fvr8pnGnG0WX01CY18Gm6yu9p/qXfu0yNDYZMC8Tq58qGpAXsPNg9qk/no9RZQwOSf36E3XC+Uoq2XnHGe/nb1qu8RfX0XaJr+sMLWv++RC/bS8pzpiq4adxJSA7MvFQRoB/s9TD9ZIYpDpXBvbA 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: WfR9fycZJrlV+w33zHd3+UlD8TH81Dgs3hXBqUm59bub4cmph6Gw5A2GMFdnh3dS6ryrT6EpEWcr33n0c3SciMSrkoUHbDWSEQ8bGr452fi643JDjkESoM7COHYRmbQTbgmWed7faiQ4s5X8SwCt9MAwuD8o/XyanZuvuC5wLypAK71Ej+sZLpUK5aXfRub9pV1zZqFkuIXmDryBHU5lfoCC+2InrUN4IhlraSJK0LgKTzuGby4NUlgDC9Z8oUeCCsy1yt9qWAMESQrBi2yt173UwC7xcKk9wC8/DeOjSQcaZ8vsGCdNPYznbV9//Py5Zxvx7uhnVEKzebufONq92lC3sjml1W61FV+UUiNO9ka3ae2pb9vuL31L9Nb41VWlZ05yUnq2rndiw4Ggg6pHhi7lwANRAkItgZGJ4qQs9vfFF+7KerR6uT9UNjIB9J8bRz5auN2M0rumZuEl7zbsMfV0mLIm+aP8z28Cc7KCvx+sNz9Lt5eu/TT6yKcO/lNsacSSAiPBzF0jL5B89c3SLwOwvnHX0yAwQaAZn8b1pdlyjJKR4ujo5qgsW0nKyKsuEQEJMcj5x97Gj2yK7E6XDDMP0E63zj6Su4KtYNraBrZDjn6vxiglPMpV63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wgXLepa8X/0lwVDYyj4C2M+F9hYJ4qDDZI8EIoAw7ysGEjNqfJ/AaxF61r/wY5hWNPJdzKF5MFzRXKJMJmqGoo2jPqx7ztxBYjW02q2zfWX/MWWYrM9QDto9wjmAoVlhcyLnb/gDBHejQMKi2s3+ak8uahNg2G92JtD97YAWn7tYNsZIbzR3fYaZ+WOqh8x4FhqVjtZYma/jZBmHHVVRsGpC7V+a5Pm/PRSJFjNczL+5k8ejJzm7MZ8E8kYgTux7G8WnfZcRdRNYu55UHZfh6PUpYK+2ghUkjny3c+5MCpAMNIhFJWUFCcOvW/SWrSzIhWK+BumlrwXVIROc/tTHARHNKNuqaEalntbmLFts/dU9HpYl2EeAUyj8db/PUUQO5lNnLqrS2+Klm6mxkYMekLfIBSHZXOfp8pgiQqNSCWrSYKrdKGDeSmNvBrG0i0wviC2zmTFJvjDvZtNg2NkYxeC8VlHiJ/C5LAJvQh39ctDcB221fDqGZM0owlIuR1RByAKazFfsnEVZPZSFOMB+5Q49XcWA6/2uNPAq3r2a29kblRg74Z+MNsbbuPDESGHY+GrZ93zTjGDT5LgR3Ewt44QOGvkiDWLn8dY5e1O12xySkTWugiEIYsA+SoU+E7C8/6KoqA8RAV26aSRsNznVDH4P7D/PNHh00UpQgEEoXNUNp0v6KgTikoW2X4x7DLS6aAqHZC6G4el7yjG7wHoqi5k3I90otvqsd6lILhuYdlaeQ8XE2A4Z/eu+TGtKwp9agzSgFIXeeIT0yVYiNVxLhYqcTEdbwuKwfD6v9GijYE7+FUjnUFM+bQbWl+U5icOsKRXGNncSJwQxrov1vuZkR4dCX+jx2GnW/dfSmvq85X6t8YVstjKgE0wZNOdd/rjC/Q4yzX3dvnvnWxEbvIdoT9sEQtq6OtLbemAhKvdFGm8RiXdaVf/EbeRXGgtTk70J X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 43935b9b-26fe-447b-7543-08daf351aac8 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:51.3104 (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: EHwiKpbqr60yiE2+jZSaiTR2yVp9m03k8khCqSolb3D3g48R3EMXVZEZAhEp+05nV78VpqTkd8ZkqJrCjFGY09YZ+HjdYznt+NA/bZFn/AY= 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: TK6OfMZXmgatTfrpscOYNIbXxvyTBP7w X-Proofpoint-ORIG-GUID: TK6OfMZXmgatTfrpscOYNIbXxvyTBP7w X-Rspam-User: X-Rspamd-Queue-Id: B64431C000A X-Rspamd-Server: rspam01 X-Stat-Signature: 8gkpyuar4bbz6x8puudimoq57n6tm9sj X-HE-Tag: 1673386148-327639 X-HE-Meta: U2FsdGVkX1/6MPhDjxDqIUAUqJbkv64l8pilWKD8qtOUnaeRLHTnzqhplJHrYtpQs2yScXh7f1NdBARKsPRba4P32xfJkDp3TQxYU3MOJ9qq4C8Q1Ff6RNv9kOQdjaSVHqfLWFHACytnBbtI/EtW9tl2Y+WPjALqgberoKP7+dZ4uElYt7M2nb36J/7+DYCCV5HJLd+9upiQya9swblCUSBceh3gkD3LcTfXtg19vcS6CIfew96FpNWD2h2VnZv/BAjcksRYqDmCI/ZUYQWLMbfJH7XhY6cd2UTjqw02LOIe9fafvw5y8oFvAun077aemoHho3KxEN2po7x2I4smv3UCmutsf5qddFU3D9Rtx3YkEXiFUU6OcFVHPKl+ACUNnjD2HyMye9QldC0nLTM86qif5L07p6uWL49JCy7YM2YIKUqytEGRCZnZEWgpW5MP9vt1Z8oFNohKRKCGp+4bdQguwS1YfUroLZQYBfuAu7QNjEgLX02eQ+rZcJtiTHaUl7qAJ8S89OxYtfkvoPPf4o/zuOBK5b5MfNqbjN7A/4QVH6tja/tHJ7V2N/tiqTjejaTdxZXeC52YLnK7UrRoLZZOr5YfHTpKev5OhkbzDU/y/urTGayq33W87G+tw4lX6Pd54iLJB+L7s4ZKL9MNUxobC6etuEM7YqwkXFaTqZft20E83kybrdPwYNMd59B9Bm2nO5zZBV7oMwdL5nuf9ls0vgwM0X9ZqGOXAmU5nosTXOnpssz8SGkUYpT0JLs95ym9mOsXnQCJvoW0wa5GBuzM1Z+kI23IN/mbGNWN51YoOrL++XnYg4X/cICuZ0FGaBXc5JBKLjG41HDiiqizjvC6/6BSrgqCSc5z6KZQvlVMF2SYaloGWwLP2d7L8dnqH0DBH0C1mK6/auBi8B18nLMayr18pysHD20LFvNxN2S+1Kbf/yKWkFwJOlaHUnJkhKbNqYOKBMW98fhOZSw 7QD5tyx1 /U3kMav1xzUtbwcDrmikEPio9L8lmBjK2EPnP2QXFSKLUHTe2ggcA3fl7oXDcklgTyI3OwSl8H8J6xs5cf3d1twBw3bH6iXLhls4Akx11wUb0iYPvDonCuniKhsJa3c84eYrsdTwA/+xijbm8ofSj1qEFlQ== 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 demote_free_huge_page to demote_free_hugetlb_folio() and change demote_pool_huge_page() pass in a folio. Signed-off-by: Sidhartha Kumar --- mm/hugetlb.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index f8cd0c694fe9..21ffab744c8f 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -3435,12 +3435,12 @@ static int set_max_huge_pages(struct hstate *h, unsigned long count, int nid, return 0; } -static int demote_free_huge_page(struct hstate *h, struct page *page) +static int demote_free_hugetlb_folio(struct hstate *h, struct folio *folio) { - int i, nid = page_to_nid(page); + int i, nid = folio_nid(folio); struct hstate *target_hstate; - struct folio *folio = page_folio(page); struct page *subpage; + struct folio *inner_folio; int rc = 0; target_hstate = size_to_hstate(PAGE_SIZE << h->demote_order); @@ -3448,18 +3448,18 @@ static int demote_free_huge_page(struct hstate *h, struct page *page) remove_hugetlb_folio_for_demote(h, folio, false); spin_unlock_irq(&hugetlb_lock); - rc = hugetlb_vmemmap_restore(h, page); + rc = hugetlb_vmemmap_restore(h, &folio->page); if (rc) { - /* Allocation of vmemmmap failed, we can not demote page */ + /* Allocation of vmemmmap failed, we can not demote folio */ spin_lock_irq(&hugetlb_lock); - set_page_refcounted(page); - add_hugetlb_folio(h, page_folio(page), false); + folio_ref_unfreeze(folio, 1); + add_hugetlb_folio(h, folio, false); return rc; } /* * Use destroy_compound_hugetlb_folio_for_demote for all huge page - * sizes as it will not ref count pages. + * sizes as it will not ref count folios. */ destroy_compound_hugetlb_folio_for_demote(folio, huge_page_order(h)); @@ -3474,15 +3474,15 @@ static int demote_free_huge_page(struct hstate *h, struct page *page) mutex_lock(&target_hstate->resize_lock); for (i = 0; i < pages_per_huge_page(h); i += pages_per_huge_page(target_hstate)) { - subpage = nth_page(page, i); - folio = page_folio(subpage); + subpage = folio_page(folio, i); + inner_folio = page_folio(subpage); if (hstate_is_gigantic(target_hstate)) - prep_compound_gigantic_folio_for_demote(folio, + prep_compound_gigantic_folio_for_demote(inner_folio, target_hstate->order); else prep_compound_page(subpage, target_hstate->order); - set_page_private(subpage, 0); - prep_new_hugetlb_folio(target_hstate, folio, nid); + folio_change_private(inner_folio, NULL); + prep_new_hugetlb_folio(target_hstate, inner_folio, nid); free_huge_page(subpage); } mutex_unlock(&target_hstate->resize_lock); @@ -3505,6 +3505,7 @@ static int demote_pool_huge_page(struct hstate *h, nodemask_t *nodes_allowed) { int nr_nodes, node; struct page *page; + struct folio *folio; lockdep_assert_held(&hugetlb_lock); @@ -3518,8 +3519,8 @@ static int demote_pool_huge_page(struct hstate *h, nodemask_t *nodes_allowed) list_for_each_entry(page, &h->hugepage_freelists[node], lru) { if (PageHWPoison(page)) continue; - - return demote_free_huge_page(h, page); + folio = page_folio(page); + return demote_free_hugetlb_folio(h, folio); } }