Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp276648imu; Wed, 12 Dec 2018 16:46:50 -0800 (PST) X-Google-Smtp-Source: AFSGD/VagxEh35ecd4BzALvE7cVH8mmfXqi1qOwuVKBb2zHfezfnQLLJvbq2UyWBOtqzAQ6zPWp6 X-Received: by 2002:a63:6150:: with SMTP id v77mr19718374pgb.266.1544662010697; Wed, 12 Dec 2018 16:46:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544662010; cv=none; d=google.com; s=arc-20160816; b=T0U8JsxFfPc8SUL5ugHU4ku0j4uZXhI6U0t0v19WsXxkTDjGSwsvsK9VRoLCV/+rGr Vj2Wgn9795Av7Xfoe+pHC5XyYVaU2k9v1Xx7itfhvjhzp47pwLL2dhL5Pbw38gy3am4U aqpUBbsDzKvJdZVnAjJHFQXWMUkJTr7u3R0HqkNqqgE/AJEjZxLVRz05atO7O/vtxbyO IbtLMLEuaz/2LWlzJuI5P73S/h6HeazwfT+Wd6pSuDZVR58xzhCaFPug9KDtYbnsoQRB V4TmjhgZhtZLK3ZtqoC8UQredhTCt6YK3qciSJI8CY/PbX0/aW6bJmeDslYDku1+LobG /U7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=K6Kb0yVmDYKTpBRw5EMLVD2H8pPzVFCS4SE1Ch44BJ8=; b=RGjrxcXzxsRc0qFuu9bsb1n88KMphSDjmndbkhT/cAcLOLsYYIvMBNWzZSNaFbxkE+ NwDmaIvqyqyRLdw2cWuBYvzHZjtVZhRxFt4AbSNBZJkMtIj2+TgKgBnuAKS0nGeJ3mVN qr8Lkgj8SZg1YIl9wMHZ65GaJR6HDj8Nm6F6PtL6UrHgmAhQrTMrti9zJqaDPW29XR0k wljEV6xkDcSwn9C5r2jZeMb2kjnKvEVoR4NlN5fD3atuAWwTB3Tf56xHqOAejXLTHCgO 3iMTB6DG6yoeUAMW+4HdxyQlVgMGSdERVCNrKr1u+SGe76STT+ZIyAPGkb10pGt3YsAT 18dQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w185si257879pfw.122.2018.12.12.16.46.35; Wed, 12 Dec 2018 16:46:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726457AbeLMAon (ORCPT + 99 others); Wed, 12 Dec 2018 19:44:43 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36260 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726359AbeLMAon (ORCPT ); Wed, 12 Dec 2018 19:44:43 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C20262D804; Thu, 13 Dec 2018 00:44:42 +0000 (UTC) Received: from redhat.com (ovpn-124-14.rdu2.redhat.com [10.10.124.14]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A117B5D70A; Thu, 13 Dec 2018 00:44:39 +0000 (UTC) Date: Wed, 12 Dec 2018 19:44:37 -0500 From: Jerome Glisse To: Dan Williams Cc: Jason Gunthorpe , Jan Kara , John Hubbard , Matthew Wilcox , John Hubbard , Andrew Morton , Linux MM , tom@talpey.com, Al Viro , benve@cisco.com, Christoph Hellwig , Christopher Lameter , "Dalessandro, Dennis" , Doug Ledford , Michal Hocko , Mike Marciniszyn , rcampbell@nvidia.com, Linux Kernel Mailing List , linux-fsdevel , "Weiny, Ira" Subject: Re: [PATCH 1/2] mm: introduce put_user_page*(), placeholder versions Message-ID: <20181213004437.GL5037@redhat.com> References: <20181208022445.GA7024@redhat.com> <20181210102846.GC29289@quack2.suse.cz> <20181212150319.GA3432@redhat.com> <20181212213005.GE5037@redhat.com> <20181212215348.GF5037@redhat.com> <20181212233703.GB2947@ziepe.ca> <20181213000109.GK5037@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 13 Dec 2018 00:44:43 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 12, 2018 at 04:18:33PM -0800, Dan Williams wrote: > On Wed, Dec 12, 2018 at 4:01 PM Jerome Glisse wrote: > > > > On Wed, Dec 12, 2018 at 04:37:03PM -0700, Jason Gunthorpe wrote: > > > On Wed, Dec 12, 2018 at 04:53:49PM -0500, Jerome Glisse wrote: > > > > > Almost, we need some safety around assuming that DMA is complete the > > > > > page, so the notification would need to go all to way to userspace > > > > > with something like a file lease notification. It would also need to > > > > > be backstopped by an IOMMU in the case where the hardware does not / > > > > > can not stop in-flight DMA. > > > > > > > > You can always reprogram the hardware right away it will redirect > > > > any dma to the crappy page. > > > > > > That causes silent data corruption for RDMA users - we can't do that. > > > > > > The only way out for current hardware is to forcibly terminate the > > > RDMA activity somehow (and I'm not even sure this is possible, at > > > least it would be driver specific) > > > > > > Even the IOMMU idea probably doesn't work, I doubt all current > > > hardware can handle a PCI-E error TLP properly. > > > > What i saying is reprogram hardware to crappy page ie valid page > > dma map but that just has random content as a last resort to allow > > filesystem to reuse block. So their should be no PCIE error unless > > hardware freak out to see its page table reprogram randomly. > > Hardware has a hard enough time stopping I/O to existing page let > alone switching to a new one in the middle of a transaction. This is a > non-starter, but it's also a non-concern because the bulk of DMA is > transient. For non-transient DMA there is a usually a registration > phase where the capability to support revocation can be validated, On many GPUs you can do that, it is hardware dependant and you have steps to take but it is something you can do (and GPU can do continuous DMA traffic have they have threads running that can do continuous memory access). So i assume that other hardware can do it too. Any revocation mechanism gonna be device/sub-system specific so it would probably be better to talk case by case and see what we can do. Like i said posted patches to remove GUP from GPUs driver, i am working on improving some core code to make those patches even simpler and i will keep pushing for that in subsystem i know. Maybe we should grep for GUP in drivers/ and start discussion within each sub-system to see what can be done within each. If any common pattern emerge we can draw up common plans for those at least. Cheers, J?r?me