Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp1709113imc; Mon, 11 Mar 2019 21:52:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqwB1Hvqp48K5jkaRYyAiCEpemsf6wK2xV9AGdOvdgwPhwWhtWXamZJqAMnbTYZ9D0UBSgXp X-Received: by 2002:a17:902:54f:: with SMTP id 73mr37915356plf.210.1552366367679; Mon, 11 Mar 2019 21:52:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552366367; cv=none; d=google.com; s=arc-20160816; b=N0DX+Q10rDfUNER9HskjprXBKnCAyzsuVZxqCWdYNP/1E9kgieQ2scZs1y87EzoE+j 6P6yhrZQpJWTjW/tPrLO0lSfwtj0e3F1Yg8MMcF9fhslE6xoQPYDtMne/BpHZlCCHnqU x1+CMy+sQDMY0mWVGkNOa1caxjETiwAMO/5Q9SlLfA9dPd91T2EZrPrFHGYqxbdGTGUC c6Op9TnC7dK1QQYoQV4eb0h4Lt+CIyclHJasABrLl3TRgBpVqBt+MGyW9VOe622S5C1Z Pu8TG7aAsqrxFxjbhQ+uvGysuG9tAkAgE5VOFX3eKS4OC2JBp3gb7zwxHFw+Ol64WeCP RhSQ== 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=qK7Kkdb/luLy5flAaiCvdcEVBIH2RfSi6TODITDFLgA=; b=f4dTn+D1oTdp/zUvgOEVm6uH0wOJ61fPOmDLe0JleVD6uWgRJu12nBrrnYR9qPSTa/ cRJTynRulwtqUuU7QQCqVLe7LXevixbTvVObf5/xLBSVWsiCetgHZFnM+XmFb/vDDSZK 5DPpNJZSDLcE4y/PTybQjR1zDaZyEiwLG6LBv746ngmJGsRwfbiEwPI8+QLEyWpWyRb5 ANqfKf3N04gMZJZjY5lYgZ/pXEy/6Tm90RDUFEclf8yPvKVbZK5Ij0ZxI1sfFMZOmIJS j3lK6JZuR5OIvpu14dujV4kMD7qNiFFLuhcDXsE0GV+SuV2+mZokG17uEpM7uLZMzPJv oURg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazonses.com header.s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug header.b=dElPNkce; 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 24si6826940pgl.359.2019.03.11.21.52.29; Mon, 11 Mar 2019 21:52:47 -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=ug7nbtf4gccmlpwj322ax3p6ow6yfsug header.b=dElPNkce; 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 S1726542AbfCLEwI (ORCPT + 99 others); Tue, 12 Mar 2019 00:52:08 -0400 Received: from a9-99.smtp-out.amazonses.com ([54.240.9.99]:59870 "EHLO a9-99.smtp-out.amazonses.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725792AbfCLEwI (ORCPT ); Tue, 12 Mar 2019 00:52:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ug7nbtf4gccmlpwj322ax3p6ow6yfsug; d=amazonses.com; t=1552366327; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:MIME-Version:Content-Type:Feedback-ID; bh=qK7Kkdb/luLy5flAaiCvdcEVBIH2RfSi6TODITDFLgA=; b=dElPNkceskPXXplCyxkN3dRK3hqf46DyzKgPZ7kq+A9+qVfIrCUBt86RwQ9sawsh l/WOqpQNr7g2MIGzf2mgaad0g5o3koVlF16EgjpIcP5ROkP90TqcntjqBI+w1bPoYQe xcBj3TFY3yhzoc369I5gBAAaRilESZrIA3dLnEaI= Date: Tue, 12 Mar 2019 04:52:07 +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: <20190308190704.GC5618@redhat.com> Message-ID: <01000169703e5495-2815ba73-34e8-45d5-b970-45784f653a34-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> 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.12-54.240.9.99 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 Fri, 8 Mar 2019, Jerome Glisse wrote: > > > > It would good if that understanding would be enforced somehow given the problems > > that we see. > > 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. The applications that work are using anonymous memory and memory filesystems. I have never seen use cases with a real filesystem and would have objected if someone tried something crazy like that. 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. > > > In fact, the GUP documentation even recommends that pattern. > > > > Isnt that pattern safe for anonymous memory and memory filesystems like > > hugetlbfs etc? Which is the common use case. > > Still an issue in respect to swapout ie if anon/shmem page was map > read only in preparation for swapout and we do not report the page > as dirty what endup in swap might lack what was written last through > GUP. Well swapout cannot occur if the page is pinned and those pages are also often mlocked. > > > > Yes you now have the filesystem as well as the GUP pinner claiming > > authority over the contents of a single memory segment. Maybe better not > > allow that? > > This goes back to regressing existing driver with existing users. There is no regression if that behavior never really worked. > > Two filesystem trying to sync one memory segment both believing to have > > exclusive access and we want to sort this out. Why? Dont allow this. > > This is allowed, it always was, forbidding that case now would regress > existing application and it would also means that we are modifying the > API we expose to userspace. So again this is not something we can block > without regressing existing user. We have always stopped the user from doing obviously stupid and risky things. It would be logical to do it here as well.