Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2610444rwb; Thu, 17 Nov 2022 13:22:32 -0800 (PST) X-Google-Smtp-Source: AA0mqf4Q513hy9Up1y6J85VtlOPbh/iXj6F88F01uv0cOxa6auQ3FHwdv/waIX3LP56/1OhNZiTN X-Received: by 2002:a17:906:36cb:b0:7ad:c9b4:8faf with SMTP id b11-20020a17090636cb00b007adc9b48fafmr3634568ejc.507.1668720152178; Thu, 17 Nov 2022 13:22:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668720152; cv=none; d=google.com; s=arc-20160816; b=xMaBnE0pxRz5bZuPQcNEeiRBcSTHY0PJVwlKUl3TdIMF5Lo18Ry6DX8McFlbyAo+2t 83WUbVxkroXBLVFg4TShjA5dS4wKBNlYtQT/AnIHVhe+HHTR75G9AF5vhYp+FQxwwiwI U5ZBFZPTTnkGXdz5iuM+PthpZBrBChrXL0/ObS8BjPPf4oyIggMDK60kdtqs6cJ7ny+8 MWF+BpzsMxfDLyODQ351g9UO7ARIUBqNJojQkROKXAJ6IMLt5a28FfGLu1ZHNlXQG16u oEJSiQPyiCx2Qpmslg5CkzR4YQOoC2WVB8EwrTIGPnNYScnYjj7zUq3jw+H1VrYNrnnF 9Pcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=e6ev5gLwG1vW7p70iUW3XWYSZKV4d4V19lU42NfzRgQ=; b=h04+d2+bcNrE5zmL6C/SqjDQlwDI1/ThU7yGvMAwlZVSr1JYM4O8WLlxUtkoHUd5df Yf+buf2BRZZm0rLggp9X/kTqYk5w5hQfpd6gfyiZVVZwCYU2FPaMK8SPONnG4fYx/hti VXYgvvN9elOfPLQ9LXQyy4IWMssOLG80bsuXj12kdD2J7D5pRvnfLfp+wQryWNrvCCTT BQLNGsxXWGK28sdN4js219YOKK9nKLIR+ANEut2Eu3jiLyUFaehJYDeJecNO0VTWT3zj RDWtB5iHk1cZaK9DVbJQTbbHtB5Gc81YuwNQpZQoylj7hl9YQ9KosQR/gMfngDOIG2iB BKWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=AhWyWcYy; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s12-20020a1709062ecc00b0078c47b4478esi1145636eji.106.2022.11.17.13.22.08; Thu, 17 Nov 2022 13:22:32 -0800 (PST) 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=AhWyWcYy; 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 S240785AbiKQVQR (ORCPT + 92 others); Thu, 17 Nov 2022 16:16:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240595AbiKQVPm (ORCPT ); Thu, 17 Nov 2022 16:15:42 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F0E66D4A0 for ; Thu, 17 Nov 2022 13:15:16 -0800 (PST) Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2AHLEGHc000833; Thu, 17 Nov 2022 21:15:06 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=corp-2022-7-12; bh=e6ev5gLwG1vW7p70iUW3XWYSZKV4d4V19lU42NfzRgQ=; b=AhWyWcYykAywLhc8QDoWLGU164fVuf9a8nTwUDIN/X/D5voEc0R1+ZlnmfSfigNHeAdP 8ZnoBObeFZ3eWRQAg3HF2DfKjPXM3mVXNWZQyySr8+olI3VGzWM176RpMXOGoUQFJJ+w fPvRwmRnV4Jv6leG6G/XLnP6GpyN5aZyMS5RcX7cR1ykmNN00YFKs8V6NFDICYOEYYQ0 Ng1xlYbi1+IdD44vWBweArqPgh2y63hBi033Q6Xw7RsNKDFUZwVQ7z0+i97oy99JjVcs 8gK8G0Lm5J+zmXynVrX2ukHVZ0Ci0tWwToXLKqHB8TVnzq20Mf49jA4Nnp+FAY8g3ZCd CA== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kv8ykthfn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 17 Nov 2022 21:15:06 +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 2AHKkBH0010831; Thu, 17 Nov 2022 21:14:59 GMT Received: from pps.reinject (localhost [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3kt1x9nqm8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 17 Nov 2022 21:14:59 +0000 Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 2AHLEx7Q024557; Thu, 17 Nov 2022 21:14:59 GMT Received: from sid-dell.us.oracle.com (dhcp-10-132-95-73.usdhcp.oraclecorp.com [10.132.95.73]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTP id 3kt1x9nqku-1; Thu, 17 Nov 2022 21:14:59 +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, hughd@google.com, Sidhartha Kumar Subject: [PATCH mm-unstable v3 00/10] convert core hugetlb functions to folios Date: Thu, 17 Nov 2022 13:14:51 -0800 Message-Id: <20221117211501.17150-1-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-17_06,2022-11-17_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 bulkscore=0 phishscore=0 spamscore=0 mlxlogscore=903 suspectscore=0 malwarescore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211170152 X-Proofpoint-GUID: 1CUSDGTvjerULm4Q4DRzFwp0Fp_ZFPqx X-Proofpoint-ORIG-GUID: 1CUSDGTvjerULm4Q4DRzFwp0Fp_ZFPqx X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, 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 ============== OVERVIEW =========================== Now that many hugetlb helper functions that deal with hugetlb specific flags[1] and hugetlb cgroups[2] are converted to folios, higher level allocation, prep, and freeing functions within hugetlb can also be converted to operate in folios. Patch 1 of this series implements the wrapper functions around setting the compound destructor and compound order for a folio. Besides the user added in patch 1, patch 2 and patch 9 also use these helper functions. Patches 2-10 convert the higher level hugetlb functions to folios. ============== TESTING =========================== LTP: Ran 10 back to back rounds of the LTP hugetlb test suite. Gigantic Huge Pages: Test allocation and freeing via hugeadm commands: hugeadm --pool-pages-min 1GB:10 hugeadm --pool-pages-min 1GB:0 Demote: Demote 1 1GB hugepages to 512 2MB hugepages echo 1 > /sys/kernel/mm/hugepages/hugepages-1048576kB/nr_hugepages echo 1 > /sys/kernel/mm/hugepages/hugepages-1048576kB/demote cat /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages # 512 cat /sys/kernel/mm/hugepages/hugepages-1048576kB/nr_hugepages # 0 Rebased on 10/17/2022 mm-unstable [1] https://lore.kernel.org/lkml/20220922154207.1575343-1-sidhartha.kumar@oracle.com/ [2] https://lore.kernel.org/linux-mm/20221101223059.460937-1-sidhartha.kumar@oracle.com/ v1 -> v2: - fix conflict with "mm,thp,rmap: simplify compound page mapcount handling" v2 -> v3: - v2 contained wrong version of patch 1 Sidhartha Kumar (10): mm: add folio dtor and order setter functions mm/hugetlb: convert destroy_compound_gigantic_page() to folios mm/hugetlb: convert dissolve_free_huge_page() to folios mm/hugetlb: convert remove_hugetlb_page() to folios mm/hugetlb: convert update_and_free_page() to folios mm/hugetlb: convert add_hugetlb_page() to folios and add hugetlb_cma_folio() mm/hugetlb: convert enqueue_huge_page() to folios mm/hugetlb: convert free_gigantic_page() to folios mm/hugetlb: convert hugetlb prep functions to folios mm/hugetlb: change hugetlb allocation functions to return a folio include/linux/mm.h | 16 ++ mm/hugetlb.c | 383 ++++++++++++++++++++++----------------------- 2 files changed, 206 insertions(+), 193 deletions(-) -- 2.38.1