Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2932269iog; Mon, 27 Jun 2022 06:02:29 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s0U+dT6VDHATueIdScHTWR5GlXRKKjfTBs9ZrSgi0GMqbrAbZhmMWad29gyRrGgF8UEiRe X-Received: by 2002:a17:90b:128f:b0:1ec:8aa9:586e with SMTP id fw15-20020a17090b128f00b001ec8aa9586emr16014355pjb.109.1656334949070; Mon, 27 Jun 2022 06:02:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1656334949; cv=pass; d=google.com; s=arc-20160816; b=VQyek7t81a5LCZgf1+he4VyIZ7BnKx/F97gzyRNElmcuIe98eujiPkcAmWJFzGuod2 XPeI2T9SjQ/KPTc1xcK1Mrp9Im8XxaTDeHMSq5Goc3EA+k7a+9fIYdaEMIE9wnuhISED ZswkJFN24Y9jJjXCMYmCIH6nZR9q6oz7L7X2AshfkexPxxTorA6M39w9uFKLLKCYXFtZ ioJWdoyA70j/uOTP5NewCYm2Xk9u7Zh53S/OckKAx4Ufj3wsmjgQKCp2X80T1a06lHwX F9k4Rigc/Z0HrXqIQjwRxP1u7D0Mt+kDVUzr6AQJ2QfcOFg7v6art/q7g2I8k2+frdYW D/dg== 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 :in-reply-to:from:references:cc:to:subject:user-agent:date :message-id:dkim-signature; bh=El0L3LzTl2fyHEtOsLqV0pZIJwdYapXdV8QBHbJa2+k=; b=t6UCrOb7QXh21uSyN8qb+qCauKDgU+vXBLzYlTkszUJvAWu0R8EbptUF//G2dwJTR+ MqpAgcWZikxKaCR1c+zVS23Gl+mu3R0RrhyO2iKanqfc4YKWlrge/st8nc4q7Vy64rVU ttqgguOOt9LhQCdHsJp5hWn1pCzIVXIqhBDXfdTF1EVn8IGoE99iEdJjWSm7dqqH4Lgf WUSIrSZfT67FBm4JHicOG6je8xwcdC59LGwcAJXKrL4fMqJly5uxEgI1S+cQlQTHcdkW Dhjb/Ma/nxQE+9ypfG3P4o/ew+4J0Kg95nu38ALYN/oE8ZOF6vKDztAXuRFQN1256Vm/ DM9g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nutanix.com header.s=proofpoint20171006 header.b=Q8zKuGIN; arc=pass (i=1 spf=pass spfdomain=nutanix.com dkim=pass dkdomain=nutanix.com dmarc=pass fromdomain=nutanix.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=nutanix.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t21-20020a056a00139500b0050d20bfc382si17815134pfg.194.2022.06.27.06.02.13; Mon, 27 Jun 2022 06:02:29 -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=@nutanix.com header.s=proofpoint20171006 header.b=Q8zKuGIN; arc=pass (i=1 spf=pass spfdomain=nutanix.com dkim=pass dkdomain=nutanix.com dmarc=pass fromdomain=nutanix.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=nutanix.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234739AbiF0Mwf (ORCPT + 99 others); Mon, 27 Jun 2022 08:52:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234584AbiF0Mwc (ORCPT ); Mon, 27 Jun 2022 08:52:32 -0400 Received: from mx0a-002c1b01.pphosted.com (mx0a-002c1b01.pphosted.com [148.163.151.68]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88963B09 for ; Mon, 27 Jun 2022 05:52:31 -0700 (PDT) Received: from pps.filterd (m0127838.ppops.net [127.0.0.1]) by mx0a-002c1b01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 25RBXZwD004675; Mon, 27 Jun 2022 05:52:23 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nutanix.com; h=message-id : date : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding : mime-version; s=proofpoint20171006; bh=El0L3LzTl2fyHEtOsLqV0pZIJwdYapXdV8QBHbJa2+k=; b=Q8zKuGINMN/uUfp392QUN5RcEmzY0UBnBaK6oRd79micYyfnpmByRLzOU3XgwM8gJGZI nOyQYzHzFmod/dq2nqY8DnHDLOOxiuuPf2COm/SI/G/v6UXDha0o1KjFvEViGwALpUvx APISv0wtXGz1DzejUOwK11sz+tS1/SZPTEKkCawG8nhgsS+afeQJr5Nb1CJXOdPE2ei0 G8bM3XxH6f9ZwB1+7b4JamaeX7cxGIG+IjsHHofcum9sp8fLXtUP+5vHInUTn6z9j562 csCokHzX8ijppIXmREgoazzKr2kRxVERju2NUcyvLWteDGh+lEnKyLbBMBgN/mjsPtBt KA== Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2100.outbound.protection.outlook.com [104.47.58.100]) by mx0a-002c1b01.pphosted.com (PPS) with ESMTPS id 3gx1wybfc4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Jun 2022 05:52:22 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fuFnEXhFc995u1vQpq0RVnn2r0nP9o1QvtVG89haw7mO18xcALwQ10+4xr/+JIz7I5ajYk2HuaFk3t2uMUqfDFPavq3zhySXl2hEmxRU7EJIQXL1QGZ/ZGWbbj+3Q2gblMWO8cRYE587CKe+5rPbq1eqNMExfYRrk58YvFrWD4wEMBB3gay14HF2UeJPaetX6xkD9g5kcDZCOSltxDk09q13XC+i3ItvE+eBzJnl/jQ6XDaNpjiYhRD9k563pY0fofuXVUAVvXIWX1R0jHi/m/urod42E3EmIOf71vRqpomAcfH2cJkZ13jbXFq7bSAbpcw0GbYTbLacMcjL8BnCJw== 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=El0L3LzTl2fyHEtOsLqV0pZIJwdYapXdV8QBHbJa2+k=; b=CMUChVE4E1yZ0A6YlDoTVw3yW0OyaVmDN4tAL51Gogv9QkFEhUq/iHsJndEuSAT2dGSs8Jo7KWqvzqtMzeJml1tj2jD5H1yLc8zw9APqLfGDUWatpesyK0SgbUBU240qcd4heWysa80puIjMt7U8pIzU5tc8O2yVK3+a/WjwLPcrY9Lj7adJZyAKMsV0tvI0pGGJMypQKK1+LgMkV4EEiuF2nxPm+uF7/WSwXiuidipyLitCHs8B21qybPUbHUQWPr2GXLKDge3s0hPtjkduYuejfVD7XOIfbsxYz8Er8kPsRGo0tQbzaT/sXDOm6N88pCWOER/BplLXs9YL4It6rw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nutanix.com; dmarc=pass action=none header.from=nutanix.com; dkim=pass header.d=nutanix.com; arc=none Received: from PH0PR02MB7384.namprd02.prod.outlook.com (2603:10b6:510:12::12) by DM6PR02MB6185.namprd02.prod.outlook.com (2603:10b6:5:1f6::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5373.18; Mon, 27 Jun 2022 12:52:20 +0000 Received: from PH0PR02MB7384.namprd02.prod.outlook.com ([fe80::898c:892a:2385:3df6]) by PH0PR02MB7384.namprd02.prod.outlook.com ([fe80::898c:892a:2385:3df6%5]) with mapi id 15.20.5373.018; Mon, 27 Jun 2022 12:52:20 +0000 Message-ID: Date: Mon, 27 Jun 2022 18:22:03 +0530 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [RFC PATCH 08/26] hugetlb: add hugetlb_free_range to free PT structures To: James Houghton , Mike Kravetz , Muchun Song , Peter Xu Cc: David Hildenbrand , David Rientjes , Axel Rasmussen , Mina Almasry , Jue Wang , "Dr . David Alan Gilbert" , linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20220624173656.2033256-1-jthoughton@google.com> <20220624173656.2033256-9-jthoughton@google.com> From: "manish.mishra" In-Reply-To: <20220624173656.2033256-9-jthoughton@google.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SY6PR01CA0096.ausprd01.prod.outlook.com (2603:10c6:10:111::11) To PH0PR02MB7384.namprd02.prod.outlook.com (2603:10b6:510:12::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fd8531b7-e2da-419e-771a-08da583bdf54 X-MS-TrafficTypeDiagnostic: DM6PR02MB6185:EE_ x-proofpoint-crosstenant: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: voHtTdZ24XW4LG0NsYMYrXK8N2SbDla9xqflPS4/El+JCBZXnFrYfRxKelLg7m2OtafhAXzSyYAEjcKlEcWfcofSv/kKgnmKlfYMHXUEaQaXCtm+TwNRXn//80ZdTe19mngkhAFKsO0Y7RX+mlSsfH5u9j6/uxhFZAFfDf8HLNLFjlrptEecumRG+pNjnf65DZKkLBEnYEgOqpVzyORPUWKoICk7isUVEBrpZp6HSf0cK6qlSeDMwT3tujX478qqW+8tjEA/StuupK+mIgLyuGxKDoLmgxW13WVs8mb7aCYW4368WedSqXF2SPBHT/QhO/eI6m2u7ITLmp5ohE4g0LAUVv4hTP/uZ9S0meohdlXvU91wN8jhn6d7Gcyf1MtnQ1RuwuPti9lxb1NAigWDHRJxIwf+AhMdhcYuXFOn9qy+jGFCjf+NXBbqzsf6AhVYfk+OYLF00nJxS3DEryIfxwwPx0y21wI2zaEpxitcT2aB2CIkOJVzBSiYePCMb8TBEOiRwINcbcr4YUIKMnTcl9ToJEl3ypFlL46C08S+gCJOuDM6q/jD3YLIAaZ7RENLF1Vt5PqQGKUk+KDeDqiiH1g0wh3SYWDWCa487fKfsc7xYflnQ3Sbg89Z8gHavZBoN5BDKB6AvbjkxOHSMQlFPEtSzRXturNCPZmFB0OaClkHiVKbsqUL5Itw2MjprHSLL8BPJHlE9u/deThLtYvimm1Pc7msfedzfpmMEcRnDwMdXe6Fqjmg+J1JqdC3PN+DVV3u+SO+6ER5S+KK/HHh3oC7d+YX9TVk2o2cL9hgbQ91fb1B2FjJqF+G1g/obHwM X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR02MB7384.namprd02.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(366004)(346002)(136003)(39860400002)(376002)(396003)(2906002)(31696002)(6512007)(54906003)(26005)(83380400001)(86362001)(110136005)(66476007)(53546011)(8936002)(6486002)(478600001)(2616005)(31686004)(4326008)(186003)(66946007)(6506007)(7416002)(41300700001)(6666004)(36756003)(8676002)(38100700002)(316002)(66556008)(5660300002)(45980500001)(43740500002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?eUdlS1ZqNlpOQlRwRmtlbWR1MDBiN2pWUnQ1RVJwUElQUzRWdng0NHBucE5E?= =?utf-8?B?SFRQKy8rNmlNeG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YTVZNTdXYWV4WlkrSzBMN3FQeTlPVWRj?= =?utf-8?B?cE1uMm1jMW5yVVVkOGRXVVJWTDRxaUhDMnppVDVrNjI2Z0JZUHhvRjhuRDJR?= =?utf-8?B?NE1kZEVTZTB1SXVuRjJWeUZkRGcrS2lYZmtHWkFhME1RZEF0NWw3TE5QMS9S?= =?utf-8?B?VHFXcEtuOWxQK3BYUHhrNzJ6ZUw0a2pOd0VWbTVsczB1WmhveEVMRU1UQklv?= =?utf-8?B?MDVlOExyZjY0N1BVY1UxbG9HbWNJeGJuQ2wyVVZzNm1jOGFiM2xjMWx3c1lM?= =?utf-8?B?TWQyN2FSaEhpQ2ZRbnBUSXZyMVV1d1FFK2xwSHFaSmxtSHFNMTFjQkVlRC9S?= =?utf-8?B?RVE9PQ==?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: fd8531b7-e2da-419e-771a-08da583bdf54 X-MS-Exchange-CrossTenant-AuthSource: PH0PR02MB7384.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jun 2022 12:52:20.0763 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bb047546-786f-4de1-bd75-24e5b6f79043 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: tGHTRRvqucW2UNQFKAon6oGBGPRT0VmYv7NSsE3P81lS+j067a8PW/ZviXBbOzvZ3pNc5zd80DIWu70JxAlBInNIEEaedRrykR9I/2GYCpw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR02MB6185 X-Proofpoint-ORIG-GUID: cIP_dA2jcBBkZp44cx34O88sCAPzhUdA X-Proofpoint-GUID: cIP_dA2jcBBkZp44cx34O88sCAPzhUdA X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-06-27_06,2022-06-24_01,2022-06-22_01 X-Proofpoint-Spam-Reason: safe X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 On 24/06/22 11:06 pm, James Houghton wrote: > This is a helper function for freeing the bits of the page table that > map a particular HugeTLB PTE. > > Signed-off-by: James Houghton > --- > include/linux/hugetlb.h | 2 ++ > mm/hugetlb.c | 17 +++++++++++++++++ > 2 files changed, 19 insertions(+) > > diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h > index 1d4ec9dfdebf..33ba48fac551 100644 > --- a/include/linux/hugetlb.h > +++ b/include/linux/hugetlb.h > @@ -107,6 +107,8 @@ bool hugetlb_pte_none_mostly(const struct hugetlb_pte *hpte); > pte_t hugetlb_ptep_get(const struct hugetlb_pte *hpte); > void hugetlb_pte_clear(struct mm_struct *mm, const struct hugetlb_pte *hpte, > unsigned long address); > +void hugetlb_free_range(struct mmu_gather *tlb, const struct hugetlb_pte *hpte, > + unsigned long start, unsigned long end); > > struct hugepage_subpool { > spinlock_t lock; > diff --git a/mm/hugetlb.c b/mm/hugetlb.c > index 1a1434e29740..a2d2ffa76173 100644 > --- a/mm/hugetlb.c > +++ b/mm/hugetlb.c > @@ -1120,6 +1120,23 @@ static bool vma_has_reserves(struct vm_area_struct *vma, long chg) > return false; > } > > +void hugetlb_free_range(struct mmu_gather *tlb, const struct hugetlb_pte *hpte, > + unsigned long start, unsigned long end) > +{ > + unsigned long floor = start & hugetlb_pte_mask(hpte); > + unsigned long ceiling = floor + hugetlb_pte_size(hpte); > + > + if (hugetlb_pte_size(hpte) >= PGDIR_SIZE) { sorry again did not understand why it is >= check and not just ==, does it help in non-x86 arches. > + free_p4d_range(tlb, (pgd_t *)hpte->ptep, start, end, floor, ceiling); > + } else if (hugetlb_pte_size(hpte) >= P4D_SIZE) { > + free_pud_range(tlb, (p4d_t *)hpte->ptep, start, end, floor, ceiling); > + } else if (hugetlb_pte_size(hpte) >= PUD_SIZE) { > + free_pmd_range(tlb, (pud_t *)hpte->ptep, start, end, floor, ceiling); > + } else if (hugetlb_pte_size(hpte) >= PMD_SIZE) { > + free_pte_range(tlb, (pmd_t *)hpte->ptep, start); > + } > +} > + > bool hugetlb_pte_present_leaf(const struct hugetlb_pte *hpte) > { > pgd_t pgd;