From mboxrd@z Thu Jan 1 00:00:00 1970 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 7B0E4C25B10 for ; Thu, 9 May 2024 20:58:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CE47A6B008A; Thu, 9 May 2024 16:58:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C94CD6B008C; Thu, 9 May 2024 16:58:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B354D6B0098; Thu, 9 May 2024 16:58:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 943C76B008A for ; Thu, 9 May 2024 16:58:21 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 37826140201 for ; Thu, 9 May 2024 20:58:21 +0000 (UTC) X-FDA: 82100070402.05.5DD47DC Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2079.outbound.protection.outlook.com [40.107.243.79]) by imf18.hostedemail.com (Postfix) with ESMTP id 637C01C0008 for ; Thu, 9 May 2024 20:58:18 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=s+80X008; spf=pass (imf18.hostedemail.com: domain of apopple@nvidia.com designates 40.107.243.79 as permitted sender) smtp.mailfrom=apopple@nvidia.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=reject) header.from=nvidia.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1715288298; 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-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=gCTJ7R+QlG7B3LzKqs/bhyGTzMon8D5NuIMl+FBzwH4=; b=TqOvRJHds+8JBtf5z9cA9XIbThQT2ptYN7c7rw6/4lfLC1KwvyriWG+9XcGxR21hFNhpHM HMvsr9APO4TQCQAOtYh7ymREJ88Sp2x/vFsjAW8N0668IVWrDeP1yhOJdHnH7FjvdJA50R pqlGWXvOgstOsiKXPOD9lqNvwGOKz+I= ARC-Authentication-Results: i=2; imf18.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=s+80X008; spf=pass (imf18.hostedemail.com: domain of apopple@nvidia.com designates 40.107.243.79 as permitted sender) smtp.mailfrom=apopple@nvidia.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=reject) header.from=nvidia.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1715288298; a=rsa-sha256; cv=pass; b=bFieZE3eWOLe69M8SjgxdQ7xON1zwYomdk+i4z/m/S+IpIW4O38Y/6+I+2wyMUIEvNa8gp 5g9emd4LbIAFRNOgrxovuVsvbWC7I6fZEJ25o5g+kYI7aDgyursGpfF/a0feuFaKN85lqK lgrXYJXdm7d2nKUY6IDoWnFtEeyb9F0= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SFZ14FiVZ8WgtpO1R8qJmOx6PpAk2iZx7hTXVpe8H/ib4ccIeFgdIY3d98D08XXTB1ua1QOSM+muiuQBzW60YUgB6cd/fT1m7jnO+YfHM0C4nh01rYsb2VOxxOYi84aWekDZa/+1j+TiZJE0UbPNPs6abEHiCbxFwjEC9U9dsWH6EMIwq7c2dDJtSDJXy+NBRdNgQgZN7ADIzaifmvkG9INPRLLEwpQ376LpF1U4TwKaaKZ/VpKL9eGbF5ppfvnK035WXFnKPEv50Rky95Mk5du2iJ9jKHukyY0DtEYOufJI1jzG708zp3+xi4NdMsdLmNickTcvIakxBLVP8+423w== 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=gCTJ7R+QlG7B3LzKqs/bhyGTzMon8D5NuIMl+FBzwH4=; b=kr9oIQDNHckbLNtMJ+b1h+aWsTziiLyBk43EFwwOX3zuEO+t8tj8+fenaYDAjF5WJQOmbQMqIrRBeclQpa8u6xqDMJmpoJXZhgfeirMNePCqinT15rj6X54JlPcPew1m4Qv2OlYaI/OabUNvMw/VJz+pZNdZD17Fzhd0q3mQlqSzXe0ovSofNWXfr6RPG0FtQPWb52iIN4gjz2PTWjCJnPhidzHOG+ToEYx8aAxTdkW+9g8t/vMNoKJQA7eFoHITUC3tKQ2nXzMNL6KHgMPqQEZZX9qbO3RySfk1A+7wQbalQ74kra2N+7XC0ITkHEKp/wR1Xf5TwZG4BEyQMNGDSQ== 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=gCTJ7R+QlG7B3LzKqs/bhyGTzMon8D5NuIMl+FBzwH4=; b=s+80X008suqJqvKlzo+Nvfq/d0uOfaU/iv7UG5oRMoqJZHRVVcmcAcjuxeVaIr9Dl7APJciEd+Rkn9S7UIY3Bc01HKPmm0Coax5kdf3q1GRzv+0Ms1xsVlhMd7hgNwBeEroCbSQmLLyv/5E0fgnUB44bmFuen1+nXTG1wswBNMlrKpkZju+oad2kXO6RnPxPW0IIIsXbwofbOVZI6ImHlKNstf5yJXwa9y0dpqcpxARHNDM/LiFZ5/6DYSXBjWmrg/E5H8JZC5+G/35phtFqAZD1XplLEepyiwLcXwXiYOTbNUEx26y0BscaJ8ySGKHCX0qvsDrDCTq/ryG+N1YDFQ== Received: from DS0PR12MB7726.namprd12.prod.outlook.com (2603:10b6:8:130::6) by SJ0PR12MB7007.namprd12.prod.outlook.com (2603:10b6:a03:486::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7544.47; Thu, 9 May 2024 20:58:12 +0000 Received: from DS0PR12MB7726.namprd12.prod.outlook.com ([fe80::80b6:af9b:3a9a:9309]) by DS0PR12MB7726.namprd12.prod.outlook.com ([fe80::80b6:af9b:3a9a:9309%7]) with mapi id 15.20.7544.045; Thu, 9 May 2024 20:58:10 +0000 References: <20240509174204.GV4718@ziepe.ca> User-agent: mu4e 1.10.8; emacs 29.1 From: Alistair Popple To: Jason Gunthorpe Cc: Logan Gunthorpe , Martin Oliveira , Christoph Hellwig , Dan Williams , LKML , "linux-rdma@vger.kernel.org" , "linux-mm@kvack.org" Subject: Re: P2PDMA in Userspace RDMA Date: Thu, 09 May 2024 13:48:31 -0700 In-reply-to: <20240509174204.GV4718@ziepe.ca> Message-ID: <87cypuvh2i.fsf@nvdebian.thelocal> Content-Type: text/plain X-ClientProxiedBy: SY5P282CA0066.AUSP282.PROD.OUTLOOK.COM (2603:10c6:10:203::11) To DS0PR12MB7726.namprd12.prod.outlook.com (2603:10b6:8:130::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR12MB7726:EE_|SJ0PR12MB7007:EE_ X-MS-Office365-Filtering-Correlation-Id: 7ee3c650-0993-42c2-1f45-08dc706abbe9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|1800799015|376005; X-Microsoft-Antispam-Message-Info: =?us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aiXH/sw1Y1FN5QFBzf2G0xu?= =?us-ascii?Q?jOetjo/Lp1QCsHSZxncoWR5ZxASZ+EfmQA42JznwKy5dOWUxhl7qus+/GHYb?= =?us-ascii?Q?JQ0XRuNG3CaC9Xrx5r81XTLoXR7vOubXRVGLy4xklvIQm1oBIzae2smSy+3A?= =?us-ascii?Q?C854khBewyI3z11AZ34Tix1XWXWsM+IlXbhcBwsSu0nXBO1DdHeryN/rP9Q2?= =?us-ascii?Q?mJmfp1esVacTMNtNGFi5qky2jfPqBpbMvYkoAVsPNl8SRWuAbhqAocLzsrdG?= =?us-ascii?Q?4Zki84cboCsNIwsgTZe+Iz0qK7u8B0i6DsprI6qSSdS0LtYNf0Bb8SptQ2XJ?= =?us-ascii?Q?LKYv1SSkS4/dRQ1n2spqV0S+5o/O6tYV8I7RmgJ4DiNRG4iJ/rS0MCEAi35S?= =?us-ascii?Q?WpLotZjxdd2jiOsNoe2/GWUzbAKGLLOFQ90KUo27IQ=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS0PR12MB7726.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(1800799015)(376005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?MnMmbHkPzFwhjZ2KMi6sAO35Xbl8JQJRkSg0WBOclBSTua6lRXq5bxrvfIXk?= =?us-ascii?Q?vmzOhAQgKO9FqMJs4GCs2NUyKRNzLnekOfA6BI4h2Gz44msLSsZ1ggBv+HC+?= =?us-ascii?Q?hVdkM4ULqkMjZ5HX+Pi5Byw0U+MkdBNVcpEA0mIYFDRcKqPuUappUBURkGCP?= =?us-ascii?Q?pJN1UHYKgpXT6AVWoWh9kpGERCVXgOH1XhD7iyXedDuUbGWmy0GOVwfjV3GP?= =?us-ascii?Q?Qq+pigVb8UBPAPq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EBuy3q6h?= =?us-ascii?Q?cN/eqc9rbzEc2ffWr65g7SX27HPAwHzY8TNirOjn/TKMiM6KVlLSpihQVyIn?= =?us-ascii?Q?x4ctZ2h0LhD9iLAXtuLQdKYUGCbBUqfMc6dG9pcMv3G59EicSUH2HVyT78fY?= =?us-ascii?Q?BfjXn/BiqeDLlOYqfzfB4hj6SbjYtiy0EIKT44HJJsph5D0K5xkSYQVO8dw/?= =?us-ascii?Q?T0yox23yWiZXhhLiu3LKaqkD7iLGRdIweAxNCIxIJAJQ4dZ5hosgyXM5adhW?= =?us-ascii?Q?FDBKm5uw/sDaR/rAjC+o+5V4utekCkmVIGRqObL3Jzrj1tSirWIO5CTIz2fa?= =?us-ascii?Q?zy219FysG1JIc9HiOg05yD5vWEMnwCLgI+/Dr5asjJblvBfZaYmfH8x1Y5E8?= =?us-ascii?Q?UiuSPg5oaSleVC+sZT5PucDiUMVlUcEvfVzOFNA8dCqeP6Z/OI+npW/FnYLv?= =?us-ascii?Q?F9LXbOKarsBFBfhi9iSZd7JsTlg91UFobxAlOWnb?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7ee3c650-0993-42c2-1f45-08dc706abbe9 X-MS-Exchange-CrossTenant-AuthSource: DS0PR12MB7726.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 May 2024 20:58:10.6060 (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: 3ybgJm0wThpGbkCHBtKHrueOCZwwVGfdVKWJcv44DtqBERYiXU6T8Tn/ZTK5mrBuJ+T//bDW09uX1WeMWlyo1A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB7007 X-Rspam-User: X-Rspamd-Queue-Id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ZXv77bdIE R9qxhv7g MABun+qWSDML39QpqloxQa82NLip7d3ILUlhYGFWaHgRhgIc64AOFxwdUG7DgNz1TcvT2X626seS1zB2WRxNQYeEQTMiIgo6/micIdpNNJxWHigJfye936lgw7vy+TdXnvlTvxw93xFgCXQQgHQnf+XKtBP4OQNgALF+MtgETMCB0j3G8D1g1u5PkeYOgUYo2beF/PCsZDKx7k1FJcX+bfj5X0LT+pLyIlpzzHam62jE5MXSVyGKwueaM2swj0oAe2e7JRxfThTbnrFKOnlBi+5A5rB6tWCGEQI7ReGObwHxOV1yuB83MSn4zvA== 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: List-Subscribe: List-Unsubscribe: Jason Gunthorpe writes: > On Thu, May 09, 2024 at 11:31:33AM -0600, Logan Gunthorpe wrote: >> Hi Jason, >> >> We've become interested again in enabling P2PDMA transactions with >> userspace RDMA and the NVMe CMBs we are already exporting to userspace >> from our previous work. >> >> Enabling FOLL_PCI_P2PDMA in ib_umem_get is almost a trivial change, but >> there are two issues holding us back. >> >> The biggest issue is that we disallowed FOLL_LONGTERM with >> FOLL_PCI_P2PDMA out of concern that P2PDMA had the same problem as >> fs-dax. > > Yeah, it was not a great outcome of that issue. I recently came across this trying to do something similar with io_uring to mapped P2PDMA pages for testing purposes. I commented out the FOLL_PCI_P2PDMA check but it hung/stalled during process teardown so there might be something there. >> See [1] to review the discussion from 2 years ago. However, in >> trying to understand the problem again, I'm not sure that concern was >> valid. In P2PDMA, unmap_mapping_range() is strictly only called on >> driver unbind when everything is getting torn down[2]. The next thing >> that happens immediately after the unmap is the tear down of the pgmap >> which drops the elevated reference on the pages and waits for all page's >> reference counts to go back to zero. This will effectively wait until >> all longterm pins involving the memory have been released. This can >> cause a hang on unbind but, in your words, its "annoying not critical". > > Yes > > But you are looking at the code as it is right now, and stuff has been > quitely fixed with the pgmap refcount area since. I think it is > probably good now. IIRC it was pushed over the finish line when the > ZONE_DEVICE/PRIVATE pages were converted to have normal reference > counting. But P2P DMA pages are still in the off-by-one reference counting scheme. My RFR series[1] (aims) to fix that, although the pgmap refcounting scheme needs a closer look because I think doing the page refcounting properly allows some cleanups there. [1] - https://lore.kernel.org/linux-mm/cover.fe275e9819458a4bbb9451b888cafb88af8867d4.1712796818.git-series.apopple@nvidia.com/ > If p2p is following the new ZONE_DEVICE scheme then it should be fine. > > It would be good to read over Alistair's latest series fixing up fsdax > refcounts to see if anything pops out as problematic specifically with > the P2P case. > > Otherwise a careful check through is probably all that is needed. > >> The other issue we hit when enabling this feature is the check for >> vma_needs_dirty_tracking() in writable_file_mapping_allowed() during the >> gup flow. This hits because the p2pdma code is using the common >> sysfs/kernfs infrastructure to create the VMA which installs a >> page_mkwrite operator()[4] to change the file update time on write. > > Ah. > >> I don't think this feature really makes any sense for the P2PDMA >> sysfs file which is really operating as an allocator in userspace -- >> the time on the file does not really need to reflect the last write >> of some process that wrote to memory allocated using it. > > Right, you shouldn't have mkwrite for these pages. > > Jason