From patchwork Mon Aug 29 23:00:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 12958521 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 002F5ECAAD2 for ; Mon, 29 Aug 2022 23:01:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 84F0A940007; Mon, 29 Aug 2022 19:01:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8348E6B0073; Mon, 29 Aug 2022 19:01:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 59BF7940007; Mon, 29 Aug 2022 19:01:01 -0400 (EDT) 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 48F566B0073 for ; Mon, 29 Aug 2022 19:01:01 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 270961A044F for ; Mon, 29 Aug 2022 23:01:01 +0000 (UTC) X-FDA: 79854152322.27.9234CB9 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf12.hostedemail.com (Postfix) with ESMTP id 8AD2E4004B for ; Mon, 29 Aug 2022 23:01:00 +0000 (UTC) Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27TMDv6B006909; Mon, 29 Aug 2022 23:00:49 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=VGmmPwWPu5W99D4ogg7Tpo9BbWI+rzPi+9Yb/8AA3Rg=; b=nyQ+e20mP9BvKtiYS/I0riVCQjaprXlf+Nd1nDlRDfO/wSXrspbJcIIa4P2MoL7imiOJ xappeJKG1Ky+MFAVaxAVxk0woOeT/m+aaZGLM8Y3CGeVguDIc2tSYYUNqsDUukJhG6Ws O1NNSQTt/dmmUkJTPxdZV+ttgn2C+FwQ9UXN8pdRBPSYvrrMudbul05IU0Qmt28L3pBn 1OuGoozfbdgCWCJtGSKa56ZhfvoaddW8Qdb40V+VU6xIbjHEocScnm/2HpHEHldScLKg m1xQHeRQyj2P2vbMuzZvaTRzLjs9gvrSmE1sy2lgnb9vUuDivAj0+DNHPEcae6YrYfq5 BQ== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3j79v0mtwj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 29 Aug 2022 23:00:49 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 27TKDP0a017923; Mon, 29 Aug 2022 23:00:48 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2177.outbound.protection.outlook.com [104.47.59.177]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3j79q3b6ta-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 29 Aug 2022 23:00:48 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XaEeGH67emPXy7v9oLYmwEaHCKrNorhx/GRgH3NRR0obvNDpcyYv2CNk3mtCyLKocTFfedFgr2bBTJ1cfyNzKvZ5E22w1hC/k8Ct4MKSfd9dQB3dwZnYbmS6ea48rsqBWQNdZ0AnOqUj/VL+73AK8SDSauyOzzvKCIaUH/8tYRid1BIQkyHsACpzcV/1eLGGUTj4j3zpPN99/uS3NF8KeEVQfiDLRyRZIyGGE6LWycA7Sw4kSzeUJA0C7k1ZG71fUw4nFMYQvmUl33hH5pbZTlROz6bU4YCbTGwzNb13g1pcVmujqHD1yGetYv5el3pyB4QswLVW1ZxYLIGk3FO1sQ== 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=VGmmPwWPu5W99D4ogg7Tpo9BbWI+rzPi+9Yb/8AA3Rg=; b=QGoTs168IHhp+4I9H+pgSvETTwua2Uzu1LCczjXBo2IwNqAA1DZthcn72KJEcr37VeLmSnzVCZCPQornG7ebR2tMRXELPr8MS7UZR/kvhrS0G0tS6YXZiVlc1sTAVeI9V3faCGMt8dwBIF4lCvz2ExXTWy1eKddXgj10F94LUIjgUb+RTUtOhMG5o/KUbBHNm0NCC0BPwCnfHp5CbS6CR83oM4qPePGiHlLTvMlZe4xkdWKHg2o2J1OdsAX0aWcPu8/KIWyQkw+AxqkN3+TYZpGKsw+t42FYKLfDGDyAcNp3sDZXDnqEyGsWpyeyd+lZUslWyA7C1iIaMBtEC+hEww== 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=VGmmPwWPu5W99D4ogg7Tpo9BbWI+rzPi+9Yb/8AA3Rg=; b=w7XlrigbEdTXTv/JpOB7RH/rrbhDQ6YB/U4rWidM8ti761QeOOb1uGClhrwUysW6+lHnvTwScg/cOSfLJBuzxnhyV3pDOsHgNSU9xfxWYkkIi/FHPiEbuDGV72R7gw45Tm0IWE20r9IlCItVfeiJKWRW0CxJX4ppEgQLSXTi5xc= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by BYAPR10MB3736.namprd10.prod.outlook.com (2603:10b6:a03:121::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.21; Mon, 29 Aug 2022 23:00:46 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::e026:dd88:fe66:6ed3]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::e026:dd88:fe66:6ed3%4]) with mapi id 15.20.5566.021; Mon, 29 Aug 2022 23:00: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, vbabka@suse.cz, william.kucharski@oracle.com, dhowells@redhat.com, peterx@redhat.com, arnd@arndb.de, ccross@google.com, hughd@google.com, ebiederm@xmission.com, Sidhartha Kumar Subject: [PATCH 1/7] mm/hugetlb: add folio support to hugetlb specific flag macros Date: Mon, 29 Aug 2022 16:00:08 -0700 Message-Id: <20220829230014.384722-2-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220829230014.384722-1-sidhartha.kumar@oracle.com> References: <20220829230014.384722-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: SJ0PR13CA0017.namprd13.prod.outlook.com (2603:10b6:a03:2c0::22) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d9ac35cd-5a58-4471-519d-08da8a124e82 X-MS-TrafficTypeDiagnostic: BYAPR10MB3736:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: g1ZXIvX90774wuf19hHC/MU0PfJtgH1Wjrwfue2WWW3ju4FfASX3OPlzg7XYkuKIM2Yf3eXIULOeZUHQDbOWYqGDvRItBA7J2h9gZPlINgiwdwVGNpsOmwE2qUIf3BhuskaercM8bObCjHjsJviS8JIqaUuHAbqQUPNck7ahgInmdldzJxJbikhntyEXVNEHuDyWNT4UNFn79SdOiSWPYVI5RfvHWOfEfjQJ+DnjUCLgIDwa6o0g6IAXX53Zl9cmgK/fcUU+1qxDkL8gWC/n8UtPSPg8Buw11yyJ5RVSXrre5a4VmHBC7Tm2pheycrFGKvi0l4nT2dGhz0M3+iOLqNMuHS5OdOnJMtnTlw62Hx7SCGjefEItlF5CD3NJ7aQ0r34WmumYklCrJxavYE8sa+dEOHCiESQktswGjA5OngJzbqJhiPXjpfM57iqFQi9n9BJ3eYnboM+yK5x8ZGjLdYN2SHuxvryrUQP+R/hH32dfWQK6JzxD7WfoPUfxIE94aTuJw9BMD/WmQ3pBnvw3xJbMDucrUZTPSeGgRyQpmtQ+Mh9inQWK5ZEaAgZuAcxxCCcRBcl5hXHLE2DbILMrVyl3gxs4KfeiRGNp8im7oBBAV7RRzVFKccQpo4wgPrGXrKsz+sXR9lFicUV9b7cUxfRsVyij1DcEQ7BDLAGcSZyBOsHAWd+cMBBmHwa41XLUZV2tUiONTg7ndU1x/CxmpQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH0PR10MB5113.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(396003)(366004)(346002)(136003)(376002)(39860400002)(83380400001)(5660300002)(86362001)(1076003)(2616005)(186003)(38100700002)(44832011)(36756003)(7416002)(66946007)(4326008)(8676002)(66556008)(66476007)(2906002)(6486002)(41300700001)(107886003)(8936002)(478600001)(6512007)(6666004)(6506007)(26005)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ng5PG/0eBEoX+qWxWOQQoRuZYy5nuUtoya2+cZUGUeBrQnJcq3HyWjhBFJh4Ka8Umksg8PcJfzf/A+/qhclmfUJbFlgKIriL8yLLMvN0mTYzZrA8MEYMxpbyl8Q2uXvXo7sNwhiRPEX+mKFfjWsf2NXdcjKQY9V8gGM4ztndzutpnUkVfIcC8StNyZS3ICDQM7elMThQ7b6ne8Qrwk6xsAUk7JO+8Z7PBOlVcHPcjc2eM1cnYWsN0zw7vYd+Dde4kTVHyRps2jY1WfILaIgS6M9rEkzyihusxlQav4CmpZsPRskDfWTANYcQBn116T1zE4Shv/FfOGw4YyIc+pEjJiqxEIZXfAM/yABKjjhbbyGPIvka2stL4ZuHRA0JkOMYKiMHWWWKHK7l4CbnQjwbsI5NxrGuqkJKe/Io81xq9+CpV9FBMyuNrwyOjhsqJHAnU9hnWeXkqkL9hU5XaSSl3HIgoecs8iB8X9qBsK30l1B4Y5hYg2rpsy0rfxo9rOE1djKF3bWk0GXcncNaH0zpdhUilf6eIlHe4jaowPLObD73uYepHLeZ3o/I8AYn2YGZJVwuNnqNnfA2C+nvjdA+PX+DFxxZJrtFJ22H+0+jJUY8GRpa5kppMUlRpV7mie6bWJ0KzUfavUgUwF4zHbvmH6YlXqsyv+Z1C3YK2V6nS3CE/YomDkZ4G99hUnwTdf0M5srVjTXv5n1lqwTV7UkZGOd53ahL3cKWcQKKbju/K54I8D1F5C3oYqqSnW0PD9Qt9NAofQI5M+JbJ8kQxqy3XK2GYvs/GNr8F61k1si4EPgHGHrD7RXE/RFqPkbBgNWiPBK9jVcmCRS1ZCr8TQkkpnhQRS0ZB3mq4U2H9xpKo/RCplVlBank9A0Axl+BpDyI/RvUPAzxq4moXbZMhtGieLvD2fNXllR8qMX403SLKIUjldyojrC9Uxr6dADAM3aog09SGA1esepX5Z6GmeB9JJW7Ks967iZFKAZ3JwPiRVH0Yb9YdePuaw8XSJKAcwY1CyRJlhAdV0pUw+BjvNeVw+0KnHsvq5gFGGc4BuSFoGBJFxHv8nmb7P1gutPvW3u5Uvj61KJvzxxMOoTfFdiq/HE/YQQkdoXuSUI3nL1WcdNJymqU/29rWvU6adPOB6eW5tTjOrUUFtBfJnfXKGUBZ2qp7tQMR0wG48ZCcr5kCw9sdVZKRqXnOrcr5pWtnHCaqEENSL2eTfD/yceHXzK5qq05VAv46SFDxDqJcPszyPejJ/lDLkEpZ9t5Y7P5Ikw7YyxlhAhGG+101/PS9U1f8cfl5PmjpCAi1L+7IaUb0EN9SycnMv9Q4JFvWFaxmIdfcf9Na0HGn/BN2EWG9dH+uSyHgZOzw4ODw0qGcDAhrsTQn0WA6xZ7oWesdMk4jZyzMG/1+3bNH9qlYI5gYwsWnt+Uy2Bto2akFsZ6lojJiriwwqcToXI1RKygMw+wQ96m5e6/fAqZI62M4owk3cYhldlf3BdCnDfYSLMXHAuZErZuKll6o4wXLHAvSeLxyvnIg9GJapuY//wnAAo4qYndoVeXeuKTVnB//Z4k4HfCJJcLswQCiksMfaWhHigAaO2or66rUCr9bwV8oEzUQx5M7Q== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d9ac35cd-5a58-4471-519d-08da8a124e82 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2022 23:00:45.8960 (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: q0ZTBlZySwDHvN7Wl1SvoEarxoNhUKYAy9RLUM5LbIJN1fRJK26/j7yksE5T6SqXUkYlg+OIHv9BXjRM+DrOIk8qEbeQBtmWEy0OdrJWvD4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB3736 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-29_11,2022-08-25_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 malwarescore=0 spamscore=0 adultscore=0 mlxscore=0 mlxlogscore=999 suspectscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2208290101 X-Proofpoint-GUID: 9gqh0rYGH67EB0Ca4tu61KsGaoxylPBU X-Proofpoint-ORIG-GUID: 9gqh0rYGH67EB0Ca4tu61KsGaoxylPBU ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1661814060; a=rsa-sha256; cv=pass; b=NWflUH0IC6dmYn3yCPyULcA5CVJNX04Vh6sIUTE0zlgK9ONxdcdyeAfm8H/bBz2SWNbCUy dCImqvf6BjLepN1hdZW0RJ+rFcXfM5d74YaTpHQaNygm8PUkv2q+/EWseelTV4oMCbCrLI WXCtRW7QDxQUFopdxB/GdZCS1oRyvZU= ARC-Authentication-Results: i=2; imf12.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=nyQ+e20m; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=w7Xlrigb; spf=pass (imf12.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=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=1661814060; 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=VGmmPwWPu5W99D4ogg7Tpo9BbWI+rzPi+9Yb/8AA3Rg=; b=w0OuzhZ8cDaWTHqMA9N6fgqJcN2K6gLY/DXWGfHxL5UL+uKloPClJptDoQ0qqj0zvxnZOr xZPb2l3xVaqWQz1EbqIDeQX81XVOp/zMjQo3ICaGZFjXOb9EBEuzNrIc2mb/GueyLG3byq 0eNj1F7mCTkPN/fTWuQWhlWfsHGEFrk= Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=nyQ+e20m; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=w7Xlrigb; spf=pass (imf12.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=pass ("microsoft.com:s=arcselector9901:i=1") X-Rspamd-Server: rspam05 X-Stat-Signature: sk97mtorogxxughwmqdke4hf1spj9sr8 X-Rspamd-Queue-Id: 8AD2E4004B X-Rspam-User: X-HE-Tag: 1661814060-494510 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: Allows the macros which test, set, and clear hugetlb specific page flags to take a hugetlb folio as an input. The marcros are generated as folio_{test, set, clear}_hugetlb_{restore_reserve, migratable, temporary, freed, vmemmap_optimized, raw_hwp_unreliable}. Signed-off-by: Sidhartha Kumar --- include/linux/hugetlb.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index acace1a25226..ac4e98edd5b0 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -583,26 +583,47 @@ enum hugetlb_page_flags { */ #ifdef CONFIG_HUGETLB_PAGE #define TESTHPAGEFLAG(uname, flname) \ +static __always_inline \ +int folio_test_hugetlb_##flname(struct folio *folio) \ + { void **private = &folio->private; \ + return test_bit(HPG_##flname, (void *)((unsigned long)private)); \ + } \ static inline int HPage##uname(struct page *page) \ { return test_bit(HPG_##flname, &(page->private)); } #define SETHPAGEFLAG(uname, flname) \ +static __always_inline \ +void folio_set_hugetlb_##flname(struct folio *folio) \ + { void **private = &folio->private; \ + set_bit(HPG_##flname, (void *)((unsigned long)private)); \ + } \ static inline void SetHPage##uname(struct page *page) \ { set_bit(HPG_##flname, &(page->private)); } #define CLEARHPAGEFLAG(uname, flname) \ +static __always_inline \ +void folio_clear_hugetlb_##flname(struct folio *folio) \ + { void **private = &folio->private; \ + clear_bit(HPG_##flname, (void *)((unsigned long)private)); \ + } \ static inline void ClearHPage##uname(struct page *page) \ { clear_bit(HPG_##flname, &(page->private)); } #else #define TESTHPAGEFLAG(uname, flname) \ +static inline int folio_test_hugetlb_##flname(struct folio *folio) \ + { return 0; } \ static inline int HPage##uname(struct page *page) \ { return 0; } #define SETHPAGEFLAG(uname, flname) \ +static inline void folio_set_hugetlb_##flname(struct folio *folio) \ + { } \ static inline void SetHPage##uname(struct page *page) \ { } #define CLEARHPAGEFLAG(uname, flname) \ +static inline void folio_clear_hugetlb_##flname(struct folio *folio) \ + { } \ static inline void ClearHPage##uname(struct page *page) \ { } #endif From patchwork Mon Aug 29 23:00:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 12958522 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 6B13DECAAD4 for ; Mon, 29 Aug 2022 23:01:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 99881940009; Mon, 29 Aug 2022 19:01:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 945126B0074; Mon, 29 Aug 2022 19:01:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 74ADB940009; Mon, 29 Aug 2022 19:01:02 -0400 (EDT) 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 5A05C6B0073 for ; Mon, 29 Aug 2022 19:01:02 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 3315380AC9 for ; Mon, 29 Aug 2022 23:01:02 +0000 (UTC) X-FDA: 79854152364.26.3A74718 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf09.hostedemail.com (Postfix) with ESMTP id AAC42140056 for ; Mon, 29 Aug 2022 23:01:01 +0000 (UTC) Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27TMDm2w013302; Mon, 29 Aug 2022 23:00: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=PcELQcEJ97DLVJYlsp1uCVAxLscIZ7YH5A97B+6O20I=; b=krGhVutIoVlX2hQJxG09NjXRxIVoAiXx/IRolDbrvF0lh1IYHK3knG4mfC1uTzEj1SSy zemlVMAGHuXg6IA7BTKse5bE9zxgCITl/ShlOkaLPZ/bWGsvgriZR5QQ72ngBfCUP3Q1 XouuRIt3Fz5LVye1jzAcv3KRl0SoazqNm485W9wMulssHmmcpEpUwZDh27QQajH2eI81 QixMvJDTMFr5IgtTvYQQ8blbK0LelheiyLkrywxDz+WfPUlqfJZYDtJzZ1/mps6XyOrg f1pjV9+Zs1NKAtNpghJWgOhB42hUt2nTkiuP1EigQ9K3nnt/IYQSnahqT4z189idhr7x wA== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3j7btt4s32-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 29 Aug 2022 23:00:54 +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 27TKr2hP021257; Mon, 29 Aug 2022 23:00:53 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2175.outbound.protection.outlook.com [104.47.59.175]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3j79q33mwp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 29 Aug 2022 23:00:53 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WLoovgi/RglZV7gEGhr5erPMbawyZ4oRqTsIPSsFXFjWVP5RJI9+YmfIu2P0PLAt7DYclNh9UikpMdy2RpUhtzXDPbMCRU4x42DJT6flaJjwHM4Njg47qmosRNOLUBIcmOkD3dm14F3Lwwt6TgYAzrqW66WW1MUUBnevYxxJ63Fg+qZhTf0y+d9Wyv4D72nqmCw8Id2bS7irSNGZJD2ctid7SwFpTHFqtPGdrrJzTmdqoWga/ZFIqorCnwIcJVeLy5Qp9uKFucaoxboiagaI8sy7zmRss4tLL8Px/avQj78E1uZ0rjzq7pgbeW/MD7VbbeP73gErV1SvgDitA/RZBQ== 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=PcELQcEJ97DLVJYlsp1uCVAxLscIZ7YH5A97B+6O20I=; b=MjnV+kfAThN0GWgNslwRVh4UR498f2+fddKA+aihai6cjB3ybgSya5Sz+ap7Q8B0A5Z/Ys7aOW+Tho5TqVrXampWKOrNGHd2CqjtXkrXdR7fnZwoQOtYWUSnzgE3RM1Ft3icx/5JNYSL9QJi1EcuQVnbO0+XS0L8lEEF8VFDAds7qFXpUKbPafT78pZifCxImKLkODFUySNDldwFT+jnpS7+WNiDhdWzTxdcUkCNz56O6qtwL6Nicf9LdFmALq9lRZwhBcgOwo3QAGrduk2AImhHnXWL+ve7XmIBZWNg84hXTxzZi3tE5aEQKAjjFZdMnKP2iBlAs20mzGTQvshY0w== 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=PcELQcEJ97DLVJYlsp1uCVAxLscIZ7YH5A97B+6O20I=; b=QGEctu17KSoB8t/v43JBMHYc89VG00iPs9WRdmFo3qK/EhhxrSroK9HV3g5GKbS0hRMf3FP4gI3LuRfWwQASxzrUiInyEwfZyzVipGGAls4qhqXKUfwHjoJhjHhE5tNinGwQKftQCTdAdc+p7bs7XbiP056AIjYqdj/KaUupQxU= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by BYAPR10MB3736.namprd10.prod.outlook.com (2603:10b6:a03:121::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.21; Mon, 29 Aug 2022 23:00:48 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::e026:dd88:fe66:6ed3]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::e026:dd88:fe66:6ed3%4]) with mapi id 15.20.5566.021; Mon, 29 Aug 2022 23:00: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, vbabka@suse.cz, william.kucharski@oracle.com, dhowells@redhat.com, peterx@redhat.com, arnd@arndb.de, ccross@google.com, hughd@google.com, ebiederm@xmission.com, Sidhartha Kumar Subject: [PATCH 2/7] mm: add private field of first tail to struct page and struct folio Date: Mon, 29 Aug 2022 16:00:09 -0700 Message-Id: <20220829230014.384722-3-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220829230014.384722-1-sidhartha.kumar@oracle.com> References: <20220829230014.384722-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BYAPR01CA0049.prod.exchangelabs.com (2603:10b6:a03:94::26) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a154b1e6-e4f0-4604-a2f5-08da8a124fea X-MS-TrafficTypeDiagnostic: BYAPR10MB3736:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9VRYWp36kdMLurGv78Z1h1fza8LouFfbXxBHklBzKYSLYk73bc8olUFMaLJxkhwOe6Ikqxxt1/GsUeA7pA2/KdnDfpQqgeuGzQuBYkuqf+6ZxDgFAxcHQaBKSlvSSgdGmeSZz4/kMO/JMLiH40WhC9P9Bujd1PDfNmW9NGXrnZ/hbwXscqFvXxKrrbR9PqnAqEYQK/gFXeruOnEZE1CUELMU2lBjcM6dOMpaTO9v+2f1LCYtD2dwSKOKN+h4AYvLQAjpoqBNtsnN1klM6lMp304MeJgdcgTi5mF4fRgwuo3/4Owtik8wl2hCtzEw2/EbwCh4cxXhpu/a5Gp/oA/tzmofhwxPQAslCzDeoXG7ZV4t0uD0yjs2+pOj8PQOl27iX9IkV+yTmrVhyAGZZ7KSc3zeeC6GUeAG0/+ksaWc7DrQSzwQ58EVWZVKaVzMewyg1Ja2llX/6UxrLzzslae1iatlAPCDiXcLTzOKN0ugcNEQKEEyt3b4lQvmkosEQo4qYNAJmzZcIxnopHDPMuK6r7clCwuDafmyMHo6tJqIGiE4FO7gWuFgjyet6X4bAMNrtEGrcvEOcrUzJWou/HpuTNomaFPhHhCFjTAlcoLRoROljfoWXDi7zbasOYn0uXu0iQLBpnjP3CFLYScgtDtZ2h6lmXF46YYtieUp3BZ4OfhpIwvfp/1cxvV72YIIJTGZmrUcHnUP85fQpaRkr4Rq0w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH0PR10MB5113.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(396003)(366004)(346002)(136003)(376002)(39860400002)(83380400001)(5660300002)(86362001)(1076003)(2616005)(186003)(38100700002)(44832011)(36756003)(7416002)(66946007)(4326008)(8676002)(66556008)(66476007)(2906002)(6486002)(41300700001)(107886003)(8936002)(478600001)(6512007)(6666004)(6506007)(26005)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 7naYemPqoh8GqbNLMgR9vTFESOQQahzbOtFeP4wA+a9T8HLTeQAfUgqJdij7mumUZld7NQQe5WXD4UThqECdPUtsqYXliCCeTQb43nb+18SzWvh8zlVbceCFzofoVyYQxhAzqiyxQ/FyHv3zkI64eSW1SK/1G5f+FPT09lKXZYT7+rP4j0QfSLdLgzsi5aHfSsg2m6XALeljOY9WNrHQXyx4Zmm6fn372mHVgnh4DD/ZptkC5dgMOjNQLezDFiVL5xecTlHQKtc4DVv9PvT5/oJguXq79FstgOCeXX4dvBlildMT7zo/RgyRvf+CYQRtBC0jeJKAbhsYZBbHidsN6+dJSXsy3bvpi31LLohax0BZK/6t6HKlJ6iuKgfKLum+Sd+LbbYMergUD/dFIWFI3S9DsoLn6Qfr40CSJ1J0EkvBgL1IS4d+0z74uYkHS716sovUg3M9xi1FNDfjNTw/V7JCL1nG+oQnSPnea2o/2bw/Gmg/9yuuSiCJlHx6b0k5WQo6dnEFtoJrMxsNHZ7/DfrLzDPWNUxRTKQNsvKSybDGxIZDDNpsZICDGaBvJyK3gQDHcB+u66raWQYv6JgGLZv0xHXrxb51qpfM8Hkpg/KYlw4MxsHAFPt8jLcsjE5cXdvTZKy1kzXlUmjhMGWeIIgUZdcxYOsudP4pQgpaXIiG/IxGPIYkoKvL5PxuNlo1arWhDOVdHxBWfU87oBfugu+iYDAEvC1fTivwnA+hcxcv0/NkNSJc/3KjgsKpdrxlIjpV8WT+pLwdVWgQOdw0+NkCWcj440VTSyqPsdyq070xOXU2q2JZqgb5VZhdwSY5ALhb087oXVIny7ouVsdcb5sSRcs5aKwXg522ODGndI57PyJPi5YoeX4pybA2R6yQRFL8NFOKdvxPkkp5V4H/mYWk0p0GD+qocBKGa6FDftltrjMeFNHmopJ0iieOUnLdKJbsDklxDx67auPeFwz1F6WIx4d0I6KeKkckkrD4PkfXOkZvDV+Pn+lE7K2Tyj03+40X7OPwkOktF55lipuiwv4s0df0APQCKAoPTHTuzYorkmJT3NeXL49KIliuT7vVmOIxfmCttQMUzrOo3emYInWq8mWIc2Ju3UXloAlFSutl7hhIIH83gg3vk4TCOSFfAaBUaPEDzDJ0lwaOwqxHxshdfOXoo7L7dvO64ohPf8pt8H2o+pKlspx7E11COrfkF8HOL5iSI36pwxakKft+UuaZiBDSsBt8IN6m0KsNnxswI2xFurl8EdbHJUM9WTwJ26TN7KaZsrHJNrhd7r23lNT5ozsTfXIHOIua/jejYjAmnGDEijmH2PO0ILmoDeDx0Jgl3qf12nEXHKsTbxE49Rdz5iAkHLyrl9qRdsF9zK2S3a4jAjmKssIWtAp0X7DPTpYMpfRUJ42eQk+TlTtDbfZsCu1IucVYzdLnSjehTX9ixNT3FUBHFnr3kORsf7FXZuBrV6djz7K0nEZTECCu8eYuEGrNjiD3eclzAR6E/G09CZ7WbB14Rw9T5G0qLRi+QxrlEvqsBxJKuGH+3lfzs9Rruq5SQP3hl/JgE03Y94RuIkCnaH2+0laXqMuALvRQ1CB6qUxOPA+PWMPSAy8yqg== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a154b1e6-e4f0-4604-a2f5-08da8a124fea X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2022 23:00:48.2417 (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: WWGNNWuJZgxUakLkc6QdS725Y1dAiPbwuZqm0YuPYPsFeQ/knLjVBBsQ/RnU67vPHWnBx5E0fK2JZgubTw9QoYlQpqG/uE0NMvTubqBk9W8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB3736 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-29_11,2022-08-25_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxscore=0 malwarescore=0 suspectscore=0 spamscore=0 adultscore=0 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2208290101 X-Proofpoint-ORIG-GUID: KQJrvUl2luR0B9OAojGzTamAzui-Qp5w X-Proofpoint-GUID: KQJrvUl2luR0B9OAojGzTamAzui-Qp5w ARC-Authentication-Results: i=2; imf09.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=krGhVutI; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=QGEctu17; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf09.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=1661814061; 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=PcELQcEJ97DLVJYlsp1uCVAxLscIZ7YH5A97B+6O20I=; b=N53HCmbIXd3dIvzaUM9ZVDakNDN+Qxrm+YDtPcvrdxHn5RoiqU4wd4qKyF9hpoRMTwl+2G YL8zwrrWYn26oANHNGh0BvurJkDPxHf2O/dSZlxpDVV+A5tyOueflNnEMHxOfwK3spG+bX yiST2QZKWsrWQFR+ThSwhSHHCToFEZo= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1661814061; a=rsa-sha256; cv=pass; b=gCjyCryxnsmJEkXswrb/fIx8PiIEJPb09ch1EWfa/Ubz/6ynHD2ChuFuV8dDD9w0NQjPHo j7IwMbouHyDWB6hjuYIwWPePdRkeCGwm8uwwJFfclMjksduVZ0acUTDZv3Nkyl3ebGezd0 9yXuw7oWtJZY0w0HELHNkqWxSEInYxI= X-Stat-Signature: gamrqqmfoxuan69o7mu97ps5cb7yuaau X-Rspamd-Queue-Id: AAC42140056 Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=krGhVutI; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=QGEctu17; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf09.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 X-Rspam-User: X-Rspamd-Server: rspam01 X-HE-Tag: 1661814061-119085 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: Allows struct folio to store hugetlb metadata that is contained in the private field of the first tail page. Signed-off-by: Sidhartha Kumar --- include/linux/mm_types.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 8a9ee9d24973..726c5304172c 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -144,6 +144,7 @@ struct page { #ifdef CONFIG_64BIT unsigned int compound_nr; /* 1 << compound_order */ #endif + unsigned long _private_1; }; struct { /* Second tail page of compound page */ unsigned long _compound_pad_1; /* compound_head */ @@ -251,6 +252,7 @@ struct page { * @_total_mapcount: Do not use directly, call folio_entire_mapcount(). * @_pincount: Do not use directly, call folio_maybe_dma_pinned(). * @_folio_nr_pages: Do not use directly, call folio_nr_pages(). + * @_private_1: Do not use directly, call folio_get_private_1(). * * A folio is a physically, virtually and logically contiguous set * of bytes. It is a power-of-two in size, and it is aligned to that @@ -298,6 +300,8 @@ struct folio { #ifdef CONFIG_64BIT unsigned int _folio_nr_pages; #endif + unsigned long _private_1; + }; #define FOLIO_MATCH(pg, fl) \ @@ -325,6 +329,7 @@ FOLIO_MATCH(compound_mapcount, _total_mapcount); FOLIO_MATCH(compound_pincount, _pincount); #ifdef CONFIG_64BIT FOLIO_MATCH(compound_nr, _folio_nr_pages); +FOLIO_MATCH(_private_1, _private_1); #endif #undef FOLIO_MATCH @@ -370,6 +375,16 @@ static inline void *folio_get_private(struct folio *folio) return folio->private; } +static inline void folio_set_private_1(struct folio *folio, unsigned long private) +{ + folio->_private_1 = private; +} + +static inline unsigned long folio_get_private_1(struct folio *folio) +{ + return folio->_private_1; +} + struct page_frag_cache { void * va; #if (PAGE_SIZE < PAGE_FRAG_CACHE_MAX_SIZE) From patchwork Mon Aug 29 23:00:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 12958524 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 E43E2ECAAD8 for ; Mon, 29 Aug 2022 23:01:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E79F76B0073; Mon, 29 Aug 2022 19:01:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E266694000A; Mon, 29 Aug 2022 19:01:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BBB886B0078; Mon, 29 Aug 2022 19:01:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 8EB056B0073 for ; Mon, 29 Aug 2022 19:01:11 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 64400A94E6 for ; Mon, 29 Aug 2022 23:01:11 +0000 (UTC) X-FDA: 79854152742.24.493FF0B Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf30.hostedemail.com (Postfix) with ESMTP id E7B8180004 for ; Mon, 29 Aug 2022 23:01:10 +0000 (UTC) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27TMEFqb026106; Mon, 29 Aug 2022 23:00: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=lW8zNuSY/NFrf1FVX5OwmJ4d3miAC8eCUXfdH0INUJo=; b=XULPc/oKC2GwP2tDN2isW+GoYhx4QRAmkbMaGE3ja5xVUDdpFP+KoV+IK4MDSySJDtXq +DMhy2Qsgf5djHCcaAnydhOl4z4/JNO4SBygUD1Yc7ipYGW6NBdulwosJlmUkNawIjlX XjDdtX7eZYpb5AWddUDb9Mixv0Ec3Ns5wSMmHJIdAFr0S3+13jP2074dBFLaTyMXreH4 fUUA7iZ0t38vVZODeiv2is0949k9RoRr8GsNKMxcAHQ0OIz2MBWa8fR3tHsSNYrgccbS IzCMwTQY30VCxZ9XOI12lcH/t3Wpg1aqD4qaY+AhEh82xcsTwejmJvc7Qik/vJjgk9cK uw== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3j7b59vqd9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 29 Aug 2022 23:00:56 +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 27TKAZ2m002857; Mon, 29 Aug 2022 23:00:54 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2169.outbound.protection.outlook.com [104.47.59.169]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3j79q3cds5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 29 Aug 2022 23:00:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SzC+aytyK8Qv9f6fq/eK19MXQ+bZLcaHi9rHDFUlzgaVCpZsTTqTHaKbpPWpdDqMAM49AU6qQi307GXemBsgPCfeWySfLRj7p0SERnZCgMCrUMXGdKj5CUqXV6M2jfDAMMVbXb3LBuwbjug1Dfln+qcfpFOFb0QknuIKycb6wIUvy0SVemKCWD1ivVJwwsbdFgLbhsS7gEq4S8fBT6kdEFaT8ZVNl21K6u6k2AR7+MrN/WZs7C6Kxo8e4UsaQQEKbkXk2+eoi4Zydbs2Q1wCGSevqCuOewduUjSPv5YL981NXmhgaxDFwnA15WaJf4Am7Y5tD0J074n8h2g5k/wnkA== 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=lW8zNuSY/NFrf1FVX5OwmJ4d3miAC8eCUXfdH0INUJo=; b=dTIz1rNCLIEUxcDB7i39LzFnUWLg2EZi0vOpCS20Wp8KNSFqL5b5gS1iKZc0rKBZnrEm/Kc0S5nOdVyoA5+ear5tA5GJW4GJ0XuJApHmGxlleWn1YkWT4fZS/t6jw21n259DgmYlkrn7KeswyAPbBrHveCXXylfvuUVQnfGiZodMjrocvGnLuXgPbnQizjx6wuWsnwusTLFS8sB7NH1/FkKuKJ+oMjB9HVQE37eA0AFz2rc0+4sXw1iPAb0K0bRaQsIWUTOSFgZOCcEqj9k4ieGV4kLuoyUjmnDBS+cZkDPkVdSyc8FXoga1GD79habkp1uI3k2kMwI4dnowk85JJw== 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=lW8zNuSY/NFrf1FVX5OwmJ4d3miAC8eCUXfdH0INUJo=; b=oQNXQ4/6IcPBwyihpArEDJA1C4GJMrXGWrL/8Ao9bX5E6WpCc5TjNdpESoZjGLW2LLGzbByLoyAJe2Y6m1mggOJYTrIR9eUHwIQ8s5ie6TP7ZDtDpvsKJY678iciCnxP+ay1tYPR0Yeh4f7QDXQq8bqIJ8eXV578NkGILlGQ++Y= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by BYAPR10MB3736.namprd10.prod.outlook.com (2603:10b6:a03:121::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.21; Mon, 29 Aug 2022 23:00:51 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::e026:dd88:fe66:6ed3]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::e026:dd88:fe66:6ed3%4]) with mapi id 15.20.5566.021; Mon, 29 Aug 2022 23:00: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, vbabka@suse.cz, william.kucharski@oracle.com, dhowells@redhat.com, peterx@redhat.com, arnd@arndb.de, ccross@google.com, hughd@google.com, ebiederm@xmission.com, Sidhartha Kumar Subject: [PATCH 3/7] mm/hugetlb: add hugetlb_folio_subpool() helper Date: Mon, 29 Aug 2022 16:00:10 -0700 Message-Id: <20220829230014.384722-4-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220829230014.384722-1-sidhartha.kumar@oracle.com> References: <20220829230014.384722-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BYAPR07CA0044.namprd07.prod.outlook.com (2603:10b6:a03:60::21) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7eba70e4-0d28-4b72-fcc1-08da8a125178 X-MS-TrafficTypeDiagnostic: BYAPR10MB3736:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mMfpG8YO+BFgd0z5CMt/Zi4gL6ijYfJKIYJJ2R2bZHkICS0evUvvaV2JhRgS6SNpzUP6jEIAoVKCTkCDlpmHNcrXyhNx9l76LPdOq2lQ9W8Ad0Fp+fpCoBbn/OVZt7+CWEiQmai+VuFQbvntgcVrvKrP7ymXMCOB2gIEX9AgO4W6AO03gUlLbdDdVnrQ3lyUFxX6qu/srS0jVPYdO1U7xXOZgxT0OPPUcpOigZFNclg3YoUkrV5sQfYPp9B/kAyJAd1CKq+zfaxSOA5i1MeFhSJX0pUOxOwBkqNVJmtYqdt8iSEk+57Wep8XcddzfWO0mzjCAP2yOTudBxwdbjj9aiGzhk2iHKuYwsFMyqNBtpWQ9rugb6pnpL68/LDVhece3LIukxlWTc4YsikTGg5hjxRTY5EwTayiKBM9qKXvf6MrICpWoTdHtN007svrCsSID5jBYtsIuQInPxZVQoc6IPlA6+ZFSBcvGWtomVOs+BjkcqhpzdVbICclCDVJBcDLkIJt7mS0/iNYeDbKT+PqmpK6jymnxW+oAXBUd/hNnKhcuyNNIU9+/rmQCGBeo0cQfZEAMFF+7jn8GvId9SNU6Ld8XyuNqm3g4cHgxxAJrq8cuDkOQ0C67Fh7AKjxLT4Y37U+CzVG9bvzbSxcyRALRMgRSU3bUfmH3zXeC5ChA6ORCiDeU+4MKM2NJtr5c1DAuZOhrqndh8KVQIpdZPHKZw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH0PR10MB5113.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(396003)(366004)(346002)(136003)(376002)(39860400002)(83380400001)(5660300002)(86362001)(1076003)(2616005)(186003)(38100700002)(44832011)(36756003)(7416002)(66946007)(4326008)(8676002)(66556008)(66476007)(2906002)(6486002)(41300700001)(107886003)(8936002)(478600001)(6512007)(6666004)(6506007)(26005)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: WZEbXhupuJxfiPljylUJJ1KXHsdnBa1K1s/uUfG14GV0GbH/9qQAysz5X/nK5XQX50M9QpPwdLYoYXzt+jmqVhewbZk5aub32iwWtKXr/8Y6syF+zFrw6A0xzEZE5Empl5Igb9s4ldVK6w32veJcYPN5zgB5DdaEB15nDLxGrIvHDUM3M+3V0RNk2nDrgEjd86sGhKG00+Yxakbu3FJaVDox+xC9opkuffXjNwBB+LHXY6eDhgkG/50eLLbUYB5Rjq4cNYgEZ40Hu5v9AZpcYvU0A2UJsf2XLXcnONhjdtPdb3khTjZg28jEunK1F6C1RQknQXLd8htgp43/5SyXy4FeuYf72KJAm86tQ4reL5eb0Ss/dICSRR+UtbItNLz21nBEEoEJKoMxAoWZ+cgB6Rxood/dvFWBrSvSvrsDdKAPnM90gyOKJTi4IAnW3DPViqCz8+lOOo2L3oA8BRwjCiQgq/5MjqdAlnFLEwrTE7V7/ALuXSNGOwCO8vrgC27bE+i+jJmQ40jRe9c64046GSf5VE/Yv4LOV+nPoZL9DIIpidzykzBb6UZ/W9s9HZzQfNTnRoEpPbBYvORsVb4NgnVHB9QagE7UZVh6MLirc/knYWRgFscLfyM+xLe5UR7XudBJS1CdoflwMLGfo+UkTxac7SmbzWPZsYgGSsFhZ9FrYfCRT7pzLxbPZsH2oNhfY3efWJOpTVsmt7aSAeES7/fNsATfg5FuAU4Ikdb6GFaS37Apr5wzDLBerfcxpcTk6fQzVudvYmee4bvLJ62/XnVStTt2r8rsV/dB8zz1Ro4+pOVby/sqwfUs46D4OCLcemgfDH5XHjMnE7ZcwQsVU5+YNnKuQWT6BCwpnVa+2ut3IQbRHaBXUljNAFk4JuXTimycpR2kJtC8IshSIw+NFbZSgX0FtnRsIIpmtVjzCS5hOsgUsgra7yT/qGFtMb5Og7wucgA0RlcPx284kuVvadbuh5pQWnm2RkktX8Dzlkm3I1NuXT209ythfw9COzPRj5mSM4+y9wRnaq502O0PsTQLuyV00YlFnKwf9pc51sZJirlrwFzHp5iz7GObF4uNZkkPeXzd//06loY20G3k4b4Y5sz7gBflMYF7+xRS7RuWGT47aI5D31dyav7O0L13y7doLAUhQzkWETzvLXxwO9txspMk8pefKTWKxZG0xTcM1ibw5+0r2zsNlvHHqcueRtyO9aqV+dQPaY+/RIQAgApougRvYbSF4BJ72gb1YWHSVfUZZ9D7o2RkUp5sj7lYEA+0aNpmgnG6csXE0ZSYlfS+AHJOH6YimlnESx0Phd+ezYpahzW28TRXWguQrUFYr9p0i9f2lVxRbHoLJg7Ff+htmBb4x0mRSaXeUYY0rLnjmzFrjR39srC0y1aA0Nvbq6FcQ4Su5HZ9YqPrDlIX6/Z+sNe/6Ne9o4wvwFI6ux/27dSXXzEDAj0r9IMOmgZYAVgSWjxgypenKow76UAnlVb7RQk+GMw+cq9HrUkBNdFf8rlGjcGnYU8z9hPvEv8Rm4iGj6UgRt+p9chpeNmP7khC6xRz7+3hYmFPx7ZRn3J1JDvSEbhy6J3YxiKmp1G9unRdplLJDaEVS53E4YMicA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7eba70e4-0d28-4b72-fcc1-08da8a125178 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2022 23:00:50.8368 (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: PrST/ChD0SEZHLWG1Boy0r+9zYet11dbh02+iXDCrZscoZVoTfBGGm4l0UOa3w2aFMEcNhPL8Kkk4bNKWA27eTfVgnwCz8KqZrUUQD1e4mA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB3736 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-29_11,2022-08-25_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxlogscore=889 suspectscore=0 adultscore=0 bulkscore=0 mlxscore=0 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2208290101 X-Proofpoint-ORIG-GUID: wy_tesyjY2TTG69T0lq97ToNFHEQCYdd X-Proofpoint-GUID: wy_tesyjY2TTG69T0lq97ToNFHEQCYdd ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1661814071; 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=lW8zNuSY/NFrf1FVX5OwmJ4d3miAC8eCUXfdH0INUJo=; b=CjW1UFush0BAuDNv4N5nprrNNl3laP2ufXpU47jHe0J+Hgss9xSltoxKe1NCKRxXcES7rX MEFcfa7Jjjk6QlXaM6zI/7hfgFp9X1ZYsjeP6Ii/U+cbm9pzE3QZT1RTrwY8ldyjnHGwie B48x/B1IDfKOby5xEqvs54uxHYOLU5A= ARC-Authentication-Results: i=2; imf30.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b="XULPc/oK"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="oQNXQ4/6"; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf30.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=1661814071; a=rsa-sha256; cv=pass; b=DH1acUgZUVWEsGESJaxAnfishBPeDaTrpEKOs7TRanOa5qRMgSP3Cfi38ltcOgC+1DI1bQ UzvCHkJAhUhtzMi6OqLTfF1KUvlwFhkoe8R8jpwugczejTsbWd83hvCpPni8VFe2wYou8B pk9YFrR2S9iD0unGT+h5TVIAra5bk2o= X-Rspam-User: X-Rspamd-Queue-Id: E7B8180004 X-Stat-Signature: 6bgpaa344d4135s55srr9m5cwz3amj1k Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b="XULPc/oK"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="oQNXQ4/6"; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf30.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 X-Rspamd-Server: rspam08 X-HE-Tag: 1661814070-996807 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: Allows hugetlbfs_migrate_folio to check subpool information by passing in a folio. Signed-off-by: Sidhartha Kumar --- fs/hugetlbfs/inode.c | 4 ++-- include/linux/hugetlb.h | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 9326693c4987..d1a6384f426e 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -970,9 +970,9 @@ static int hugetlbfs_migrate_folio(struct address_space *mapping, if (rc != MIGRATEPAGE_SUCCESS) return rc; - if (hugetlb_page_subpool(&src->page)) { + if (hugetlb_folio_subpool(src)) { hugetlb_set_page_subpool(&dst->page, - hugetlb_page_subpool(&src->page)); + hugetlb_folio_subpool(src)); hugetlb_set_page_subpool(&src->page, NULL); } diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index c0a9bc9a6fa5..f6d5467c5ed8 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -709,12 +709,17 @@ extern unsigned int default_hstate_idx; #define default_hstate (hstates[default_hstate_idx]) +static inline struct hugepage_subpool *hugetlb_folio_subpool(struct folio *folio) +{ + return (void *)folio_get_private_1(folio); +} + /* * hugetlb page subpool pointer located in hpage[1].private */ static inline struct hugepage_subpool *hugetlb_page_subpool(struct page *hpage) { - return (void *)page_private(hpage + SUBPAGE_INDEX_SUBPOOL); + return hugetlb_folio_subpool(page_folio(hpage)); } static inline void hugetlb_set_page_subpool(struct page *hpage, From patchwork Mon Aug 29 23:00:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 12958525 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 88408ECAAD2 for ; Mon, 29 Aug 2022 23:01:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3332D6B0078; Mon, 29 Aug 2022 19:01:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1CC6E94000B; Mon, 29 Aug 2022 19:01:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F392994000A; Mon, 29 Aug 2022 19:01:12 -0400 (EDT) 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 DF9156B0075 for ; Mon, 29 Aug 2022 19:01:12 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id B7967407FD for ; Mon, 29 Aug 2022 23:01:12 +0000 (UTC) X-FDA: 79854152784.18.AC1BF73 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf11.hostedemail.com (Postfix) with ESMTP id 3D61840025 for ; Mon, 29 Aug 2022 23:01:12 +0000 (UTC) Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27TMDwwG006912; Mon, 29 Aug 2022 23:00: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=9F2h01/pWs7VrwbiyOkSAwUuubzwCxSyEoXyTacAXY4=; b=ofi48oZOdMmtTMRdvI/YNQTaRBQ32oUi5XmjvamB1Y6NxfoZarMWJFWPK/7djlck74iL WXLqRy/Bn3BoYoZxjFoOHcrKvrczSTV1k3FxTZsapjeMWlrz3ohMf+NSVawUqCZYeq8F bnj5az2V6+qwqda9l9q2gtRGcjJnct9mGcRttCxLtkxtLg1ytLcesTyqTREyfuKf76xt 0Kga0cM3zKDx2x02zhY2N6fg3fNzRVYbzCBUKgq0vJ21ZG/KF2Fe1BulNvrT8MYiUB8v tssWtPR8QmIWkABX4Wh2wg/xh9kwKfBbmleKlpeiJPsuqE8il36hh57QJYpag9CtsDwV uQ== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3j79v0mtwv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 29 Aug 2022 23:00:56 +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 27TKAZ2n002857; Mon, 29 Aug 2022 23:00:55 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2169.outbound.protection.outlook.com [104.47.59.169]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3j79q3cds5-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 29 Aug 2022 23:00:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a04RSctgC3Fojown4nHPiWhQ5x60aHTM0PB9zy+haTbAbpIQkpRjdW8ZL394jdLfiGQJlM2NG7B09I8EdA1Eom5hml0BfEswTrAVUK5aqCtnu4f9iBNzHADE0YU9lPxcmFFW0DwFErVY0ovCvWMsXM/WacTQJg9zpFpx+Xbmo2Q6+QZlCJXxvQAKADLGK0hPjYf7hOVmKu6o3OdoYAsNo0Qyby1jkqrzv4N088uZbEnKL4voMUwAWB4yG2hZ57dfEpVi8/vvjW8rptdHXr43+iwJDHdHO/N5s4M+T/jKM1VsY9+dni0OyCXFnryVeRJoR5I7fgETSpBj31APsgmeSQ== 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=9F2h01/pWs7VrwbiyOkSAwUuubzwCxSyEoXyTacAXY4=; b=B2p/JzUDnF70cyMHLzCoqN1utJgWZWsQml4ltw2M3NdLzk605f/aukrfRA0X2EVktRoAGPpbZZ6uZqcltApZOFqW6dyWbyq/1z64Y841x4NxmZvQre1chJ30UJumoustAczWHp67IP0NqnHV5kNXnfb5oVvK22Fuq/rk880BO/qw47brcmVJ1As8VZ6FaC/GjQgkYDyjnVcQYMaHJI8fVljbWcFSo4XyRngUfpbW5NmBynFsom8TOGBw0FBbNGbpwHIhRoHxybnZNidD/TUf2qc4dFEtvXdiW6PBFWcGE3U9Vu3V0rzVMaTzXRfeXPdzT7tR4jQhITAGhN6k2ibZ5A== 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=9F2h01/pWs7VrwbiyOkSAwUuubzwCxSyEoXyTacAXY4=; b=kjkUuZZyU1MkBCXMGZOPhfJdESRZJrs/kFMV6zcOQwuK5z4jF239fcVE+GKOztekRir7k6oV5n71sirgeuT9T44pEKyRW0JaLEiqBTICg97h83fSMdTfhRNL1h1eoGaXFeTZR1MjgdugozKhs6AxQ6ripqKmHZZRrRKPJiaNnQ8= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by BYAPR10MB3736.namprd10.prod.outlook.com (2603:10b6:a03:121::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.21; Mon, 29 Aug 2022 23:00:53 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::e026:dd88:fe66:6ed3]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::e026:dd88:fe66:6ed3%4]) with mapi id 15.20.5566.021; Mon, 29 Aug 2022 23:00:53 +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, vbabka@suse.cz, william.kucharski@oracle.com, dhowells@redhat.com, peterx@redhat.com, arnd@arndb.de, ccross@google.com, hughd@google.com, ebiederm@xmission.com, Sidhartha Kumar Subject: [PATCH 4/7] mm/hugetlb: add hugetlb_set_folio_subpool() helper Date: Mon, 29 Aug 2022 16:00:11 -0700 Message-Id: <20220829230014.384722-5-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220829230014.384722-1-sidhartha.kumar@oracle.com> References: <20220829230014.384722-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: SJ0PR03CA0139.namprd03.prod.outlook.com (2603:10b6:a03:33c::24) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d4d6d4aa-4d10-49b9-a681-08da8a1252d0 X-MS-TrafficTypeDiagnostic: BYAPR10MB3736:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YvoLORL0uLbYeOOYjHHS1dUT1Fdl351YRmEpXDysgT+vVh/eC37ngInAcj/Cy3BkWfCvuoCIoUGennvGBhDJUV7holFsG0PQTvBVsqC2MohWUcLKfNUP4pjPbCa5Wa3z96NaO9dWQR6I1SqbzvGOFap8CGT5S+IXSX9zaS6ZKclbUub4gGwjgkCysCZp+r5Gy7k7lU7d4gTDn91vz6sWNRxs7T7IiCAordVtg5bgyTSDL5op9uXsp8PcehyRT/tUp3B1ttV4RP3JHSCJK9WQJw2zfEPWEFVpFvx1dKSa72vTzUVJDFGs8Av6ClDPaPNla4MSB6YIiq6mRVnh/UyoByLLp2uc/ePAZMawmVn+y3k2FhpXr+ze7jJhEistDiC7M55qI0onNze5/uib2alMG+dgppwn6g25BzJEYA5uBRN0noHMdBsGWbN8kl1c7Jj+XWCe/+NALXDF8nh7tZTML7eP5RPP+uySmgyeYPWCRnqKXZDjbAbWN5IXy/QUKJvvUN5NSLdi2nZs40dOZOq11+dp7pw9WnMBz23wOwOUXALgCNf02bMIvvaT960/5oecHCoA8n4oPbViLAP2hUdxqjYlsDI3HdyHs4yj7zhX+fI+d2BB4r5QWo0OMYEYnjmtpYu2rvllL2/1dQmW6U+KwH29MYJfWPaFd8Y9Nne2+crYVyvCwhaIJX4csQ0qu16S3HpEbH1KnrmIGCdqBuVFAw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH0PR10MB5113.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(396003)(366004)(346002)(136003)(376002)(39860400002)(83380400001)(5660300002)(86362001)(1076003)(2616005)(186003)(38100700002)(44832011)(36756003)(7416002)(66946007)(4326008)(8676002)(66556008)(66476007)(2906002)(6486002)(41300700001)(107886003)(8936002)(478600001)(6512007)(6666004)(6506007)(26005)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Yzq4himofP/NVMJhVH06W/7EZWuJh5QuFP0N9zWJp3TytqeUFqkasPCRSTU7E4MysEwL0e2wn1ZZubN5a4uR7pt+WuZT9WOlLAjjrxw/AcDELd3l/KtrwxA2mvBNCLvBM/27miHKxKptEN8ncnVUZJcxnpWxfdFdBkaZuZXBjDmBMt1LUmjARu+RyRc2ZHTycJpqIm//i3A58aNZ1ojmlULA5FSjH7NR8yXHUCzncJBlI5mV91bryPybqjlVUMZMK3dgIFIIrIanCWNPqfQ1mB1ItjLJHmgDGmqIAQBCibD04L4arktrvzmOdfVVHo8Vaa39n459UiN00f9c0aYe7YzHPX9gqhm9kh8sfA1SgSs/nb37HEYGe3+o0Jthoff8+tJ5Nq66DzuaF+nW1U1Kekw0WSVa0WtdsYcbIQy93KFnu6tYSsLQPWyGoGn9a3a+GUf/l3hgLVGRl50x1w5Efwjfuc6uihrz4Dhz/YI/fh0FCj8UmL4nDgxniemOBq9zNmKezquxJA/UifAWRzRHODAiExlSZVnr1CuuVEf3NIvhATf39lsAJYPwMGk0CFVb7nTHwOurW3QrpGQbsAzjGnJWSaBZ/l84XG6QRR0KqroJgmM3AuUY2G5rD9p0vmF1ZBNm2Y639RzyltKT+vsA9+gBaoe0GliSjGfQBHdXpE/4J51b/7fLT1Tg28Mr9dC6uHPfP/+mfPj6NLgGMNqGU4DwWTd2Gg1Zs87LmUIeUJsj3M2tc1tRAVisD7JL3T2eYL90WCMqgzzjukaF/KDMRcW6S2t3G9h3AIX9bIde2L6MlVs6+8XjUmNH+yEcTLB+9WGoJWJeCA86VqaAt4qCS59/J2M0iXOcea0/b6SaHvYv/2IALmdYGbtj22eIBUfU33wrPnB0+7kCSDxx6KhB6YX9qh6b7gvV6cyGC9PD4fUWq9NnG6HRN191IJdzSF2fRwIMrFFIkC7t4AC9EobR0I5YQHdmY/8A+cXEVRScFH/88UXATfTIEBJX0fagPmzm3HQl2cQpubTppig2uJpPMKPiTHpVt44XYtQ0hT5D4UWXYOQetfneVtJHwY2KLM9EVCs10giHcmVd45XP06dVhxqdOfy60l1lyw7nD1orzyaJI+8m0uBNRNqHHHRJk0KAdp7MNopeZLjqvAGQD6x1Ix+C+Pl4yeFTeEgi8S9Nc/P6iymZMsal3FLfaA0bm4FsxRtWZUn+BuOGJnqUG0VyAmQDrPii1wvZE+p8AH238f7p4mYYd5e/ISWICBr4rXYnq33vkEhJXP3YMTwnPxvTG0oOSXVk0Y+lamJPW2z4Uhz2efwTQeFuxXuFfqfA3yWiQ/EjeSO8IZfjk2sqHzQ1JfqyXtGNsepY0uh/j2lEq6/uSCTDffV3Pt2KlZE+raNnHrPVDqmkhc4jr3OlXuUCoxmk63gzrwsCQviPuysR5K5Nt5P68JAKrn0OmbDYeySyb3iSpG2cU/PE5NLqbmKInxkL/qzBSHQH5hD2b/LoSologiQV8+WZe4PGeZecf0KOo+CMeZrl15Axb31AdNNnAy3tIn/Bp2Y9OIwhRXQ1U2KN11uVoX63F/rWlRPQ3ThgyV0MhHpTighQcEREB0ziEw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d4d6d4aa-4d10-49b9-a681-08da8a1252d0 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2022 23:00:53.0734 (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: cslOIOjGA0uBpJBthbYRef8bvFGzVANR1kDcuoMX0zMtTShqUeSkQUpxYokpq0be7BugOQBJ5V/lmTe8QkMmocQXDIJtmIPUkU80vZVKy8g= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB3736 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-29_11,2022-08-25_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxlogscore=999 suspectscore=0 adultscore=0 bulkscore=0 mlxscore=0 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2208290101 X-Proofpoint-GUID: awcsTW6QAFAN-pmBOkj8TtgQnQ--Z7wR X-Proofpoint-ORIG-GUID: awcsTW6QAFAN-pmBOkj8TtgQnQ--Z7wR ARC-Authentication-Results: i=2; imf11.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=ofi48oZO; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=kjkUuZZy; spf=pass (imf11.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=1661814072; a=rsa-sha256; cv=pass; b=ZbckWEpuj9EmnjNn4hH4+pzowgsbp7Sy47SKNQwIt26HW4Lthk5IxfB3lzyAWN8Cak3EZa DTU4qtlCBNyKdUaA3JrjMs7h4hx+njHvEH+Yc7/MrdrFTyXSf/kdN/Am++/Iv6bTCyTj3l Cw3lEpHg0j2ogh3QloAOhpeSYhQ+GK4= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1661814072; 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=9F2h01/pWs7VrwbiyOkSAwUuubzwCxSyEoXyTacAXY4=; b=ggfWiNalwmbKwaoq1HF7XJtuY4i2tKuoCh52YUOWn5ieoEJ6Xlg1LR1T8WVBvTOJolMeah kW2yrebpatgDfB62Wy5tisU6LjTjxYsRaYA7OBV9q1gYuo/hptI6zMmiaYjsarOomY/KnB bQANjM2sD3kD/s2Gx2UEEVlkFGREUgk= X-Rspam-User: X-Stat-Signature: fsma9wsjjnmubcdwgzjmmrptrw5jpxco X-Rspamd-Queue-Id: 3D61840025 Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=ofi48oZO; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=kjkUuZZy; spf=pass (imf11.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 X-Rspamd-Server: rspam07 X-HE-Tag: 1661814072-1454 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: allows hugetlb subpool information to be set through a folio. Signed-off-by: Sidhartha Kumar --- fs/hugetlbfs/inode.c | 4 ++-- include/linux/hugetlb.h | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index d1a6384f426e..3b5c941e49a7 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -971,9 +971,9 @@ static int hugetlbfs_migrate_folio(struct address_space *mapping, return rc; if (hugetlb_folio_subpool(src)) { - hugetlb_set_page_subpool(&dst->page, + hugetlb_set_folio_subpool(dst, hugetlb_folio_subpool(src)); - hugetlb_set_page_subpool(&src->page, NULL); + hugetlb_set_folio_subpool(src, NULL); } if (mode != MIGRATE_SYNC_NO_COPY) diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index f6d5467c5ed8..d8742c5bf454 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -722,10 +722,16 @@ static inline struct hugepage_subpool *hugetlb_page_subpool(struct page *hpage) return hugetlb_folio_subpool(page_folio(hpage)); } +static inline void hugetlb_set_folio_subpool(struct folio *folio, + struct hugepage_subpool *subpool) +{ + folio_set_private_1(folio, (unsigned long)subpool); +} + static inline void hugetlb_set_page_subpool(struct page *hpage, struct hugepage_subpool *subpool) { - set_page_private(hpage + SUBPAGE_INDEX_SUBPOOL, (unsigned long)subpool); + hugetlb_set_folio_subpool(page_folio(hpage), subpool); } static inline struct hstate *hstate_file(struct file *f) From patchwork Mon Aug 29 23:00:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 12958526 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 165CAC0502C for ; Mon, 29 Aug 2022 23:01:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6FFAD94000A; Mon, 29 Aug 2022 19:01:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6977A6B007D; Mon, 29 Aug 2022 19:01:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3315C6B0075; Mon, 29 Aug 2022 19:01:13 -0400 (EDT) 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 0E2886B0075 for ; Mon, 29 Aug 2022 19:01:13 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id DB37A120B2C for ; Mon, 29 Aug 2022 23:01:12 +0000 (UTC) X-FDA: 79854152784.20.7A3E5BC Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf09.hostedemail.com (Postfix) with ESMTP id 7725C140059 for ; Mon, 29 Aug 2022 23:01:12 +0000 (UTC) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27TME8xH026015; Mon, 29 Aug 2022 23:01:00 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=8l6ZCaJpwxL/iTuk/4DYOvRgKzzt2D1N368/bYwnIto=; b=JYnZKWFoL6lp5JJ0V5gZkoctCP8pBSDy/RRboYUwKkaf0rV+GCTcVMeGsVHk8BiEc6fE 314EWwQ8yTv9yE3A3VFjTL3ehwWqtMTnaZm5L9M8xtOkIZZbXQ8Xn1rqt0t07siNifNR cgveAHiYAZUlNRksjymxSjNRQfck8DS1fXqKrS9FIlX99/qcl1EaZTHERcJkI040B0DL 5BJu0SevlSiXUEYO+jExd4n36TWakBuwdMPBEt/E5ji0+1YLpZkDKY4Ns3ySr9glu8qb hM0m1vgzH9EtUK2UI4VwCbmR1h9C0FZm5v6hpP1fdbd8KtDjesjzuqTR6DwI1evX+xXk 1w== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3j7b59vqdm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 29 Aug 2022 23:01:00 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 27TKB2aY038170; Mon, 29 Aug 2022 23:00:58 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2173.outbound.protection.outlook.com [104.47.59.173]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3j79q9c0te-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 29 Aug 2022 23:00:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KxIgVQctv9Up1o1kR4VGDV37imAjZq1H2o/uTQGdHWnbd949ec6z1dA2kLFBeWp8sLYhGoNGQ52qoY/I1m7FbwELvFePR0yGw3PYG3ouVT7Tkw5tTBI2txbIrQW3ktDpWjBXNe1Xlc0VC0ldtRbYbXV5p8tHvMGv1XbjsC0jXMLREO5CYG2HrP0usViv7PLzP+u2c3YV/BWhmiL9/q0bogxKacpydDfsOjExdKwyVrzfEq9U5bPv8aW9E2NnoyqJ60pTNXGrenVCU1xsHDvGiOcpnW48roIk9ZHpgtK7he28IgnLtQkHTz6Ms29/YYbqCAhLgUpE7IL/tQ2w6isbow== 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=8l6ZCaJpwxL/iTuk/4DYOvRgKzzt2D1N368/bYwnIto=; b=lezB0MXB9/l4YEWBtLYwQ6FTwAmu1ebFWyiAXyU2SARbGF+HMavfRPw69/yppDcscrjTbe5qGS+oE/8L+gxypwAWCpEGCEVblv/Ehr+RBOpMecuXNxZILjrkNqwAf08TCu8hjWJqXXS0NpAyZfSlzk+lwaarJFclPv5eS+lGOfZgkGcIXoR+CrFz1c2BvU/jgHe/zK1XptmjJrODchhfOPCLfzH+JVNuTpGbMf0ScVZTCGikSfjFu/0hExNxp/JiZW6LCBXLkYxljwj8FiVDDzAt4CAzDLZCUVd6ViSAeNQhayYlqgHqNaOrOUDJpRWCES+gnP8iBJPl76suMzuoig== 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=8l6ZCaJpwxL/iTuk/4DYOvRgKzzt2D1N368/bYwnIto=; b=oQvEMc1px/TwLCL2kIEHbtMGHQX/9Bjh6HslJJEq9SEfd/hYSw+NNw3TTf544AqymCQxYxgWC+6xOiQHonOpuOSb8+/3DmYS3oh/PKh6JZeZ6UBsZFf41xju79cCetM7c7vCf12khSARL75yaGEKzmUsIzaGvENWscyiDxVOMGM= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by BYAPR10MB3736.namprd10.prod.outlook.com (2603:10b6:a03:121::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.21; Mon, 29 Aug 2022 23:00:55 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::e026:dd88:fe66:6ed3]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::e026:dd88:fe66:6ed3%4]) with mapi id 15.20.5566.021; Mon, 29 Aug 2022 23:00:55 +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, vbabka@suse.cz, william.kucharski@oracle.com, dhowells@redhat.com, peterx@redhat.com, arnd@arndb.de, ccross@google.com, hughd@google.com, ebiederm@xmission.com, Sidhartha Kumar Subject: [PATCH 5/7] mm/hugetlb: convert hugetlb_delete_from_page_cache() to use folios Date: Mon, 29 Aug 2022 16:00:12 -0700 Message-Id: <20220829230014.384722-6-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220829230014.384722-1-sidhartha.kumar@oracle.com> References: <20220829230014.384722-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BYAPR06CA0038.namprd06.prod.outlook.com (2603:10b6:a03:14b::15) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1694ca92-c6f2-4779-c538-08da8a12545e X-MS-TrafficTypeDiagnostic: BYAPR10MB3736:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qXAp4AdMLB8OqhlUZ1O/RZHCwCaqfv0kLkmPl0HcYffpHRMyiWWRp3HYsZ6T9h7y/boUjR0j8H8TrZJ+JF5yqgYmtHVYmSN52J0tvtZex35PClzJ/xHUpbMuLCsbYM4u2u5TY/w7A5vXQ+vhctUTpGlSTao0VuplkddiNdlTmHcGVQBGFEYFN6VLVkz6XfEnX8uPjJWMT1/bUDr+pK5X8wxLu+7IzmLzWzDPKvAkZe41S142QgetBSbBxJwOh8hWo2pSniKNIIbJ/jrgqJWe64tGBHi+212lnVoiYLudp/ky98E2h0GLust2q8QbQFLIQ8xiRGF1MfHfKW2FAy0r4C7nnx2E6dLbymEbP7M9ZwGk5L+D6XUYsFtTarvxrMP4Xo9l6beiKUcpb3c68UnNzHB7crV31roLSj9C+lBQWGLHu4AsZmuR3I4SkkgPkrt1fSU9gio6OGcj9/QUKVqS3RBUMp4WBDxbD50ZayCgL7TRAJhxg6tKuatr8QrYf+VbcC7/pXnMRCKUV365OD6t61H0xTcqh8q6FyP+hIGcP83Z8iYYZwjeEhBqjNGIq8/BcuGvo2Jyq0rN/kw434NejNkAQkZxwVXo8Jo2nB9y4KXUiEh8JPZGwJKsPPHBiXHt89DOLVdkhfdWVQ9heNLsCeRMNWK0c+usM42rD08TT7GXE6nHwAfSM9U709MBwCN8KkmzFSXLKUdU5zIiEqYtIg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH0PR10MB5113.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(396003)(366004)(346002)(136003)(376002)(39860400002)(83380400001)(5660300002)(86362001)(1076003)(2616005)(186003)(38100700002)(44832011)(36756003)(7416002)(66946007)(4326008)(8676002)(66556008)(66476007)(2906002)(6486002)(41300700001)(107886003)(8936002)(478600001)(6512007)(6666004)(6506007)(26005)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: TZsUnhXYmr3O3V4HMeaZcNN5/Ag6jJmqOFH4k38fj8SLgXB120zGA2Xd8UfryH4WN8I6gFkMPHQXgWQQD7ex89fFrPfj8zvn5HAIOmm3B87VKeZOVbb7RCPgLOaZzM9x8Knz6fP5b9BKZpaXkS0WZ85/da4U71twMriIHNdK8Wrb1kwNS5V8x9qzuS7JJykhc+gNtHCHvW9KvcOhuXFFR7mHIybYt7jtBW+OtO4vGsWuebxPM6Gh8C4saPN78gBtFKdUWGyu2EDjiBM6CEL28o4gn/CCoKa1CvvzEOA9AVREEv47FtTBYH+QcACfM47OWdQMpt4omiBDV13FYsOkW+ZjGJcOviqrYvry/dtrOCb+oZohEb4aPfZ+r64QBtHapJgPxtjVFmMbK+9jB5ZWutfDeaJl+3hC8+yltKyvPxQ1Fzw/9Mko0z9bPnbFA8oLVDZFCGEKafocMsXXcJNGzjh39PJTqqNC49cwdwuzuEs2Ur4tX53bl509aP79c2ztD6EQ1ER8k8Ya6Mg+7BVChA9AKtvCVrQNhgiRmWtEY/991xWD+ryhZ9acQexwcDTwFuXxjSlXrFCnpumpI0Q2DoId1zrPAhgwO20pVeh93+QylbUffX+Dc8yZ3+sMe9MeaDIbvgOsAeffzyhvEU8RlnOue1Zm4ddjIc3Kbos9uxwHQ9u64pJlGAuFwN8etvIRJqph1hUwDOgbRWPaEOymezClMpn6iderPkuUfijUDTB/iPb8sTkAn8dfTe/vrtW8EmFdHYsOlt0tMxGPvupL7pZU/mxxFN9bpQuuA2xwp8sX5r16qnqBN6zaYLPLMfYVCP8T9eN04FJNYxs4FVqJ3aclIYTE/Pkitep3JyZpCoss4IoZ2vGABNXksAf/KLGrO4wHHlk4rd8bPJnJ6h+MvjdZvW7IC68l7fzoP2ekb1DmhhpifLvZfZbWjzStCcnxa81lhkRWLZD92XpNKiaj5vp9WnFqKd881c9hJ/OAaIxjYL44K5UYPd4iE2ShLIfnfaMYfPQT/MNn6496Yzf6QdukkWwRgfL1RpdiutSLsww9dZFLPC39oQfeIyYhf+dkoekfrrXPmP5qVctsRlWX/HLSc8QrlYOHaq7vRqxaXr+/l85T6U2mf7WcNYK8S59697mnOHLsEAvt6QicxH+9ZZy871E+81Sy/AKwmSCMZwdrKrC0hUGsbsEcj7vQ0O8XzLEGUXo9cgc+BoGABrqCoFRQadBRIfqJ2TGBFmlWRsIRIDza8fJzXdZecC6IRgSAUTgZLHyd6TZw12JkWRsO246IUVrZbrEoVIyInJLKU6DakGHYovbrFqDQcTeGGWfqnMHMKisI4N7Pex5iX3bjCu9emBIn1A0ZXBvfhK4MLyLB0syxeK2RGg0Bclx/TS/39H8fUxmMj7BYrJOoX0Ie/3aNmlKJXi9NNb1rvo6pAyQULYqnFXn7jPWC1/0qUMXfNL5eZ2qt0K00gZTB9VRt0PS0tzS+B7+45y3Eyh82BA6IUIXYmwh6bWadXKXfECkZLHERD1n2M2TinFLmQlusdSnsCS058pgKlq9VE83zvWrxFS5rFbJ63xed7nxMAa+i9IN/aCMbcHqVFHE4mZ6pcA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1694ca92-c6f2-4779-c538-08da8a12545e X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2022 23:00:55.7775 (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: 8OvAeDhA3n1eALrCXtemUT0V2WHL1zl0FzrS9nm+cOanidM7pIm1MYS1mbUe8FO+rEJEMOYzxrCFYcGMDjQUZf0HUm3GR32x6Q9ZsYwcTuU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB3736 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-29_11,2022-08-25_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 phishscore=0 mlxlogscore=999 adultscore=0 bulkscore=0 spamscore=0 malwarescore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2208290101 X-Proofpoint-ORIG-GUID: CzSqTwL8LsuHDyA4mSIO5pFcQxmGdSOd X-Proofpoint-GUID: CzSqTwL8LsuHDyA4mSIO5pFcQxmGdSOd ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1661814072; 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=8l6ZCaJpwxL/iTuk/4DYOvRgKzzt2D1N368/bYwnIto=; b=MB0l9M4GnoocpAewhUAOl4I3cV9AHWlUCi0M1nFXZaPGUG0I0H/0Vjy2sTwTF3gA0VX6vC JCqbe8SKmCBUPqZvdDpMYipEO45AQhYzsnvhSZFRWXlhKGIlBCSK+IVqBuDNzpNXGKEuMQ r9B4d1D8k9VTN6ak2txhLnDR1JvcrHk= ARC-Authentication-Results: i=2; imf09.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=JYnZKWFo; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=oQvEMc1p; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf09.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=1661814072; a=rsa-sha256; cv=pass; b=FjcQb+wmucSLQV2z9FM0WLKPYunb+8CSxRpfc6RHzloNFudpqEETnmbNEypktH1Scv5rg0 LvzA6ilAUKsMapgIeMU5QoQU+QxedzdkFevGMZtkZsoTWtJqcDiNJJnJJBDWeUtOlBGde7 6okZMp47Ih1QuNejA7b641piK2zgWUM= X-Rspam-User: X-Rspamd-Queue-Id: 7725C140059 X-Stat-Signature: nwehpidnbir19w5pkyi4zpgg88f3pwip Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=JYnZKWFo; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=oQvEMc1p; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf09.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 X-Rspamd-Server: rspam08 X-HE-Tag: 1661814072-638007 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: Removes the last caller of remove_huge_page() by converting the code to its folio equivalent. Signed-off-by: Sidhartha Kumar --- fs/hugetlbfs/inode.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 3b5c941e49a7..7ede356cc01e 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -366,9 +366,9 @@ static int hugetlbfs_write_end(struct file *file, struct address_space *mapping, static void hugetlb_delete_from_page_cache(struct page *page) { - ClearPageDirty(page); - ClearPageUptodate(page); - delete_from_page_cache(page); + folio_clear_dirty(folio); + folio_clear_uptodate(folio); + filemap_remove_folio(folio); } static void @@ -486,15 +486,15 @@ static void remove_inode_hugepages(struct inode *inode, loff_t lstart, folio_lock(folio); /* - * We must free the huge page and remove from page + * We must free the hugetlb folio and remove from page * cache BEFORE removing the * region/reserve map * (hugetlb_unreserve_pages). In rare out of memory * conditions, removal of the region/reserve map could * fail. Correspondingly, the subpool and global * reserve usage count can need to be adjusted. */ - VM_BUG_ON(HPageRestoreReserve(&folio->page)); - hugetlb_delete_from_page_cache(&folio->page); + VM_BUG_ON_FOLIO(folio_test_hugetlb_restore_reserve(folio), folio); + hugetlb_delete_from_page_cache(folio); freed++; if (!truncate_op) { if (unlikely(hugetlb_unreserve_pages(inode, @@ -993,7 +993,7 @@ static int hugetlbfs_error_remove_page(struct address_space *mapping, struct inode *inode = mapping->host; pgoff_t index = page->index; - hugetlb_delete_from_page_cache(page); + hugetlb_delete_from_page_cache(page_folio(page)); if (unlikely(hugetlb_unreserve_pages(inode, index, index + 1, 1))) hugetlb_fix_reserve_counts(inode); From patchwork Mon Aug 29 23:00:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 12958527 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 7D353ECAAD2 for ; Mon, 29 Aug 2022 23:01:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E546794000B; Mon, 29 Aug 2022 19:01:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D667F6B007D; Mon, 29 Aug 2022 19:01:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B1B486B007B; Mon, 29 Aug 2022 19:01:13 -0400 (EDT) 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 90E9494000B for ; Mon, 29 Aug 2022 19:01:13 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 6695180A74 for ; Mon, 29 Aug 2022 23:01:13 +0000 (UTC) X-FDA: 79854152826.14.E77969F Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf05.hostedemail.com (Postfix) with ESMTP id 1695E10000B for ; Mon, 29 Aug 2022 23:01:12 +0000 (UTC) Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27TME26t026282; Mon, 29 Aug 2022 23:01:01 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=t9Jbr6B6wMq0V0oVzBjaghz7DnvZffnOEoWagnJz2Po=; b=iW+ynyVfSZx6LH80xtChKs/HpN6r5xMxCSuwq3Tg2EBNPLt+NZIGrbZASb7PM6Ekm8N8 INI8mmVw0vB57l1NzJqIs9yQSxG0aTBaVcge4duEosP+s8t9ecrDAF570xi3pCPBOf3Y Tr7t/UAMNU43bqe2Ou8cmeCpaVZlLjQKjYMB/DGLCJFqyy/G1lZ9WOM6rFh/zMj66c/9 K/hNycrT/GBBYvVICS76Bs2D6OHw0XTPmYEn7Smz3YdDXwcOJeEmGpfnvQIjx0EvF+Oq yrX5+KAS22XITn9rHYNcUkYty3/qRe4PlbCr0WOeA7QdGNK0A/K1OW39ebb0EdwALWy3 gw== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3j7avscsjn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 29 Aug 2022 23:01:01 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 27TKqeDA018004; Mon, 29 Aug 2022 23:01:00 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2171.outbound.protection.outlook.com [104.47.59.171]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3j79q3b70j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 29 Aug 2022 23:01:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RMjOp/x0VtjXfUy9IHs0EuvQiWas47UQnriDXvJHaP5h3Wspe2BHzDaPoUWtT3BxB2BSESVl03tnGPJoc/lCPoABdjicJcq2N8qRW80Rss+hCHq2oRPrqnHDDukKjsflFguou/nQ1zM1b9CdBOTCS506WmrD7zDQqUuii3aU/A32WB3GNHt5gch1vQozrcGaaeslu3pl8oxr6IGOsrXZ9smTSZBQSbxy4Sg006GGAjIlbwExRCDvjP0xpGYfZz7oFx3AlaJINa+DpWNlS+VPGEozF+xZPEshwnJKKX6WESWvXo4dClmd2AwCsGfTNl7Qt1H+QyuSDMCvSJme0epjKQ== 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=t9Jbr6B6wMq0V0oVzBjaghz7DnvZffnOEoWagnJz2Po=; b=cWJIgOKDPTAExd6XSgeiYDDP76rIXiSKw5/zAqRxm9/a65v050vaWO8EbS0EbQBJPxBNSkdonV4IhicaxE9X8RIhd2+Ax1yNPxg1HJp4iaINQG66HJGGv97HKDCp1EtKLmnBZ0uvlbd7otr8MBIeLIwFLo6cHx7iDU+HPWGcUA32FmVEhAfSQH3azTa68e89vEzb6u/hvXmat99pzRE+0x4fu3EJYfD8mP14/0vsFYbz/RrhNLWmX7vVbnitrTzWa0+OPo8jlTO1ASanSZCsi52T5kcIRVCIrMrThpmltLZbzT1zfF0hl4bdbyIIYZ6yPn2qyG00mRAE3OqYlFoFGw== 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=t9Jbr6B6wMq0V0oVzBjaghz7DnvZffnOEoWagnJz2Po=; b=Qzh2JSFT4SE4/M9AkLl6oP9lchqapL8TM1vE1XRHiM2e11C5M3CnEJF6kNO2HZ0SgOT89O1gqPoDL1i05Fj3QziVyBi8ap7fIgLNDJXPAjxsodTuouhEOOITJiEdX6vClBsFhNLp669Wi0B1hZXJfs6eoulIFEcJjcTqiZYWy3A= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by BYAPR10MB3736.namprd10.prod.outlook.com (2603:10b6:a03:121::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.21; Mon, 29 Aug 2022 23:00:58 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::e026:dd88:fe66:6ed3]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::e026:dd88:fe66:6ed3%4]) with mapi id 15.20.5566.021; Mon, 29 Aug 2022 23:00:58 +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, vbabka@suse.cz, william.kucharski@oracle.com, dhowells@redhat.com, peterx@redhat.com, arnd@arndb.de, ccross@google.com, hughd@google.com, ebiederm@xmission.com, Sidhartha Kumar Subject: [PATCH 6/7] mm/hugetlb add folio_hstate() Date: Mon, 29 Aug 2022 16:00:13 -0700 Message-Id: <20220829230014.384722-7-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220829230014.384722-1-sidhartha.kumar@oracle.com> References: <20220829230014.384722-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BYAPR06CA0038.namprd06.prod.outlook.com (2603:10b6:a03:14b::15) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a77229d2-80b8-4f1a-660a-08da8a1255d5 X-MS-TrafficTypeDiagnostic: BYAPR10MB3736:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1+rz1SvToCBKONBKdyOefrb31daVSH9ji0+N8Pf69VcQko1sqiOtm0f2Pu8F0uMYTM8QMQfGqpsr2Fu62bYWjOoOmM/pVLwzG9VE53yFzEYP/Np9apaoEDlGvTnuAELfa0xVUTRW+s4c09x2Sifgja20WYz1Bl2k63TGpr+q9KrgMF3ShBaHpwln7Xp0xuoteyoxEmmVbE0NdaqOSXDswORTsdstPSnH/SNeI5+EZTzaBGLQ09C/egnuu2KWfTr+W2xt1g9biwnVXTPIex5SAKRA8M30z3j1yV57Ai+2SZQG7icdX1vZNzWPqvp1mzlEXrtMyr1Q4Xpb6EpqDpsgr8OG+sNoGoj2RWLE27RTSKwO0DBXolEKL8MbStRPATH1yyzHgPKwwaYpsUdxYMaoKmDWrRhw7RLWRd/SPYBZKMwOx+ISaep6HbVWYX4Rtq1PK91ddhWMjoLeygrDAaqNkaLcgPpiuyAx/ptp6QCCCy2BsniiVJ0FSXKD+3WHZ6Hpfmdop/cFwVhsaUpo5LqCQLqiUxIxsTKsnyfCWzvLSNiAg9SMvUzfKgUZfbjBH3FylCd9bMdx01EmR9av5A5SnKlFQBAe77t3i8y43I0G82/EB4IEZdASvvUEud6qKzoeRbI5IDFrtfOi+jOu7CBEuMvM7sccm8962u/923Lxop0/jNXixr5jroJjb8a0F+LreAwzX/l0gZ/WiKrgkoLsIA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH0PR10MB5113.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(396003)(366004)(346002)(136003)(376002)(39860400002)(83380400001)(5660300002)(86362001)(1076003)(2616005)(186003)(38100700002)(44832011)(36756003)(4744005)(7416002)(66946007)(4326008)(8676002)(66556008)(66476007)(2906002)(6486002)(41300700001)(107886003)(8936002)(478600001)(6512007)(6666004)(6506007)(26005)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: I/DAQJC9p/yFBGYL3VOsKwZxgrPZMu+Cw8ju7GDjDu6SeXdvLM5U+L8bN2+2KGafIn+ojUZrTpXVk4agwwDFwmrV6uyN0fCimb6C02Bv39giBZQuJjuxzP0luoK3HqVq0g9XlE8LMSF5a5mdQnJ6GV7cq2gN1rpeuYl787aeldozi+VM6aBQowPjABwHNFas82P2jz84EIYLrv6G0SIk+7c9VskhgjF1W4DU2wFfLL/mNrs22AgjdeUQ3mtJwTS/XilQhEfUh/iSu7Gu2AvY5Z16Ztk4/fw6GfceCM88sd3IZLIAwUJnfwCUgbSZSzzx9XVj4yzWmbPihGipHrgV7ov3tgl0YPxm/xgnPG2VC+S/lcaZAURmo9AdJuuEMpx8kiC50QP7tVyjNL3E1wLGUPU/8nOlo4nlDcnKe+CBGipdcdD+1Qziadx55S0cODLUSWuAzHd+CaqMAp/e0CMtOid87tWA78WAMmL+HO5I8OnN+E//ktD+byp8ODJ0ZHJs9bxD1/EfWUD5h5UTDIKsmrJcHZlgbiRpep395z7OLykG0Niw61Linsfs53v7XvJ7kYeDMe4/p6wuLnVokDwTgoGYYVbXDhYUS9wgW79SxbsTCvD3YwxOE4THatAyAn2zqdGCu+Rab0tSIvkqqu77wlRJSBba2U2JZIDnzFFtpE+Tyw8C5uxCw2roFrXPISGxNaSbyRRk/D7clblQrVd+rwgzQnZbrDzVKDon1IIw6sJ6SYEJwucH1ijfDUY3+pExqpuKmDG2GGBtP9z5ifatYjxKqlKtErFXlaJ0ArA2SDjZtssZYkaMqcPaUqaD8oeixB3tUfBZjxpm9LCfuwcv3obGTiNAhafyr1xwtQrRRbNR4T6/J+Lp4C8//yLm/G/bnru2hS1om9tBUws1p4u7Bwadb3IwAhcxq6C41YnTT285z2E1Bwhg1ESqHyRxoJtR/nx029162sLaM5AZ+jE6pDAMnKRUlJKKsMtTMSj2p3mMySyTex9A7f4bXXDuVKk12L20m9Z5SYjDGv/eIPdUZaKadhm5nwXkwWHYv3uZCvh+TohgopzcBMjrzxYf4HoY4IZ0xSEULnLl/QW9Rh84difzBogAvj90H5jDwnDGwszCoOXohwUeK75Vvxb1nLmU56NPeru6lZoVD38uq8ybn4yfivbK4Cqw6Am4LHONZQubBPUQ2YngMaIfp+xU4m0ABR0DL7sJvraYoWJBplX/1GqZxPk/g1vwJE+qC8XrqP9uZo0Af/ltXo4Zp9SRX52SgcGFgNMvLrNmRZO8QxpK+WR0NYZcxE9bFrRUnwwIsmkiekZJ+6V3TEfgIhKfJtaf0sDiwxqaHhlIAf8JBXEFrnfwzguP8ffrjZQ5AOqR4JZxgPp1it/23SCKeNlZ6N58RqngElLx60awt2CDHPXG/LLUzG6u8xYJuGUe+3U2N+BukX8fS+VCOb7P8EAPxqHxm7fAZEmrl00MexIPiNVNjdmMyRAmdpuhObqX366yCHEg7RRwwhGLOX9LuSVE9/vdTVyGYVeBM5E44DA8Y7jh6PP8mSvD9ZC1ClmBy1klPmkC0C4EtXSf0c30E6QRji+wyMIdOkLY/Sq9cadFznd9dQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a77229d2-80b8-4f1a-660a-08da8a1255d5 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2022 23:00:58.1376 (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: /ywEYuEa17UoQEs4cRsNeJej6F0sB2OCpwuu/ACnek40qt3HwrnnlHAB8fh6FiTwLEVcurSSicMXFQk22H2XoAjA+Ung7b2FIJWVsfDRtDA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB3736 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-29_11,2022-08-25_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 malwarescore=0 spamscore=0 adultscore=0 mlxscore=0 mlxlogscore=999 suspectscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2208290101 X-Proofpoint-GUID: qowUH1oN0aFptCaoB1vndt_ML2utoMzd X-Proofpoint-ORIG-GUID: qowUH1oN0aFptCaoB1vndt_ML2utoMzd ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1661814073; a=rsa-sha256; cv=pass; b=SKCoW6XAAvSoUCF1qCdeqv1BaENHw8HJwTF+xdDKxfpW7v5rMFRHW0Gx+yC1pomKkNt6HN Co2ibtSXgKo5VTG0Nq91zUyQmiUNfe+gXY7T6145/wc/OeUwdIxIGOywxFExFI5SZf8BOO 3B7z5gBtZIMquSD2BOxHqbTGj42AIsM= ARC-Authentication-Results: i=2; imf05.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=iW+ynyVf; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Qzh2JSFT; dmarc=pass (policy=none) header.from=oracle.com; 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 ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1661814073; 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=t9Jbr6B6wMq0V0oVzBjaghz7DnvZffnOEoWagnJz2Po=; b=ohDHe53De3fIU4GLDC57LERGE0JGnsAcodDWyDu5n1dqe6frgY0Mk/WWyPQgmgAqpkd6tN Keaxq+APQg3iGVU98Mm0msV/sBilLBJDUhnYaKNCud5Zby5+A4s+3eD9mdTrQjTYbUGnV4 LAl+eGAVG87Yt4BXKHpSp9IvVAKjHFI= Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=iW+ynyVf; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Qzh2JSFT; dmarc=pass (policy=none) header.from=oracle.com; 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 X-Rspam-User: X-Rspamd-Server: rspam10 X-Stat-Signature: djxx7r5anp6nskuhbrgz4ipng41zwcqw X-Rspamd-Queue-Id: 1695E10000B X-HE-Tag: 1661814072-781181 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: Helper function to retrieve hstate information from a hugetlb folio. Signed-off-by: Sidhartha Kumar --- include/linux/hugetlb.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index d8742c5bf454..093b5d32d6b5 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -815,10 +815,15 @@ static inline pte_t arch_make_huge_pte(pte_t entry, unsigned int shift, } #endif +static inline struct hstate *folio_hstate(struct folio *folio) +{ + VM_BUG_ON_FOLIO(!folio_test_hugetlb(folio), folio); + return size_to_hstate(folio_size(folio)); +} + static inline struct hstate *page_hstate(struct page *page) { - VM_BUG_ON_PAGE(!PageHuge(page), page); - return size_to_hstate(page_size(page)); + return folio_hstate(page_folio(page)); } static inline unsigned hstate_index_to_shift(unsigned index) From patchwork Mon Aug 29 23:00:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 12958523 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 16420ECAAD2 for ; Mon, 29 Aug 2022 23:01:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A0C386B0074; Mon, 29 Aug 2022 19:01:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9981594000B; Mon, 29 Aug 2022 19:01:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7701494000A; Mon, 29 Aug 2022 19:01:11 -0400 (EDT) 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 5FF076B0073 for ; Mon, 29 Aug 2022 19:01:11 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 3BE6212041A for ; Mon, 29 Aug 2022 23:01:11 +0000 (UTC) X-FDA: 79854152742.08.72527D4 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf14.hostedemail.com (Postfix) with ESMTP id CEC8410001A for ; Mon, 29 Aug 2022 23:01:10 +0000 (UTC) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27TME8xK026015; Mon, 29 Aug 2022 23:01:03 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=IV4QiH6cFOB61EVLnEPMecqQ7ish7sgP42yEy3wSTKo=; b=qZCrNbj6cvrdYHLdODIfBLSyj9kfR0Fylu0jfMyOX0dEAVdUgIRzz6EZftpnUsclAVXF VHwhLBD0zakhD1eLHOcMR+JpC/85/cakMb1pLsRVGUccuVnWomZCo13OyNB+wL68++Tm MUBbDv8Ov+TY3zNZYaepFV/UemtxTYY/ScVGKU6QH2ozKxMEskHf3OqByGLPD1R5cd4v sR32C7HmKuse8UNnRPd3PnUkCFPSZMFfMnJWYmLXL6R4n11HkgNQxMVQDOxaUTigFXDH UaUTsG4pBvi0RQIt0zcqQWii0MCwAO95WLmjBf8K3gKOMHXbOoSXeiNscwY7SBAFimtB tQ== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3j7b59vqdv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 29 Aug 2022 23:01:03 +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 27TLkQ2Q005204; Mon, 29 Aug 2022 23:01:03 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 3j79q33ndg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 29 Aug 2022 23:01:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WN3tc4Qe6F434YRSfw3YPJOhAAF145Edg6mE+YZnlcxnYww25xw0gu5Mu9FJP+iYQEdEjfCy6rmMW7F2K7IW1Iz+Tz6iKBo9sWsHjILLPGLVrdrE28RPsePMWRpYQr0B/HuL65dNC6yX8AEk0swR2NCd/HAqeIcpDEx6R1MyjtFjtsnRVenKQJ6QPKUrCLiQC8o2dixgH/vf+W8XrKjbc3nkVgaHS/+3qxtlSr0DQcKDos/zk1NRT2B4Oyp/3f1mVB9fMZE/PpfugnpjRUoEE1vYIcRMkpPo/JWH6gChyOol2sebD2tg/XoWOVsdpi0/MDzmHBYBVVdbUmgtyuJ4rA== 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=IV4QiH6cFOB61EVLnEPMecqQ7ish7sgP42yEy3wSTKo=; b=B93Pn8AZjE4q9BXs5drckIxONWtZMKRCw0ICLqyColsIwOVihVHHpRFxGYxTI55LUy2itmDRUn3fxBGCE3p8VV7QAzoSams7BTNJ7OvBaTQU1k5tobro5tN0CRFZsbmiZOLzMG9nlkWgt+e74nefIg+C1DbFMXO1XMi7YL9obWFSJ5t66IvA6HuJemsvJ49ZZsvNFmJsfIwkrt9LEw5O9s4pJRWKayzlLqdXOmmrT7/cAcSBJevAHQHFrP5015UGVlx/OepyUL3ehz0NHcNMESNVYUOF5/InKaiux0C8dN9FDYWFO2/bxFVL/8W8GIWqgsjIQvgxBf5CzKWCwhYe0g== 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=IV4QiH6cFOB61EVLnEPMecqQ7ish7sgP42yEy3wSTKo=; b=OeBlqyO3hmvgY6XZl3N1Zbe4HnTGz0HoZfRU9WgYYbgLwj4OmjdrQeLvfc3tlKLh46LIM95HQWSiclYNQVn8uBVcXG7Y3o9qCc56d4Gvc4YOXbGqCVikBJfuraYkwNvw1yrCaxRsK4ERFw/oCLy9t08/adJwzUnwZKthqWHUzpE= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by BYAPR10MB3736.namprd10.prod.outlook.com (2603:10b6:a03:121::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.21; Mon, 29 Aug 2022 23:01:00 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::e026:dd88:fe66:6ed3]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::e026:dd88:fe66:6ed3%4]) with mapi id 15.20.5566.021; Mon, 29 Aug 2022 23:01:00 +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, vbabka@suse.cz, william.kucharski@oracle.com, dhowells@redhat.com, peterx@redhat.com, arnd@arndb.de, ccross@google.com, hughd@google.com, ebiederm@xmission.com, Sidhartha Kumar Subject: [PATCH 7/7] mm/migrate: use folio_hstate() in alloc_migration_target() Date: Mon, 29 Aug 2022 16:00:14 -0700 Message-Id: <20220829230014.384722-8-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220829230014.384722-1-sidhartha.kumar@oracle.com> References: <20220829230014.384722-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BY5PR13CA0007.namprd13.prod.outlook.com (2603:10b6:a03:180::20) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 92e95683-9be4-4750-d807-08da8a125749 X-MS-TrafficTypeDiagnostic: BYAPR10MB3736:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vUTjnVkyXX3hCaDZRvo0suzDUPt9grjtnw4fdhJ54uJFLuAItD4NpaoTfy+nk80OsScYCTzcoDm/ZZmwYDCRDx8K0ZaDlbbNuDk26q56MtISGA2E8yu8ijWxHD1DNuaORsPeibEL4TbMradEnwkbSYXVE1wLQH6cmhsnQEiVW56VmxDtFGEhys4d+SjEhalmf3fta79n1tU3hOVHMVufaL7UlgqFTrWy6LsWRIAQc0xb2ybS2kX7JDA5/4Ro2Vz9NX2wYqL5i7S+QkguCHcFFmxMeJLpAvTtZh/ytKrxXeEiTonIiSzHUVW0p9ppOhoCWGf4YZIdMTelUK0uNDvXhSgT/pXrUY6RgpGVadu6JMV3nZxasBAFrM/mVOCKW/OKa1JxFqaEs9LY44gnLFovkT8rFcGsfWrhAf/LycxpZ6/WjgYAV8dWLKC0S2E6OS87QVqCP/ifSqvroqX232G3NBqo6HcC0jwcSw7z3KcQcMHJ04iQIuxkHOGz8tFEbNO8glZFcybkhdonpoc6M2NpPknwTV2O7gfy5r92qk50s0+p0gmnEA0i6CVqEUomJ+sPeyFsTZagh8wghh5a1oLudR5zj5SnbIBncbq8Av+5P4iNg6+1Wrc1sD+vWAjaQbtTg7dQfnVA979fwNKM1kAZVtHNymp6zp3V5tqrqp2ANUACWpUWvThTd98MV+RmFsitt7YJ99M4YaeXOdP1FHcqug== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH0PR10MB5113.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(396003)(366004)(346002)(136003)(376002)(39860400002)(83380400001)(5660300002)(86362001)(1076003)(2616005)(186003)(38100700002)(44832011)(36756003)(4744005)(7416002)(66946007)(4326008)(8676002)(66556008)(66476007)(2906002)(6486002)(41300700001)(107886003)(8936002)(478600001)(6512007)(6666004)(6506007)(26005)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 3qG+gIWfR+uZBO9YBNt/iKcEXPk648FtWp3UL0PdemSyT/1zgKqkJ4WD664N8klDYQxT58VYzcE7hx2r2UTHQrLjZH4rSAtbij+wj5BY25B8m3MvEAFZ9emR2N7DMclfFtuEd++/mijnjB0AZYNnM4fCDru3iOevpO9gHc/2I7hiyRjFqv77X8vYE6BZ2QTarExpuoNSsXNWwNs7BkiXCLd/jX0qu0n2tLcFZ1sJqFwkaBVEAJWsBq9ghTtd3NpW171BqhJ7zLmqvFI26dve61RCtn6iTrAfm5Y3FZhfr8tWYMAJbXaWiQ405Y0meRaLBv8+vsjaVZl9ND1zR+ANVL1TbW7Z7N7JErFrms7Uq1mDX4Qa5Ok69dzMd5DGR0LZB/1e1pN3tQCjUbU8k2lJAgvmSGu+i1e6HO0vCm+ldLbyHtroEY3+bhJZoJc4gymT9z/t4nAUVJc0oklp5xe1h2x/sL2xnHs86/qYIvxs1Tf9Klziyuv3ry5YOdWjvMRbeki+whvUtTwxQR0QO3wcSxDWmOeb5IbtwLefAj3VuotRmyCdx8WZuFwrMuR1P6lvbFzLv8vCQx/FDtWwVK/VdQSr0eF3s41VelaZ5mulVIy2Tw+KihRvkTFbKkxy8PGi7B9WMwt6Wpq1MOnqE7WDb/lc/9Lla+Mz5MVOFg/dQk6KTKqmSNk4IeAupNxaBqQtP1mW674wDbbeC4LC6LQacRHc36JxdGO5Uc/41/L9+9jvrE3tiUqyvsBxY95FvVE2GWWumXtdwUgw4ZeRLFkuDvoxB8wy5m5wWbyw4+lQW9pbiEH+VbnUGd7WIAB1tLGHVEtZlK++pVimEtzyX09xwicvn+0EylI9pg/6KJQMMZSBo7ZEuIFJoWsVzaJp7gRqO1btdx4l0lAFw1c6C4ap3oizueSaTlWIzJZ9I2d3nDcUzMhbih6QWmgkRFIaHY4RUY1Res76F6XoqU9YLEz2/L7J8FD3vyEbHGID+lFq515P8pqW6XzFpmaX4QCqVDwJUBv5uiA/WeC7CHb/3cZ9N87EHNQ5Z3osWUo6NCARgKAjpDGjsqKEIvSjTCWVzvaizythu12K4O4Ep0VVTKdbg6Iz8hRdi03+x9ezUIlnmmZLp2vTznYxevbGDi1+u2kDV2PwpNEABjWewy57/goVB4UAFEDPkNCoWUXFXa2KbZ7aYydPA7vleeLLcw9dWsnwBDHlxxjYeg/en5AAF7dsksawrpbQ7H5foaGYKgHVwsU+vUcHYriSwvwfZSIPJVyAU/HwoErxS5zgAifMQHFYqXMFo4HkSqtY4vctyY7vl8yhfIJdJ8rjs+8hfb03ImF9Qq+s6eVjEF9sx63hULs/NRBQaEon5TB2YVhaRgP/nSRPkuiK78RF9VHQ6aXcZkbg//Zm0dyPEIZ0l9NDefb65VNZc3nxXxLyD16LF275GJga6EH6FnjMheCx8Mqy3g8vjtnWAw8CGdfOzblEHnD1VMj6adTU3lEMw+68miKeFxdBVVCPOZFnWFaGR0pd51fREq76p7bPrVWB0duW8i9dQcGFQ9aDNb/sRXDQO2sVh9hY6saCqJ7C7lR4WWjjVEzIaz4bFEmbxPYZVC8YNNUW7g== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 92e95683-9be4-4750-d807-08da8a125749 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2022 23:01:00.5941 (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: tChZ2P8D4PFWbfDE1WbIGtfakdOTeADeP+UQNzZZXbJUDJVjqyY6/T5NmJIoYQPS/7Gi4orZ2PsHuuEfqWEjZizZsdY2L+TFgaO3Cd7L7dY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR10MB3736 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-29_11,2022-08-25_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 suspectscore=0 mlxlogscore=999 adultscore=0 phishscore=0 spamscore=0 bulkscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2208290101 X-Proofpoint-ORIG-GUID: E-d7TGqjpc8gfZHilHojSxFChKPNcjaQ X-Proofpoint-GUID: E-d7TGqjpc8gfZHilHojSxFChKPNcjaQ ARC-Authentication-Results: i=2; imf14.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=qZCrNbj6; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=OeBlqyO3; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf14.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=1661814071; 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=IV4QiH6cFOB61EVLnEPMecqQ7ish7sgP42yEy3wSTKo=; b=lvvHEvDqXbv+6wqazf6+GQJqFmZbWs64ZYzXLj8V1DEDdhQYE6jzK/uqGOhhCbqnrQOiua H2R5ByPwTNwBsPIjBH9eOxLgF6iHFoPwc2trtgnKAztgLJ7PUSS37XLH/Kc8i4eP2jZmkS oAT7wXMxnaaFJ0MvAUnw35wduqas1Lk= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1661814071; a=rsa-sha256; cv=pass; b=o2tRaPokdF+rMqVmlmSPLDJS4dm1TSl9ck2X3SLtPhjVnLi8ft6zxI++pS+y8M2Aq2q63A VC1DJk3gIi8CAAdXBGjlMzf0DG3RF/Gz54+lp2e/UnsM4zLI6XWZZGynDE9rCnNzcz4FWg fy1wFUjXD4PjlxCnLkAWbseDNXxeSJE= X-Stat-Signature: upexc5b54kosimy5p8op8qfxd7j8xexm X-Rspamd-Queue-Id: CEC8410001A Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=qZCrNbj6; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=OeBlqyO3; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf14.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 X-Rspam-User: X-Rspamd-Server: rspam01 X-HE-Tag: 1661814070-513599 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: Allows alloc_migration_target to pass in a folio to get hstate information. Signed-off-by: Sidhartha Kumar --- mm/migrate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/migrate.c b/mm/migrate.c index 6a1597c92261..55392a706493 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -1589,7 +1589,7 @@ struct page *alloc_migration_target(struct page *page, unsigned long private) nid = folio_nid(folio); if (folio_test_hugetlb(folio)) { - struct hstate *h = page_hstate(&folio->page); + 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);