Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3072737imu; Mon, 17 Dec 2018 12:49:11 -0800 (PST) X-Google-Smtp-Source: AFSGD/UVLEjDQw51qPFKngWvWhls04LQpQUFaRGNV7SUPtt4qzAuEc96zgqBolfY3EOF+cDCOAz/ X-Received: by 2002:a62:4549:: with SMTP id s70mr13880879pfa.233.1545079751401; Mon, 17 Dec 2018 12:49:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545079751; cv=none; d=google.com; s=arc-20160816; b=dtgWfX6S7G+KjnWGQUSG2Dw7zIrJgaSfSfiB2pDJ5MdvtIcpHT5SEcvPKSX8JuY2EO aHKF3ilj0o2kb3Exc/sJ9ljdfUMxucRYXIE30IVwFylZRRMrIG+GuGgAgY4ynN8md2iI xxAc0l9hyI+10Zh5V8550oOmBdNCdJESx+hrEjO2G5XBj68Se2QvziiZY4nsOjFvzD3V gEiKA7mIchtQqwTz5U/XUnxFQeZoJi/dvFaGnfRXD5AQHJPdlOLBOZPbWge9tomIeQBR 7kmR5xliz/k8S7VN+k9lzVGBlb1uIQlU8fXxq+0n+5QmEalIwj17QRhLDPufSxJkqY/N kCDQ== 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-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=yYuUKtPqNzf0rYMCQlFGCXydmIl4+kyjpeJSfCXAs+k=; b=pVMFq3cyvKp9B+v78uIrCBU0h2w/2cvNmtLqcGzlYF//09TTIQ91F1K5eyb9Rx03FJ N1Ly9sIdxAd4/X+9A5mZ6MlmQ179KrxUq+/8SvdUq41Y64ErtpLMYOtTIW7neGjsGyMD d+AQxTT6iZEzYkuSdCjk9I3rlWGVM0PG4w2PiUIdqH2xbFXoEnqAsYzNHeCvywVbmllB IjQMC/PLnOp0R9MP+/TUtAXTBpj8WWiEUYEtGbc4buMIjLbdPDG/uEkoghq+d5AY80bA 0b+l9JzGDKk6rpqD+YVAs0t2HGQZ5uzfpaeF3GUH3K8dUQXDUx3W4sTBEfzXYbJbqqrB WPSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=INMDhYmU; 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 t74si11874979pgc.150.2018.12.17.12.48.56; Mon, 17 Dec 2018 12:49:11 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=INMDhYmU; 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 S2388715AbeLQT7a (ORCPT + 99 others); Mon, 17 Dec 2018 14:59:30 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:34630 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732626AbeLQT73 (ORCPT ); Mon, 17 Dec 2018 14:59:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=yYuUKtPqNzf0rYMCQlFGCXydmIl4+kyjpeJSfCXAs+k=; b=INMDhYmUufooanLhcpP7bZe0O apew/fFePpE6mppsGIFU5QULl+aHTVcMONq9WRN8EQvj3ri6VNOQltVDX2EM7qXdhdMps/rsQK12i QeCIfWhTIJp03GamX5adn8pc0O+0CxEouPQkvK/OyGDI2BSc7ztkLxe+uJEe8kK6RMbIP5aMbl1Vd HcslZDhMwOMP+jxQHKRPDUGlQEY2bvLD2HGFnyvsKZTLKLsVBYr7rmwdLkT4ptOm80Kp07JZzdC4J dLJ+rmEgO0StIvgbuQ+cn+0k3CIcvFbqRRwpKnkUwePLQF9B7alFu/ET+onCJY0NuSe7uU6jTKEjh uG+3U5NgA==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1gYz2w-0005On-Bb; Mon, 17 Dec 2018 19:59:22 +0000 Date: Mon, 17 Dec 2018 11:59:22 -0800 From: Matthew Wilcox To: Jerome Glisse Cc: Dave Chinner , Jan Kara , John Hubbard , Dan Williams , John Hubbard , Andrew Morton , Linux MM , tom@talpey.com, Al Viro , benve@cisco.com, Christoph Hellwig , Christopher Lameter , "Dalessandro, Dennis" , Doug Ledford , Jason Gunthorpe , Michal Hocko , mike.marciniszyn@intel.com, rcampbell@nvidia.com, Linux Kernel Mailing List , linux-fsdevel Subject: Re: [PATCH 1/2] mm: introduce put_user_page*(), placeholder versions Message-ID: <20181217195922.GQ10600@bombadil.infradead.org> References: <20181210102846.GC29289@quack2.suse.cz> <20181212150319.GA3432@redhat.com> <20181212214641.GB29416@dastard> <20181214154321.GF8896@quack2.suse.cz> <20181216215819.GC10644@dastard> <20181217181148.GA3341@redhat.com> <20181217183443.GO10600@bombadil.infradead.org> <20181217194759.GB3341@redhat.com> <20181217195150.GP10600@bombadil.infradead.org> <20181217195408.GC3341@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181217195408.GC3341@redhat.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 17, 2018 at 02:54:08PM -0500, Jerome Glisse wrote: > On Mon, Dec 17, 2018 at 11:51:51AM -0800, Matthew Wilcox wrote: > > On Mon, Dec 17, 2018 at 02:48:00PM -0500, Jerome Glisse wrote: > > > On Mon, Dec 17, 2018 at 10:34:43AM -0800, Matthew Wilcox wrote: > > > > No. The solution John, Dan & I have been looking at is to take the > > > > dirty page off the LRU while it is pinned by GUP. It will never be > > > > found for writeback. > > > > > > With the solution you are proposing we loose GUP fast and we have to > > > allocate a structure for each page that is under GUP, and the LRU > > > changes too. Moreover by not writing back there is a greater chance > > > of data loss. > > > > Why can't you store the hmm_data in a side data structure? Why does it > > have to be in struct page? > > hmm_data is not even the issue here, we can have a pincount without > moving things around. So i do not see the need to complexify any of > the existing code to add new structure and consume more memory for > no good reasons. I do not see any benefit in that. You said "we have to allocate a structure for each page that is under GUP". The only reason to do that is if we want to keep hmm_data in struct page. If we ditch hmm_data, there's no need to allocate a structure, and we don't lose GUP fast either.