Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6650010ybi; Sun, 21 Jul 2019 22:57:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqxkZSuTp/1F7+2RSTAYP8PrAlIxoqpjj+Y87zlM7/k+jRqhMyRJFnwom0rw26KzCtMEco69 X-Received: by 2002:a65:6846:: with SMTP id q6mr30966398pgt.150.1563775039907; Sun, 21 Jul 2019 22:57:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563775039; cv=none; d=google.com; s=arc-20160816; b=hA3y662mzfI3UXpwJnFoeqw1GLyML5myE9PWi3+x7TYPag9UvOTbfESslDTpuKQN8o VOugbyRqOLuL8ORQRI5zSVzeKlW3rthg5wvJyhV0esjnMlG54F8jq3/b4iqxLV9jz1he MFBfsXBv7Ngyei6mGxA77t/0yHb3hHv+P2Fmj0Z0jRNbUAnH3sOMJGQUugBhxmaUvfHI hoprggyrzvl+wupSDpL+F7xo2JOtvsztxMamAyL7vun4/7zRua9naTSItcedGDQ4QPtg dPPpX5BlI4VFx1JLaSKLX9ypp1XUpmWh0lYcgonQSsstfJh5XSFDHuF2kurpPYCjRaLb ws3A== 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; bh=n8hTk1m/h0M+XPFO8zjKXRqq0S+S9Y26PwMoPCxCNSc=; b=rCQ/J5IGP/2kf3AZkteCnqSDppMhAVyD3i9cbKOFMgUMEwoohZ3wkbv8x59topYtB/ glV23VpHO0Wf9jsCVEt2zkVQGgINe6ESKsrFRSTmxWbobNesPdSGJ8Ev0UtmSGAnUQgx q93nuuYiBbUwjUDFY4gTDQeyyOF2KFQoMoGmMWrmACA+0ly4nPnDvHuzjw38fAr1Ul+a 92BEqr3BodkphVCOGu+P5BG3PxooHm8exMFydklgZiJXTjyiHQbv2Cy28uhPN+FfudKo zeGI4+wNP/uDHogVXSfgslV8fWo760jZMJ0DWnZtBttqq2PdPk9SwpKyiC2Sh2L30tAm GBDw== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 65si9848072pfg.241.2019.07.21.22.57.03; Sun, 21 Jul 2019 22:57:19 -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; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726404AbfGVFNr (ORCPT + 99 others); Mon, 22 Jul 2019 01:13:47 -0400 Received: from mga09.intel.com ([134.134.136.24]:22296 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725795AbfGVFNr (ORCPT ); Mon, 22 Jul 2019 01:13:47 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Jul 2019 22:13:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,293,1559545200"; d="scan'208";a="344308827" Received: from iweiny-desk2.sc.intel.com ([10.3.52.157]) by orsmga005.jf.intel.com with ESMTP; 21 Jul 2019 22:13:45 -0700 Date: Sun, 21 Jul 2019 22:13:45 -0700 From: Ira Weiny To: Matthew Wilcox Cc: Ralph Campbell , linux-mm@kvack.org, linux-kernel@vger.kernel.org, John Hubbard , Vlastimil Babka , Christoph Lameter , Dave Hansen , =?iso-8859-1?B?Suly9G1l?= Glisse , "Kirill A . Shutemov" , Lai Jiangshan , Martin Schwidefsky , Pekka Enberg , Randy Dunlap , Andrey Ryabinin , Christoph Hellwig , Jason Gunthorpe , Andrew Morton , Linus Torvalds Subject: Re: [PATCH v2 1/3] mm: document zone device struct page field usage Message-ID: <20190722051345.GB6157@iweiny-DESK2.sc.intel.com> References: <20190719192955.30462-1-rcampbell@nvidia.com> <20190719192955.30462-2-rcampbell@nvidia.com> <20190721160204.GB363@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190721160204.GB363@bombadil.infradead.org> User-Agent: Mutt/1.11.1 (2018-12-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jul 21, 2019 at 09:02:04AM -0700, Matthew Wilcox wrote: > On Fri, Jul 19, 2019 at 12:29:53PM -0700, Ralph Campbell wrote: > > Struct page for ZONE_DEVICE private pages uses the page->mapping and > > and page->index fields while the source anonymous pages are migrated to > > device private memory. This is so rmap_walk() can find the page when > > migrating the ZONE_DEVICE private page back to system memory. > > ZONE_DEVICE pmem backed fsdax pages also use the page->mapping and > > page->index fields when files are mapped into a process address space. > > > > Restructure struct page and add comments to make this more clear. > > NAK. I just got rid of this kind of foolishness from struct page, > and you're making it harder to understand, not easier. The comments > could be improved, but don't lay it out like this again. Was V1 of Ralphs patch ok? It seemed ok to me. Ira > > > @@ -76,13 +76,35 @@ struct page { > > * avoid collision and false-positive PageTail(). > > */ > > union { > > - struct { /* Page cache and anonymous pages */ > > - /** > > - * @lru: Pageout list, eg. active_list protected by > > - * pgdat->lru_lock. Sometimes used as a generic list > > - * by the page owner. > > - */ > > - struct list_head lru; > > + struct { /* Page cache, anonymous, ZONE_DEVICE pages */ > > + union { > > + /** > > + * @lru: Pageout list, e.g., active_list > > + * protected by pgdat->lru_lock. Sometimes > > + * used as a generic list by the page owner. > > + */ > > + struct list_head lru; > > + /** > > + * ZONE_DEVICE pages are never on the lru > > + * list so they reuse the list space. > > + * ZONE_DEVICE private pages are counted as > > + * being mapped so the @mapping and @index > > + * fields are used while the page is migrated > > + * to device private memory. > > + * ZONE_DEVICE MEMORY_DEVICE_FS_DAX pages also > > + * use the @mapping and @index fields when pmem > > + * backed DAX files are mapped. > > + */ > > + struct { > > + /** > > + * @pgmap: Points to the hosting > > + * device page map. > > + */ > > + struct dev_pagemap *pgmap; > > + /** @zone_device_data: opaque data. */ > > + void *zone_device_data; > > + }; > > + }; > > /* See page-flags.h for PAGE_MAPPING_FLAGS */ > > struct address_space *mapping; > > pgoff_t index; /* Our offset within mapping. */ > > @@ -155,12 +177,6 @@ struct page { > > spinlock_t ptl; > > #endif > > }; > > - struct { /* ZONE_DEVICE pages */ > > - /** @pgmap: Points to the hosting device page map. */ > > - struct dev_pagemap *pgmap; > > - void *zone_device_data; > > - unsigned long _zd_pad_1; /* uses mapping */ > > - }; > > > > /** @rcu_head: You can use this to free a page by RCU. */ > > struct rcu_head rcu_head; > > -- > > 2.20.1 > > >