From patchwork Tue Nov 1 22:30:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 994 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3246854wru; Tue, 1 Nov 2022 15:33:35 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6OyJ31kOqbgq8KSc3TxuBQNWJVMcZOnREhloKMr7Be9N6ddEBrYtI72reudEtvBGzONxze X-Received: by 2002:a05:6402:1292:b0:463:27a0:72b4 with SMTP id w18-20020a056402129200b0046327a072b4mr16553881edv.419.1667342015356; Tue, 01 Nov 2022 15:33:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1667342015; cv=pass; d=google.com; s=arc-20160816; b=Id2uDh1k8eSI3dFfGdeMh1dTi0Jt3syGL5me+RpzxH4ZWotdXoC6+k2Yvr9iEdX4Zb mk1R2zY9Xc2eXtsBsp553wTVgH59Q/EVeAZL48AbdE4Z21q3ntyzsSyRhHFDARWAaewg 5EqFqLi96EOiVz8Ur0fAIrRn8iVvtHNBJcvD1MGMJRdmgwzTMFBQs/0npy9wGU8G4Gws TIh+OcKE8ZD5/dO2OUHO/r5XIOhfK4F7nj3p4JLW9izunkF+a5D3A3XHd3SYc++Ft+Ta 58UgwjgD/2nLxW3FlMnGMLhmxZAv4xuDm0DNhpKRZ6TheQ4EXobuB2A7wstK4x+kg6g0 2hJA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature; bh=J8Y2Ey1M18G7oaDVu2SAR48OoMG4Yc24leIq2Z/FI0g=; b=Q6ow2mymNlZuSHxORUh2y7ewMJZKlMIHpmqRE5WLnTWlR6s0yLEahsevu0n8vwbdg5 xDL70i2vguiuE3m4NNbvdEU0Zh2815RUzxKJzvCeQAnk7k+Mk2QurOgIiR6gkMFt64y7 fiEZBwbEjPlz7wXJnv3DDUX5acLWQhDN7/hTqy87OzffyP7RE7JZozbK8blPmVfjxJu+ Wriq7qbhjPMcr7TOf834uG2mKvLz1MpSoh3iA4lnWSMRgupp5RCzqatT06R7cBwMJuCB IOyfv/V2BdfjvynNUpi2ve/NWXVWHfgxfuVUBbLDmLD9XXWrRdKmbLYMainbj7KaOtjV +Elg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=sdp85oOF; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=AsQKAlhB; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ji10-20020a170907980a00b007123952b00dsi13975918ejc.100.2022.11.01.15.33.11; Tue, 01 Nov 2022 15:33:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=sdp85oOF; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=AsQKAlhB; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230139AbiKAWbp (ORCPT + 99 others); Tue, 1 Nov 2022 18:31:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229591AbiKAWbm (ORCPT ); Tue, 1 Nov 2022 18:31:42 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C141DFB7 for ; Tue, 1 Nov 2022 15:31:42 -0700 (PDT) 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 2A1M47HM028746; Tue, 1 Nov 2022 22:31:25 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : content-transfer-encoding : content-type : mime-version; s=corp-2022-7-12; bh=J8Y2Ey1M18G7oaDVu2SAR48OoMG4Yc24leIq2Z/FI0g=; b=sdp85oOF6PlXA/gStkdt6TxNfZz4SXAe0kQ/HZ1ya6I3PeAC1iBUEN5pEYOvb+q6hTpH klzwNFtVULXAW4Uu2SvCHdyaeQH16A2iK8ikSbfwq+TJAz1VTjH71GDXbW/rXsVzvg9u QoMi4GpAcZms9htjhZYfc+L9jRN/b1HWY69A9FUturky0XMa1d8nBH8Z3MQlYxlhvzBZ BYrjVKinwiz2ZnRwBPxgo9tfTHBKZhXRdhNlyxptbFXGFKabmgu6JUsAIreywUfjdM9+ +eND+ayq3ySF6s91gE5CZP+BTj5f1ZoSvpzGA1/vtIvmGhHYPj2lAGad3OIz99tcnSko KQ== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kgvqtg3ra-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 01 Nov 2022 22:31:24 +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 2A1KUc3J003094; Tue, 1 Nov 2022 22:31:23 GMT Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1anam02lp2043.outbound.protection.outlook.com [104.47.57.43]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3kgtmayarw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 01 Nov 2022 22:31:23 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Yn3nkqfSQGvoFPtDvBDXFa0fYiL5TECcmCmYNNmOxZ2MIj6mi1k9Q77hVBiaRai2v55TEv5xRWDPmjCRRi933cjs9CblUAHaVpaqzZsX3/2G/NHUicovOSrTllZVGeBV4itL6nwTkixqod8GkO0Ype5sZGtFUlxtqrJnFHckdxsGOqZ7HhNFZCvb3ZuY8lgN56GHvgNFhw7DHZLqQJdOc90yUgs3B6GqLjWsA8Pd46nCNCIYgFLx+LGjLibeV6I5/T2yEIBtTaE8fd7r+ZwpCSJL4NNyWZnhBkdcy2GbUplcGLzVqnq+bOxhNw8cW65Ko1EhJ4pIIlbVoSyqJvLs2Q== 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=J8Y2Ey1M18G7oaDVu2SAR48OoMG4Yc24leIq2Z/FI0g=; b=Mj/Vee226HfoIkoj8l1E4bkqjvgKWKRkEg+v6jvskZqbZpJIvue6e59d+JmGf2hZ8n3G3ZKcHft9yx/hFhQEoN02MhZaLAosp5dGU9LX1tx00TIHCTuTImtTd5NlEkkoOj7fnHZ7Y7mVwMBv32keEsuR+DEZkg/NrUtALUZEAgJ0uhLknFcjWi1LVWHAX6EBZ05PDdRJhJhddA3bBcRuOYmCe8zAKOuIRuWDdWurhL9d2fiPMzJsmdrrsHGWvlaqYiQjWe2bA9+1eZxaQqSFganr0RcZi3gDnVlLWjqVGmZRydOplKwRDuRPLLCRJ0FuTxizofDfGsOShbBqsnQhyA== 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=J8Y2Ey1M18G7oaDVu2SAR48OoMG4Yc24leIq2Z/FI0g=; b=AsQKAlhB9HY8hJqv3RLr9/BzlI+hWwEV3aBJYHoCUqJU109C3VeLwZzPQho25CttBUVAhJqiwYveMc3wxdLfNQvY7hCnSQrR4FJs9EP0Yk80cSjrI/2HZ/xzLPMzbjQd64ixI4UmELYJ/GKmxjT/mOd7nZUFo9y3Tv60Sko2Ilc= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by IA1PR10MB6075.namprd10.prod.outlook.com (2603:10b6:208:3ad::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5769.21; Tue, 1 Nov 2022 22:31:21 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::3702:7db0:8917:9954]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::3702:7db0:8917:9954%4]) with mapi id 15.20.5769.019; Tue, 1 Nov 2022 22:31:21 +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, almasrymina@google.com, linmiaohe@huawei.com, minhquangbui99@gmail.com, aneesh.kumar@linux.ibm.com, Sidhartha Kumar Subject: [PATCH v2 0/9] convert hugetlb_cgroup helper functions to folios Date: Tue, 1 Nov 2022 15:30:50 -0700 Message-Id: <20221101223059.460937-1-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.31.1 X-ClientProxiedBy: SJ0PR03CA0051.namprd03.prod.outlook.com (2603:10b6:a03:33e::26) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|IA1PR10MB6075:EE_ X-MS-Office365-Filtering-Correlation-Id: 158337b9-596f-4218-f314-08dabc58cd29 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mHfZVqYnHOkgAeCNEJTTNyuckhQKWDeMjUIIYWhTXRKPGm82Nie3rY1b+sp3ZEvvvpxUL5CZ5+1tRMUTJR6DNNUElZHqgTtZ9+mfF9B7v9dJkoyxBVV4n0AjMDUJsUGb1T3qTBkl3liTGCwF6yHC7cWX5M1ejgcROfB3kw6WoQUvLpaLD6mJwlQoWJF99MfNvvz75RWKh2veSN0Gokdwt+muO2vEXbBrJa1ERYMvnKGSu7k5Jqx4D8rh63qj05v0w0YeodNMUCfwlin8kKJ4FHPOYNqKO1VJbn8/b24Kdu/JaJq9yZbcKEO1kGGHmugGy1qElbM5XaFre+mcWb55oQ6CbmkDgj+IKWuOOAUKNFoSbWSQa7Nb81//Danq8BdhlDDdyiO64aB/kxxFTXBKFFbJZ0/cD3f9wWXy1R96YqwHuVaSncHbtU+RfkklS3CM/0/BdtQMkGW3Qta2eWhthqKOg2LQ6Fd0JlsrS9mwY6Cq+TAn440o/z2G/n8/sKxk4UmQshhvzc9NQI0o4CSDh+lhycyGEX8xlAZnpIDnm5rPMpzMe6NLvMkmXXlUD2pHpb98QtfVY+mBYrIWt8gslz4jJGY2NRNn5jI/HpwWmdUDJ+xkaswnymsBisVNHz/Bw4Y3KWFebvlSLZoET7N9Gfn8Vhosx9+8PKZq4U8V/lkwKMhKdvFQOlR3ZDyoajPv2vAouUh40P2MUQQW55D9cI+FMQcCli+YFlsKvldS/Xg= 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:(13230022)(366004)(136003)(376002)(396003)(346002)(39860400002)(451199015)(36756003)(86362001)(38100700002)(83380400001)(2906002)(5660300002)(44832011)(107886003)(2616005)(186003)(1076003)(6666004)(6506007)(26005)(6512007)(316002)(478600001)(4326008)(66556008)(66946007)(8676002)(66476007)(41300700001)(8936002)(6486002)(966005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: k6R0suY2QqefF0Rc+xh3l2I9ROKkoEOFIrkQz/eLo0YF+K4ubZ/wsPHqQHrxyf7bPlgumhunwzxkBvI1IgtksVGvQ9HcfxOZgWOxeyH9p52ZNmcyxPJEh5ZpjpdqEMBs9xf0K25v7MsBbC4Zo2b1+nZkPMCLFL38EE8gsUnH+2S5ghkDgfWApXL68Q9Jz4x+/V7eehZpCtKvwDbnpepNc6aU0UxMrysKB45JCHGx19BshTpBFiRmp60+hcTzuOu5JrkiJXF7UYrXbPoTHYEGx0ntBe9WxrvJE7R+n7fbQqyVBse6MdSUdefusvCBYmZTvMQuS5PzSFpG+tojNSj0lFVcAxFlnEO590cj1dsB3f3Fqwwh/0rFa2uHORia3PCGHzRk4/N3O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QNMgTBxk8X1Nn1RLzcezvAS4i41GO75POKhPk0HLfNxUZt77Goke3f+m1O63kSwS6QijuzfJ8wB9asLBpf0jwAyp+2vzO+Cl2vphyfU552FXDH+KfdfzMDhd1fisQQtdk6+jktPPHnkYzFdbopYZNLTcB0CQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 158337b9-596f-4218-f314-08dabc58cd29 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Nov 2022 22:31:21.3755 (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: st0ilgeFk3rinN19zLnGSdSKUDUH8dgLWYW1BSzBFUtDIm/i87VYLs8wnlcNheRf6pKmNu7xDcULNmo1K9yGw+gvbbMVMh61OsqhWUhFMC0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR10MB6075 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-01_10,2022-11-01_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 adultscore=0 mlxscore=0 suspectscore=0 malwarescore=0 bulkscore=0 phishscore=0 mlxlogscore=898 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211010153 X-Proofpoint-GUID: mDRKZEkWXBDT2cgNbjz9puvERlBYIjbU X-Proofpoint-ORIG-GUID: mDRKZEkWXBDT2cgNbjz9puvERlBYIjbU X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748334821085647273?= X-GMAIL-MSGID: =?utf-8?q?1748334821085647273?= This patch series continues the conversion of hugetlb code from being managed in pages to folios by converting many of the hugetlb_cgroup helper functions to use folios. This allows the core hugetlb functions to pass in a folio to these helper functions. This series depends on my previous patch series which begins the hugetlb folio conversion[1], both series pass the LTP hugetlb test cases. [1] https://lore.kernel.org/lkml/20220922154207.1575343-1-sidhartha.kumar@oracle.com/ v1 -> v2 -fix folio_test_hugetlb_freed() check in alloc_and_dissolve_huge_page -add more folio conversions to unmap_and_move_huge_page in patch 9 -collect review-bys from Mike Kravetz -rebased on next-20221101 and mm-unstable Sidhartha Kumar (9): mm/hugetlb_cgroup: convert __set_hugetlb_cgroup() to folios mm/hugetlb_cgroup: convert hugetlb_cgroup_from_page() to folios mm/hugetlb_cgroup: convert set_hugetlb_cgroup*() to folios mm/hugetlb_cgroup: convert hugetlb_cgroup_migrate to folios mm/hugetlb: convert isolate_or_dissolve_huge_page to folios mm/hugetlb: convert free_huge_page to folios mm/hugetlb_cgroup: convert hugetlb_cgroup_uncharge_page() to folios mm/hugeltb_cgroup: convert hugetlb_cgroup_commit_charge*() to folios mm/hugetlb: convert move_hugetlb_state() to folios include/linux/hugetlb.h | 6 +- include/linux/hugetlb_cgroup.h | 85 ++++++++++++------------ mm/hugetlb.c | 115 ++++++++++++++++++--------------- mm/hugetlb_cgroup.c | 63 +++++++++--------- mm/migrate.c | 12 ++-- 5 files changed, 149 insertions(+), 132 deletions(-)