Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp3234744imc; Wed, 13 Mar 2019 12:18:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqwkPHtpvZL8jnjXRYFdQecB/65zMG//+6bLzwtpCB68yqe2OWT7jm1Vn3aTKd08Gr7VU5X2 X-Received: by 2002:a17:902:b188:: with SMTP id s8mr27973035plr.327.1552504716948; Wed, 13 Mar 2019 12:18:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552504716; cv=none; d=google.com; s=arc-20160816; b=LPyrfDrKtQnL51QNSmBajGYee5F8jHMmCLLPoUjFIGI+puI2UsXPIO0osUIaD7L2Gh k29UH6wVWj9h3XOW7JHNBRIFxWVGuJSkwfPe1vjsgqKoKnu3jb6Sjl2HXxvSzUaIuoOW fvG5N22zfYHmtFZjFZERbrQy3eZazm3W09m0xhJrfkOPUzwv2CPEqTidZRG8n7XvZ+KF NFp2zJZsRvVIPnBKkLodWJ0ZxVklUnTNw8KZS5gOp4U7rTt8iV9tKFFStxBkwFA4fYPu Ugi6d26F4MlcVuWKoxFhlOegUSDg9J5Z2r/fT44Nj1JMfASpgY7kj3dRJBjQhWzMIr8t F0Jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:feedback-id:mime-version:user-agent :references:message-id:in-reply-to:subject:cc:to:from:date :dkim-signature; bh=nvIdXTvdBzRmRwQ0Wlhdqbz4+f72Q75prZrvS08u2DU=; b=yoXuuCtbudZNFA2oGYp9HQmrz4ew+Xv2yyi8MOkNA0G2m9dBv/DFGuoIU4KyMNY4ha Kg/IA4PSxfFnP7iZCr6zj2WDs4fxx5AJMYwdkvdo4IRg5k3IeTryMF99T+sKZyW0QKpJ JIS439EFGKEir98SpihYAqU39cJE9QD+Fa5aFGCArtpA+oSD7t/UNaD1okjQa+/0Ejq1 jiAio+vlUyLziNAVvBVya3Q4I0+caPhhMmPq5WZ4ebAmL7VBfZLIsnRaeaajgKmvCh2R 8/ScCebNRRMWFr+Y/A9MgHTQIA9NH8UYyVGs1paQ5K0wDVkH7n4AhrNMBjJUSKwncOED weCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazonses.com header.s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw header.b=mNs0GLwN; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m34si2887443pgl.139.2019.03.13.12.18.21; Wed, 13 Mar 2019 12:18:36 -0700 (PDT) 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; dkim=pass header.i=@amazonses.com header.s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw header.b=mNs0GLwN; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728814AbfCMTRC (ORCPT + 99 others); Wed, 13 Mar 2019 15:17:02 -0400 Received: from a9-35.smtp-out.amazonses.com ([54.240.9.35]:44142 "EHLO a9-35.smtp-out.amazonses.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727545AbfCMTQw (ORCPT ); Wed, 13 Mar 2019 15:16:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw; d=amazonses.com; t=1552504611; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:MIME-Version:Content-Type:Feedback-ID; bh=nvIdXTvdBzRmRwQ0Wlhdqbz4+f72Q75prZrvS08u2DU=; b=mNs0GLwNl9xKR1X8gnj67r8fWgIFpKPvdnFupmcR/v1TqCwF+zAL9fq7tlL4mJj1 prV0RUzPw/4sHohhMDsy7feO6rSMkyFpihUsF/I+bEn4+zKOiD6lv1BPOwb3WLblNoE 6eeLXu7iSI62MppM0eQYFX/LSlNl39r960DEmpQU= Date: Wed, 13 Mar 2019 19:16:51 +0000 From: Christopher Lameter X-X-Sender: cl@nuc-kabylake To: Jerome Glisse cc: john.hubbard@gmail.com, Andrew Morton , linux-mm@kvack.org, Al Viro , Christian Benvenuti , Christoph Hellwig , Dan Williams , Dave Chinner , Dennis Dalessandro , Doug Ledford , Ira Weiny , Jan Kara , Jason Gunthorpe , Matthew Wilcox , Michal Hocko , Mike Rapoport , Mike Marciniszyn , Ralph Campbell , Tom Talpey , LKML , linux-fsdevel@vger.kernel.org, John Hubbard Subject: Re: [PATCH v3 0/1] mm: introduce put_user_page*(), placeholder versions In-Reply-To: <20190312153528.GB3233@redhat.com> Message-ID: <01000169787c61d0-cbc5486e-960a-492f-9ac9-9f6a466efeed-000000@email.amazonses.com> References: <20190306235455.26348-1-jhubbard@nvidia.com> <010001695b4631cd-f4b8fcbf-a760-4267-afce-fb7969e3ff87-000000@email.amazonses.com> <20190308190704.GC5618@redhat.com> <01000169703e5495-2815ba73-34e8-45d5-b970-45784f653a34-000000@email.amazonses.com> <20190312153528.GB3233@redhat.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-SES-Outgoing: 2019.03.13-54.240.9.35 Feedback-ID: 1.us-east-1.fQZZZ0Xtj2+TD7V5apTT/NrT6QKuPgzCT/IC7XYgDKI=:AmazonSES Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 12 Mar 2019, Jerome Glisse wrote: > > > This has been discuss extensively already. GUP usage is now widespread in > > > multiple drivers, removing that would regress userspace ie break existing > > > application. We all know what the rules for that is. You are still misstating the issue. In RDMA land GUP is widely used for anonyous memory and memory based filesystems. *Not* for real filesystems. > > Because someone was able to get away with weird ways of abusing the system > > it not an argument that we should continue to allow such things. In fact > > we have repeatedly ensured that the kernel works reliably by improving the > > kernel so that a proper failure is occurring. > > Driver doing GUP on mmap of regular file is something that seems to > already have widespread user (in the RDMA devices at least). So they > are active users and they were never told that what they are doing > was illegal. Not true. Again please differentiate the use cases between regular filesystem and anonyous mappings. > > Well swapout cannot occur if the page is pinned and those pages are also > > often mlocked. > > I would need to check the swapout code but i believe the write to disk > can happen before the pin checks happens. I believe the event flow is: > map read only, allocate swap, write to disk, try to free page which > checks for pin. So that you could write stale data to disk and the GUP > going away before you perform the pin checks. Allocate swap is a separate step that associates a swap entry to an anonymous page. > They are other thing to take into account and that need proper page > dirtying, like soft dirtyness for instance. RDMA mapped pages are all dirty all the time. > Well RDMA driver maintainer seems to report that this has been a valid > and working workload for their users. No they dont. Could you please get up to date on the discussion before posting?