From patchwork Tue Jan 3 19:13:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 38624 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp4779715wrt; Tue, 3 Jan 2023 11:22:08 -0800 (PST) X-Google-Smtp-Source: AMrXdXsmnAJ5WtH0As5Uj8/gxIM2XKlHmSJbW5drZLFJLpzpQqMRiDU9laXX+b1nRw9+HT3EVHkr X-Received: by 2002:a17:907:2155:b0:7c0:c1cf:f9e8 with SMTP id rk21-20020a170907215500b007c0c1cff9e8mr43730976ejb.30.1672773728598; Tue, 03 Jan 2023 11:22:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1672773728; cv=pass; d=google.com; s=arc-20160816; b=EYb7inA6ehsqr66tIkJ+GF86sOG+Hmjgtb7+3fq8bRQRubDsy/OQKYUK8ou+iivKQH VXwr8q0Tt18HFAVcaTGEjyOt4MGMLant9KiuriOFqeGsBNKnzPNy8ne0uIVwca4L5o4s AlrQSl5qEi+RF5AR6rLv4FY9O+DPsQIsWk1WXRGbPoTlFyRvEiSclZoyGw7PkEkPZUvR JRHAzdL274mBVh6Z7cpS9xmrEXZqQPlzZ9mzgLIwiCf5URQgwPMmJodidPoxhTyJndJk CpnGrDsOy2I8L+R70E/3g0oRPK0mPeeenL8Y0tIRJN1rycRff39j1gxahyzDJthjN8LZ niZQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=o1pwg8coY/UF8sIXZqLBGXJKgxdhtYJT0zB5UJI+K/Q=; b=0Cb7r39LQV7EEsinm/xOBDHaeMvuO3iwtYV7Cw4bCfMHC/nnsCjAGkyQwLwSLRbXz6 G7GqHxzNw0XpX0I/ABdBL+wxMNLHX+e1m8bKz3r9n0+ZOssXQL3pxadKr7Dq0tMWh1PY DDPCzv7Lqh3B5ehf4rgTALt7H652hXWFrcxPTKGY+hU7WR2GT4dyQOq0mtJTzA74hSz4 MG/ZQexcrPansrI20ylEG2fuHzmPon6Kpvy0WrdSE0ouYig0Plj4HddbaIq6wRycEf3p w/dzegtuWSRJf1nu47eZTwYo4GXHI1JDFlHCx7khvVFAqZMVLCnoIKCAQhsuUhu+IXs4 yf0w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=0o5GNMlZ; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="KjSc4/JU"; 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 ji5-20020a170907980500b007addbdb9fbbsi29852012ejc.558.2023.01.03.11.21.44; Tue, 03 Jan 2023 11:22:08 -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=0o5GNMlZ; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b="KjSc4/JU"; 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 S239033AbjACTRB (ORCPT + 99 others); Tue, 3 Jan 2023 14:17:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238948AbjACTPn (ORCPT ); Tue, 3 Jan 2023 14:15:43 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2AB5140E1 for ; Tue, 3 Jan 2023 11:14:32 -0800 (PST) Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 303JDr4F000990; Tue, 3 Jan 2023 19:13:59 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=o1pwg8coY/UF8sIXZqLBGXJKgxdhtYJT0zB5UJI+K/Q=; b=0o5GNMlZzKEgBYeriJDA1DcdeOL28k9HpXNoUBfQLsLGu5zsgFW4uiA8NRGdLm/4SMWS JlQD0jYUOnO26AeSX77Op4XdsJjB1qmA7UZxBX4QHWTqKQFvqX57Jm6ZWwbNNGRIiaSB xMokgIX82rUuCGwIT7I56lVhhsEejaTgC70zznw8Gq4yoi66PbSQHLykzOIT9UYGifz3 8pILBbwQIrf+/4q1+IUx/hQQmfhHrjqsVW6hSKl0ii+aO+iSd1Ly+zAx6pj6LmLoq8k+ OEkmcWGzv7UCm7KawktzltVSt21z6JmgjhfPc63YT0TW+b905MVebbX6PFHtF9S2iKJW Fg== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3mtbgqmxj4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 03 Jan 2023 19:13:59 +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 303IMXZM012211; Tue, 3 Jan 2023 19:13:58 GMT Received: from nam04-mw2-obe.outbound.protection.outlook.com (mail-mw2nam04lp2168.outbound.protection.outlook.com [104.47.73.168]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3mtbh58q2m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 03 Jan 2023 19:13:58 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eO5il3iXV/XP2PVS4Eq6Y0o67XRjQY9XgK/1TPLpTW/uJF14YJF9PTKBHaGGvNW+TmJXemO+RovblFYhUim4uB6iBRN5Om+AzZiJDMXSAAAdjSM4cT6bFMwWt+opV5TYrZrVM0laH5CEj9tzWMG5pirpbTwUApu03imtxiY6Vg4RF8IjgmuM3f+uCrB73dxib39L9CTmUVFQZbpV3pHVdGFhC/XIkpeCZ3Nprvq2yUkJKjlIPTyE9RzOAp3Q7LTcw1upKRCxaC/WCucXeQrGxIhNtrzLYzZ07BNe0wdc7tyfHOs7BD+B5Wf5QfzACNune4qoTKAZazf6Y1V0uSF2iw== 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=o1pwg8coY/UF8sIXZqLBGXJKgxdhtYJT0zB5UJI+K/Q=; b=mW5ti+sMatxEBDVlgZRrhtFxhOImedqzpeZmoXbjSUYCzOnJH+7yLqNZk589N5kNRflNwmi1JTqEodkV1FW0sc2v43uvA8xzj0g/UySf4OEIWwFTCtmdRNfBplnmhjNDngUPr/BOJFPx1o/poodVu+IlgsxtoqjnsbzGtn3VCtxxrBGCV52cy6UPe0nYEbP1aSkoxso3xczWZaPNWEwWZ+90JRVdf+32Pbky0jdwoh2Xs4BRhjOt/BFXbFqF+mvWDxz2Stfe/pqJR2oFYiybJMUutb7Q+628BnA3IkeqHTizf8KQX5KgjuF3GpDGHSZp87kt1XHsu9LfM/PyIOzwzw== 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=o1pwg8coY/UF8sIXZqLBGXJKgxdhtYJT0zB5UJI+K/Q=; b=KjSc4/JUXFqTifWrfaeOJmQcfX5cWP+ktHBfi9iA+3U5B8gtcPx1zSZfK2U2nhbpa4SUVMvdBcKc2UcZEqfAb4YX2SLlV8WE1e+CZOZKc+tNCbwrU2Ov6Og9/zniSFH2BVynyjbaAZaE+oET5Tl0Ec1GlVTiN9rPqAe18aw20SE= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by CH3PR10MB7332.namprd10.prod.outlook.com (2603:10b6:610:130::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.19; Tue, 3 Jan 2023 19:13:56 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::51be:1301:5ec3:996f]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::51be:1301:5ec3:996f%9]) with mapi id 15.20.5944.019; Tue, 3 Jan 2023 19:13:56 +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, tsahu@linux.ibm.com, jhubbard@nvidia.com, Sidhartha Kumar Subject: [PATCH mm-unstable 7/8] mm/hugetlb: convert restore_reserve_on_error() to folios Date: Tue, 3 Jan 2023 13:13:39 -0600 Message-Id: <20230103191340.116536-8-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230103191340.116536-1-sidhartha.kumar@oracle.com> References: <20230103191340.116536-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: CH0PR03CA0184.namprd03.prod.outlook.com (2603:10b6:610:e4::9) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|CH3PR10MB7332:EE_ X-MS-Office365-Filtering-Correlation-Id: c04c46dc-f5c0-4a27-89f0-08daedbea8e7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lPKYMrosbJhbm0WQzoqIjR3sgAch7u4douUEXWly5ckXeefg36S93RY/OeqXCJc5noQW8mtZJhlV6/mJAyou9FoUWC+L1VeyVJ181mzAHA63cYhLQmxRAl65zg5v8xjKEPUH+ijnsy07pmbjvAtXzaxmPVO9ERlaBBIB9uMK8WTJFomhez8Uw6iQdx54gDM/CvltGd5eeNTtUFH2VNOxxgB6+l6XZ0IXq7ebC5x0Dd3l2X/GPw2CUjsCYJfHRj9g97yFzBXCstMXXgkZbK8wnxJN9fWOpYlB2tt9WoK6LPY97vp7xgv657elZQX+JRDAAvEH6IJvOyuYKC3qLZSj9o4OnCBapnCNVTPLvuVX/Jt6sSMmEvv3oUFCqXUb6NvnZnWiDAvFb6dyVQPqpEmx2haKDMHhbboVojrgSGRivle/ux1sCDBr/Q/OW+nJGhfC3jOa+9taBnv9qQUaJ9qC2o2axOwqelIbdCZQ2gLLFneDHOgYIBGMLE4kS5b+msylfH+XKB8ab9pfeiYPp838+IH225gNRdfz7HWf0wQvBvw3lL4EggLJPY6nOC2jTQaChZ0u1KnS3ifA280hlCbjWiukdKHKLs2d8m7G28KMDD/RE0eboPubT6rRwF/q5/zSxuBe8LgnFKIRY9pgUcOuFVeogU3ahllKlNm3sB5IyLXmoBsfVLcuHotZPDQtQZZg 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)(376002)(366004)(136003)(346002)(396003)(39860400002)(451199015)(5660300002)(2906002)(44832011)(8936002)(8676002)(4326008)(41300700001)(478600001)(316002)(66476007)(66946007)(66556008)(6486002)(107886003)(26005)(6512007)(6506007)(6666004)(83380400001)(1076003)(186003)(38100700002)(2616005)(86362001)(36756003)(22166006);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ZUPlx64IEtVDVsqNuOPKbwb5mcN8/cM5mMzYfId0YKrTvUOgtP4gRcasizc/7DcvbAeGskw82UDrBFJ9iIrpgVf34dgzkpEy1T5SygW6GrKeTDEdtvksU9836HDOYL/5POoUd2ZSCrnDmg85ogleyGzkBYzzN0z9YM1uuPJ4GZL4WFqyWcrVc/nG0QDovy32u+HE8a5SGikngd6iLh7fNky3CLYhvb6GGwRrZgwb+ctUJ+6sx39A8Xpss/+NFXsbKdQ1vPubKBdz8anpznnJjXuQ6QYeEEInLZTjL/jn9oAjh8wPGD7qtmjIIkia6MuwWpsbREDOjyYDdyKuN5gekY6/i9rwGldAjTct0MLxADXPuX1JPFKbkw3Nmod42OLKUp/dHPrco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veq2FdDEp1mM9NwxWf2tyi/4wVO99msqd5ZLHkPf80QPPvo3U99KOGE6T1uliCuPL5NGd5mc/Co+MIxLnbfhTCLu9slXzwGk1BncD3kONS6EV7jtg4nh21DkU9xNl6KatiO9RIHX+4Ka496jbAogE/ecEhKpoMpFs+CL/RtXYEhUPK0= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: c04c46dc-f5c0-4a27-89f0-08daedbea8e7 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jan 2023 19:13:56.1550 (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: +JRmlWVWl81M5IEhYBPgVljDqVM0hG+VWqBajXFGXKYugvStYZLQ1th5ndstJd+SggTblra6fFybQfZ1L9X10CXkwReZcNGol+saRckMJa8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR10MB7332 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2023-01-03_07,2023-01-03_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 malwarescore=0 spamscore=0 mlxlogscore=999 mlxscore=0 phishscore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301030165 X-Proofpoint-GUID: 5bTscqf6diMvsntDreXqtd4LaLPGaKlJ X-Proofpoint-ORIG-GUID: 5bTscqf6diMvsntDreXqtd4LaLPGaKlJ 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?1754030384950943730?= X-GMAIL-MSGID: =?utf-8?q?1754030384950943730?= Use the hugetlb folio flag macros inside restore_reserve_on_error() and update the comments to reflect the use of folios. Signed-off-by: Sidhartha Kumar Reviewed-by: Mike Kravetz --- mm/hugetlb.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 0db01718d1c3..2bb69b098117 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -2678,22 +2678,23 @@ static long vma_del_reservation(struct hstate *h, void restore_reserve_on_error(struct hstate *h, struct vm_area_struct *vma, unsigned long address, struct page *page) { + struct folio *folio = page_folio(page); long rc = vma_needs_reservation(h, vma, address); - if (HPageRestoreReserve(page)) { + if (folio_test_hugetlb_restore_reserve(folio)) { if (unlikely(rc < 0)) /* * Rare out of memory condition in reserve map - * manipulation. Clear HPageRestoreReserve so that - * global reserve count will not be incremented + * manipulation. Clear hugetlb_restore_reserve so + * that global reserve count will not be incremented * by free_huge_page. This will make it appear - * as though the reservation for this page was + * as though the reservation for this folio was * consumed. This may prevent the task from - * faulting in the page at a later time. This + * faulting in the folio at a later time. This * is better than inconsistent global huge page * accounting of reserve counts. */ - ClearHPageRestoreReserve(page); + folio_clear_hugetlb_restore_reserve(folio); else if (rc) (void)vma_add_reservation(h, vma, address); else @@ -2704,7 +2705,7 @@ void restore_reserve_on_error(struct hstate *h, struct vm_area_struct *vma, * This indicates there is an entry in the reserve map * not added by alloc_huge_page. We know it was added * before the alloc_huge_page call, otherwise - * HPageRestoreReserve would be set on the page. + * hugetlb_restore_reserve would be set on the folio. * Remove the entry so that a subsequent allocation * does not consume a reservation. */ @@ -2713,12 +2714,12 @@ void restore_reserve_on_error(struct hstate *h, struct vm_area_struct *vma, /* * VERY rare out of memory condition. Since * we can not delete the entry, set - * HPageRestoreReserve so that the reserve - * count will be incremented when the page + * hugetlb_restore_reserve so that the reserve + * count will be incremented when the folio * is freed. This reserve will be consumed * on a subsequent allocation. */ - SetHPageRestoreReserve(page); + folio_set_hugetlb_restore_reserve(folio); } else if (rc < 0) { /* * Rare out of memory condition from @@ -2734,12 +2735,12 @@ void restore_reserve_on_error(struct hstate *h, struct vm_area_struct *vma, /* * For private mappings, no entry indicates * a reservation is present. Since we can - * not add an entry, set SetHPageRestoreReserve - * on the page so reserve count will be + * not add an entry, set hugetlb_restore_reserve + * on the folio so reserve count will be * incremented when freed. This reserve will * be consumed on a subsequent allocation. */ - SetHPageRestoreReserve(page); + folio_set_hugetlb_restore_reserve(folio); } else /* * No reservation present, do nothing