Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8952950imu; Tue, 4 Dec 2018 17:46:45 -0800 (PST) X-Google-Smtp-Source: AFSGD/XgbxvjyTLbzq1RaNVJe03MboITullnrGBDLpl6dYzWh4NOfbSI6KuI/hUxW/dyDILhgI68 X-Received: by 2002:a63:507:: with SMTP id 7mr17256348pgf.411.1543974405887; Tue, 04 Dec 2018 17:46:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543974405; cv=none; d=google.com; s=arc-20160816; b=VEggyyQ6roavqkxlGRRynDNycs3NYXCQqOMgINMPaPEFsZol/dNX1zqb8Sz+Tafhxh V4ypyGwSh1nCXWNvswHGqohsJZaIFTgsg+OCISIXRiIXM0hSkZcVuqcynq1woWG6+Mmx yvT7KEKeo7tXArS80rxK8E2/iVHvm0+2MMsbJo32t0f2q4e7RFJj+CkZLQ+HbKmBqgd/ XSZCDwX5xNUI+YvRMKPuj4PaAlRRTfIgNJcAdZ6uqbNRtjeY7asT6dKQtaOQGqDtmyAp IaWtdTV4bK5nmZ7hzxWo62yjHs4ynInk5Ek/aP1xVp9eMlMo4JFINRSD02ASb6ymJe4Q 4PZA== 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=giLF+AK/PeyEL4Kz8K+ZcVR0yuDivKMlu0Z9t5/3vLo=; b=zCAn8A17A4YbyxN+ZtoY/E+62I+I25C0x8BK58x3nJ3Tmp13c90cbnO8R4pqoi8kcR jgD9z+OuCiKb1bJyv6FpipGf0Tb3ceQtDEEbuuEt2sYv22LkUt2djsx35f4DAkQPNX5N oem3ii1iysGCE5DbOLVXoSnKZP/8/CU8o+pb5HWRgk3/uu7BmX93gqTnv3Eqmg2vyKZJ bD1s9apYcAAkbT8Mq9fLRqiDXM5B41lW21M5G6kNC+Yg4cQpRo+mUwEYtgXxnFwgN4/n LkZqw87MkRl4cFgg8BRbFyAbPB4f/P5CSoWBukx6xqX0iy7ktLTlbh8jIpqx5+R7Gpp0 9+qw== 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 p9si16358334pgc.448.2018.12.04.17.46.30; Tue, 04 Dec 2018 17:46:45 -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 S1726369AbeLEBor (ORCPT + 99 others); Tue, 4 Dec 2018 20:44:47 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55090 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725834AbeLEBor (ORCPT ); Tue, 4 Dec 2018 20:44:47 -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 7894665857; Wed, 5 Dec 2018 01:44:46 +0000 (UTC) Received: from redhat.com (ovpn-120-95.rdu2.redhat.com [10.10.120.95]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C331070388; Wed, 5 Dec 2018 01:44:43 +0000 (UTC) Date: Tue, 4 Dec 2018 20:44:41 -0500 From: Jerome Glisse To: Matthew Wilcox Cc: John Hubbard , Dan Williams , John Hubbard , Andrew Morton , Linux MM , Jan Kara , 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: <20181205014441.GA3045@redhat.com> References: <20181204001720.26138-1-jhubbard@nvidia.com> <20181204001720.26138-2-jhubbard@nvidia.com> <3c91d335-921c-4704-d159-2975ff3a5f20@nvidia.com> <20181205011519.GV10377@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20181205011519.GV10377@bombadil.infradead.org> 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.38]); Wed, 05 Dec 2018 01:44:46 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 04, 2018 at 05:15:19PM -0800, Matthew Wilcox wrote: > On Tue, Dec 04, 2018 at 04:58:01PM -0800, John Hubbard wrote: > > On 12/4/18 3:03 PM, Dan Williams wrote: > > > Except the LRU fields are already in use for ZONE_DEVICE pages... how > > > does this proposal interact with those? > > > > Very badly: page->pgmap and page->hmm_data both get corrupted. Is there an entire > > use case I'm missing: calling get_user_pages() on ZONE_DEVICE pages? Said another > > way: is it reasonable to disallow calling get_user_pages() on ZONE_DEVICE pages? > > > > If we have to support get_user_pages() on ZONE_DEVICE pages, then the whole > > LRU field approach is unusable. > > We just need to rearrange ZONE_DEVICE pages. Please excuse the whitespace > damage: > > +++ b/include/linux/mm_types.h > @@ -151,10 +151,12 @@ struct page { > #endif > }; > struct { /* ZONE_DEVICE pages */ > + unsigned long _zd_pad_2; /* LRU */ > + unsigned long _zd_pad_3; /* LRU */ > + unsigned long _zd_pad_1; /* uses mapping */ > /** @pgmap: Points to the hosting device page map. */ > struct dev_pagemap *pgmap; > unsigned long hmm_data; > - unsigned long _zd_pad_1; /* uses mapping */ > }; > > /** @rcu_head: You can use this to free a page by RCU. */ > > You don't use page->private or page->index, do you Dan? page->private and page->index are use by HMM DEVICE page. Cheers, J?r?me