Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp1087353lqp; Fri, 22 Mar 2024 05:27:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVZA3efhvg+baQKS4OBuI6i38/8RjOEGtgToxL/izGiYw0RPfg5mTxEd8HDybFjQ6TNvIU14vv55D0PRb+Xhenubf8WVgN/OYgZbBfFxg== X-Google-Smtp-Source: AGHT+IHiye3y1E0QB4Y3Rh+RUdvl+/xvxubXIYp1yMyXN3qC3DyB69Ys/2OYBLsf0xvGZiNTKJIB X-Received: by 2002:a05:6214:da1:b0:690:d21c:abe1 with SMTP id h1-20020a0562140da100b00690d21cabe1mr2218386qvh.62.1711110474445; Fri, 22 Mar 2024 05:27:54 -0700 (PDT) Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id jz12-20020a0562140e6c00b006961c24ae85si1902528qvb.420.2024.03.22.05.27.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 05:27:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-111417-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=QFSOm195; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-111417-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111417-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 21AA31C21D99 for ; Fri, 22 Mar 2024 12:27:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D73393FE5B; Fri, 22 Mar 2024 12:27:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="QFSOm195" Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2074.outbound.protection.outlook.com [40.107.92.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 03C1517552 for ; Fri, 22 Mar 2024 12:27:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.74 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711110468; cv=fail; b=Zh8KltoGmHYUiUimxbgklhskN/myiIRmnba7DfMoMTfrqPO3k8E3L7U3AN+OPD3Cs0N7G6byqjk0uOKIBdbnFgBJ2yHvQAPSho86LNalIbj0thpa0inZUQ448xEbsOxbgj22SNeoNK9Nhto2XJvAcOaBcJlsAN/AcsnF2g0FEzU= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711110468; c=relaxed/simple; bh=Pp72FVC76r69kEcyqCj/xpcDG3AigF/MAMIOeQ/3PpQ=; h=Date:From:To:Cc:Subject:Message-ID:References:Content-Type: Content-Disposition:In-Reply-To:MIME-Version; b=GabfwusoT+7mK9hVASARx6SjDNMKzdNviDEusSRh6umqs0RTSlN3+B9vJw91z+spgqGh8x4rtF26sgyW84vWZditVvCa+M2jPMq2ZbWCwE9nYuvU8waJfLcCrfN7EsoRIjfwk+TgAKt1CJ9/6z07T6743t16UfoF6z7f7HIQE74= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=QFSOm195; arc=fail smtp.client-ip=40.107.92.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q49dTe4La7gxK188WxsQlPlXXlFB+t2Ei4EX8Pja0ZSajMHt9lv2rdMdAUHcH5FK1mpE9sYO8UhhO6lfyPbp4aCEOYFTEVP501qDRHuWS/+b0nA9nMUYRfN9olSa5GhU7rJ7Xs/GbtZfb3+brnScDUOS140cHNH/+dVCqhjKW4fZv4cw9X/R1kGe6swjYA0cnbtUsg8gC4KXfNn9v4HBIFZiwf2fJYoKz10wqIKTgUXk86uuX4fFhati6pnSn4MB8oCA8W9lV07Y/glCNiB6G+ZoP31pbpiiBwx77XjXYCiCjYAvcaEyh2hdUM11W0MOmUbXEA2D+FQhhXYoLAiJig== 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=tLP5IavJX+IlzQD8n3W+txWFsjfXaPYljNt/Ql0q954=; b=WhYd4bYq1p8M57LBbxSS0lbvwCT4T0gHwEMnKE3ZxsqMoyMMR9DCGCsQHBdPFGh8zZoCdYwRbyMchiSljMQuJ8AD77wg4mh9Hs/X7yhfGAiqZ7kvKjJBtMYXM8IvplVWgDFqzAe0nBnmzWbZUouu11v08RsPh7kpwKqGyQMrdCQ2HxrMlDww7ZtlQ92hywTJ6ROeG7IC6Kx3UrfvomHzNK+zUB+6Nz64gKY/vH2KhvF+gW/x66EFvushswRBXVF7RsSm5BRpw4A01Wx0XNZSjNELazqalAcTG2p6JXM3bG0scTh5XiQr7awal0vdBWK0Rm2qA7uisWeV3aQ2yl/Dxw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tLP5IavJX+IlzQD8n3W+txWFsjfXaPYljNt/Ql0q954=; b=QFSOm195i60siWq0uPSaWWwtwUASdKvDI/a8wjFNhR7Yv9vBXPxP6gLaLdAb002VFrjehVWKado2H6zggDOhr5RTN+ZPFgHqfbo4UbQ+IBwGcEzaGT318dlJh6GS+FpdTj9A/6y1iepb/RfdRhm2d/KazaVW3Qp1JIrgZfjP6fM5vKdUpQ0eqoPSqi3zBXC/a8Bwd751JFh5aQa9paBO1N9xOCOsI0rkxiLibUUCRe7VSZlGPKxiP/kbSUh4A43Xg5LawZVMGOnnB98Rta3A62vfzkcx4hcfGXxnGi+M5GYx8ZSkEP7hX2BqgIGOK02bl+KHaBLEuZjl1aAoKWd3pw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from DM6PR12MB3849.namprd12.prod.outlook.com (2603:10b6:5:1c7::26) by SA0PR12MB4400.namprd12.prod.outlook.com (2603:10b6:806:95::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.24; Fri, 22 Mar 2024 12:27:43 +0000 Received: from DM6PR12MB3849.namprd12.prod.outlook.com ([fe80::6aec:dbca:a593:a222]) by DM6PR12MB3849.namprd12.prod.outlook.com ([fe80::6aec:dbca:a593:a222%5]) with mapi id 15.20.7386.030; Fri, 22 Mar 2024 12:27:43 +0000 Date: Fri, 22 Mar 2024 09:27:42 -0300 From: Jason Gunthorpe To: peterx@redhat.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Michael Ellerman , Christophe Leroy , Matthew Wilcox , Rik van Riel , Lorenzo Stoakes , Axel Rasmussen , Yang Shi , John Hubbard , linux-arm-kernel@lists.infradead.org, "Kirill A . Shutemov" , Andrew Jones , Vlastimil Babka , Mike Rapoport , Andrew Morton , Muchun Song , Christoph Hellwig , linux-riscv@lists.infradead.org, James Houghton , David Hildenbrand , Andrea Arcangeli , "Aneesh Kumar K . V" , Mike Kravetz Subject: Re: [PATCH v3 04/12] mm: Introduce vma_pgtable_walk_{begin|end}() Message-ID: <20240322122742.GG159172@nvidia.com> References: <20240321220802.679544-1-peterx@redhat.com> <20240321220802.679544-5-peterx@redhat.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240321220802.679544-5-peterx@redhat.com> X-ClientProxiedBy: BLAPR03CA0083.namprd03.prod.outlook.com (2603:10b6:208:329::28) To DM6PR12MB3849.namprd12.prod.outlook.com (2603:10b6:5:1c7::26) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR12MB3849:EE_|SA0PR12MB4400:EE_ X-MS-Office365-Filtering-Correlation-Id: e35b9ba9-15a3-4c2e-2fb6-08dc4a6b7941 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uUTVg+zadAnrs1WOaMSAdIbDkyXAToFUVEh0sYHhV3+TMx4qlvjSWpbEGd9KqWC9gqZb3opoBmiJHDBaNiNHz7+tC9KC1POieyPQClLNlq9UUtKOPX9QmsfjybgPj3Li+sOH9AGPl/3KFX1R8Wxnb1YcmFKSDCchnYqrcKggAeB6i6mEcx5bHugzYE2TjAPLh2farljX1vw+ZGkI+rgz8jL4olCdltv8TDMEn72TeHTKfi0yRgHcCcDBDQK8B63w7ch1rccE6lsWqpM4kFr6fOZnnVsyXbb1CRw/s/X5tAAwfRlsAeUJaN7T1krrXnLWKiueSQXNwe/eosktwcHwoBzKAyyd2T5VwMhFt735Gi17lDQPQmB/vB1A92jz3j9KVqNNsVKiRPWus92ZXdxSif9t9inX2t/mylkGLezDWDX+Glya3I1awNr0BELGC+LQJGEdsBFOCCFWK7DYXYXuIst2IfVg5+qyWZ5vaxodNrBLoM7szJzza6edaYCVjYGJ2x+ir1JF7K855w+2RKh0hSPQcBb9EdMsyRtEcWXUg2EHCqpXs30Id46ajc7OF2TsKWJtMBrUR/QkQllGZoafaBt8e/gtipmluIsRNxdG0Y6/vclFAG1Bqkf2HwE3AACWGClKuUFKAL88zGCu0OAVHtZosIm8dWK1iiRYpJJj4qI= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR12MB3849.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(1800799015)(7416005)(366007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?TiXNQf8IkW6SUIzBF/By0DedAURWnwZ5nhqAcF4o+nu9uxsp2uQRIbp9oLIG?= =?us-ascii?Q?LO4+f/y4TyxCu2i6OWPr3maJmzQAUMw2KwFasvhewC3YA09bTcR02RCLpbWc?= =?us-ascii?Q?9PkM7F/nmDwbhoCBHQ3HHbvJ4ev7sqyZ3zzG5VTEdTe985SHFdch7XQnE6Sk?= =?us-ascii?Q?xEJaoguxwoIqcOyDCtP8nYKiEEYBQ+nVdh/lhdDjIehjR+zL+TAi/YDYCRbs?= =?us-ascii?Q?G0eZpKAZJQPDs/uIP1Ti4BVzl5uOmullFxcLKHbyXdsfJo3QTa0O2qv3nCfM?= =?us-ascii?Q?klxGCfXkvfte+516zRg4T+bJ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?Q?2dvMwMA68AltK1sGcnZadc+11RmUwnnR8pitRsQdTGZPls7t4xYNpHxLxtnz?= =?us-ascii?Q?cvqX126mlNJS7ylwq4gZ95g5LPcoaho1x1dxajDtAUSV/N75UoTjVCG8aIyH?= =?us-ascii?Q?CJq+eThZY1+WyZDvYmAQJq4GnE5CWJLShfalC001XaeZbveK2mqzqlx6Ni73?= =?us-ascii?Q?bPy/KuAEQmFXasdnYyYeTWHiEnfYi+pT29W5Mcp2HZ+jsPkzFMpnl3+nDjbq?= =?us-ascii?Q?olsObf0wDDIXLAcIHHDRSbpchp4MZofGY4gFcrrrNqI2lGQLrOiOGxbMewvD?= =?us-ascii?Q?kYeSNLa9+YCCSdv2QUft64cm+11pvmr1pg6wqGnHp4Ubr8Jw3MNmU7l0sG4p?= =?us-ascii?Q?HZr1ZMEN7uz64sjl4L712E2FwRxiFV9n1N1Me13r?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: e35b9ba9-15a3-4c2e-2fb6-08dc4a6b7941 X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB3849.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Mar 2024 12:27:43.7177 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 7NOlXBnQsmFnslfD5ANkoAQzGQ7kWYprS8udj0FR21j5uvfOGSymvdY6A55LfaLy X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4400 On Thu, Mar 21, 2024 at 06:07:54PM -0400, peterx@redhat.com wrote: > From: Peter Xu > > Introduce per-vma begin()/end() helpers for pgtable walks. This is a > preparation work to merge hugetlb pgtable walkers with generic mm. > > The helpers need to be called before and after a pgtable walk, will start > to be needed if the pgtable walker code supports hugetlb pages. It's a > hook point for any type of VMA, but for now only hugetlb uses it to > stablize the pgtable pages from getting away (due to possible pmd > unsharing). > > Reviewed-by: Christoph Hellwig > Reviewed-by: Muchun Song > Signed-off-by: Peter Xu > --- > include/linux/mm.h | 3 +++ > mm/memory.c | 12 ++++++++++++ > 2 files changed, 15 insertions(+) is_vm_hugetlb_page(vma) seems weirdly named. Regardless Reviewed-by: Jason Gunthorpe Jason