From patchwork Tue Nov 15 21:22:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sid Kumar X-Patchwork-Id: 13044190 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 4B57EC43217 for ; Tue, 15 Nov 2022 21:22:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 42AED6B0073; Tue, 15 Nov 2022 16:22:47 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3AF256B0072; Tue, 15 Nov 2022 16:22:47 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2008B8E0002; Tue, 15 Nov 2022 16:22:47 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 018876B0073 for ; Tue, 15 Nov 2022 16:22:46 -0500 (EST) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id D4C0F1C693C for ; Tue, 15 Nov 2022 21:22:46 +0000 (UTC) X-FDA: 80136951132.10.4D3152D Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf13.hostedemail.com (Postfix) with ESMTP id 598E620003 for ; Tue, 15 Nov 2022 21:22:46 +0000 (UTC) Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2AFKD5Ug008985; Tue, 15 Nov 2022 21:22:30 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=B1KkfsUcxtQ9by+qW85vYVz3lYK0bd4pQJHwcBNtQ8Q=; b=tFm3Wfbwzsevt4tJR+d9QqXOcmAUyS7GyRYzSNbXkp2eTYyq4g878ncviBUMXml4JLmL a9gpVhmznWQCazf8O4JF++eQrPIvIQfbRpMxxmckyfPIJGvJTJT2s+/qchGYOghdn0O5 2Qzf2sdvrdSN9VA11ULZHXHrOtHP2g8x6ZKIbyYRDWPxKgOVXmGpGz2k+ZydvoKgooKN Dk0x4UOuQIzdzyOKjfGPKaY8av4sNRCz3QLJRy/Z9wEX/2K5joJvAO/RbsCqVFvrzBjA 9HuvzWW1iBd3baZDds79NRE5C2lpjLdlrEfxyr+QeJz4G40/uF2u1lw5uHFaSipnm20J WQ== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kv3jsjx8y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 15 Nov 2022 21:22:30 +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 2AFKvO67031792; Tue, 15 Nov 2022 21:22:28 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3kt1xcfvc2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 15 Nov 2022 21:22:28 +0000 Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 2AFLMSRa002082; Tue, 15 Nov 2022 21:22:28 GMT Received: from dhcp-10-132-95-73.usdhcp.oraclecorp.com.com (dhcp-10-132-95-73.usdhcp.oraclecorp.com [10.132.95.73]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 3kt1xcfvb0-1; Tue, 15 Nov 2022 21:22:28 +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 00/10] convert core hugetlb functions to folios Date: Tue, 15 Nov 2022 13:22:07 -0800 Message-Id: <20221115212217.19539-1-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 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-15_08,2022-11-15_03,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=647 phishscore=0 suspectscore=0 malwarescore=0 mlxscore=0 adultscore=0 bulkscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211150146 X-Proofpoint-ORIG-GUID: rZGv0LQCfYEXwxMR5A53zOBXOp7FkL31 X-Proofpoint-GUID: rZGv0LQCfYEXwxMR5A53zOBXOp7FkL31 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1668547366; a=rsa-sha256; cv=none; b=dZt/K8SCmvMLgxtk4+YJcR/BliLmmQqzGJsIVcnJYPgyZa9mCCSuXGUI3JTUr41lirahuk DkAx9skEsjUZco5avmjD1oXSoehJF+jStCJ+WdNKoNUCO49EIDMdLHModuPwbsuDBT8Ncd PkTg4WVOri2kkqw+zGtrxXdhyhEuvso= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=tFm3Wfbw; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf13.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1668547366; 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-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=B1KkfsUcxtQ9by+qW85vYVz3lYK0bd4pQJHwcBNtQ8Q=; b=sKUQKM+pDuqYAI9uYn36S8Fnv/lJKlixQiZp1T2pWtYZzYU7EVWXl5YHKnzsKntSXBX7bk FBqlnyE3CdQgvBTan0AAncQxq2AkOCJT5Ebs2RXo0NBjKEAP70GfG83nY9hEnyEzmvAnvb fSfQhiMj8/PDfP8uYiUZHvxz5TIMx2E= X-Rspamd-Queue-Id: 598E620003 X-Rspam-User: Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=tFm3Wfbw; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf13.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com X-Rspamd-Server: rspam06 X-Stat-Signature: qeupj4tswtg9wzoupqsnqebm6n6o1oiq X-HE-Tag: 1668547366-888472 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: ============== 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/15/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/ 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 | 379 ++++++++++++++++++++++----------------------- 2 files changed, 204 insertions(+), 191 deletions(-)