Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp339059ybi; Tue, 16 Jul 2019 21:33:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqxtnLxMJCFc/6eH8VHAlvvC212bKkGaq19rhWnPQBBfUSikv0hsD4itr/+QKHXFv3xf/BWP X-Received: by 2002:a17:902:44a4:: with SMTP id l33mr40369625pld.174.1563338037160; Tue, 16 Jul 2019 21:33:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563338037; cv=none; d=google.com; s=arc-20160816; b=LpfbAyPWmaITp+uAfGnd4/QVOv+z3Ama6ABi/C7h0+4vzGHRUek9lKpFiDSOaoCPfX ElEVXvnpTf7Oy33hjTO9dbYkY8RKVVkCLNcA5jIjdjmU3Q/XWWiw4UfiahbcWCai3ZSn 2J0i0zZlM/BhmEG6LBB79bkmm1SjDkl0Nycn06hD2tEcxoTbPvBIU4alpe8ba5Zu37T6 UsYS+fQDxcjjaLhU+qrbtwVWOPsI0EsITRV1dP350XDZdqvcJx1cj0sHfkXFRS9fphr4 Ggll56MeTgL4shcV+yJC1CcDd4q/dOo/hQ5lDiM/hcZF2i7f6YDjetjRT6fb5xVrwiVu EbYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=ukaqXZgt5ZM3Hss7HF/VcYbbn1bk3tRqOhq/W93Amps=; b=xGE6WxADEFOamivTBB0SkvBBY7phucTkeJIS4VGY+5P12pFb1QHflvWmU/w2Ud2EYE O+ye2lDGqteTipdljadf5Kg4fnjKyV1AiQ16kVXsIVjalo7L+INueWtEru7SwpDepiPA HGcG6pvzI8LC9fiypg4X1lQliCFWQAx4TJgIZmMvNB5g0wdzib56ODW0BtWqQHVkmz5B KuSqnlro1ik2ws1bBJPOfjVgS1IcdM0FSqdGrFwJ8KYqRmJfGh2qmbcSR2y0cnotOx5v yD/kIlalOGZjj/PKoX+MI/yvRNrezn2K+SUGbckkmhYszSn6wg6ERycaOGRVmeCiJkxa ZYJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=lrbv6UWo; 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=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e24si1640101pff.125.2019.07.16.21.33.40; Tue, 16 Jul 2019 21:33:57 -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=@nvidia.com header.s=n1 header.b=lrbv6UWo; 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=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726207AbfGQEbl (ORCPT + 99 others); Wed, 17 Jul 2019 00:31:41 -0400 Received: from hqemgate15.nvidia.com ([216.228.121.64]:3194 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725799AbfGQEbk (ORCPT ); Wed, 17 Jul 2019 00:31:40 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate15.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Tue, 16 Jul 2019 21:31:46 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Tue, 16 Jul 2019 21:31:39 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Tue, 16 Jul 2019 21:31:39 -0700 Received: from [10.110.48.28] (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 17 Jul 2019 04:31:34 +0000 Subject: Re: [PATCH 1/3] mm: document zone device struct page reserved fields To: Christoph Hellwig CC: Ralph Campbell , , , , Vlastimil Babka , Christoph Lameter , Dave Hansen , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , "Kirill A . Shutemov" , Lai Jiangshan , Martin Schwidefsky , Pekka Enberg , Randy Dunlap , Andrey Ryabinin , Jason Gunthorpe , Andrew Morton , Linus Torvalds References: <20190717001446.12351-1-rcampbell@nvidia.com> <20190717001446.12351-2-rcampbell@nvidia.com> <26a47482-c736-22c4-c21b-eb5f82186363@nvidia.com> <20190717042233.GA4529@lst.de> X-Nvconfidentiality: public From: John Hubbard Message-ID: Date: Tue, 16 Jul 2019 21:31:33 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <20190717042233.GA4529@lst.de> X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL104.nvidia.com (172.18.146.11) To HQMAIL107.nvidia.com (172.20.187.13) Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1563337906; bh=ukaqXZgt5ZM3Hss7HF/VcYbbn1bk3tRqOhq/W93Amps=; h=X-PGP-Universal:Subject:To:CC:References:X-Nvconfidentiality:From: Message-ID:Date:User-Agent:MIME-Version:In-Reply-To: X-Originating-IP:X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=lrbv6UWohE3Xi/PabIIUYKG9FSQNWiFKQjPqnE/pkOIdjgkkZfYheIRH6zaQFKR56 /2aqF2iRMK863gnT6l80rJKAuB8nW49sP7+xIYllUgTDFfV2+hpRXUy2SJCM0etIQI OhdIbvsEmSEtRv4Kjgamt8OBRrDuhAZB6jX6foiEn5LOGmVcLiqhTG4M7O7FfrnoVB mdJE07HL20AKBlJWlWgNt+50sh4W3aOnuDu3oqVqAdcAxXwo/q92/muhCocih1rlHM YVpm3mczCFAWJcVLQvE3i3xEjXLx31utC87WbdTJGwYzMYNRmg9o2PL2HDnrXGSpsk loItmkeeipJaQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/16/19 9:22 PM, Christoph Hellwig wrote: > On Tue, Jul 16, 2019 at 06:20:23PM -0700, John Hubbard wrote: >>> - unsigned long _zd_pad_1; /* uses mapping */ >>> + /* >>> + * The following fields are used to hold the source >>> + * page anonymous mapping information while it is >>> + * migrated to device memory. See migrate_page(). >>> + */ >>> + unsigned long _zd_pad_1; /* aliases mapping */ >>> + unsigned long _zd_pad_2; /* aliases index */ >>> + unsigned long _zd_pad_3; /* aliases private */ >> >> Actually, I do think this helps. It's hard to document these fields, and >> the ZONE_DEVICE pages have a really complicated situation during migration >> to a device. >> >> Additionally, I'm not sure, but should we go even further, and do this on the >> other side of the alias: > > The _zd_pad_* field obviously are NOT used anywhere in the source tree. > So these comments are very misleading. If we still keep > using ->mapping, ->index and ->private we really should clean up the > definition of struct page to make that obvious instead of trying to > doctor around it using comments. > OK, so just delete all the _zd_pad_* fields? Works for me. It's misleading to calling something padding, if it's actually unavailable because it's used in the other union, so deleting would be even better than commenting. In that case, it would still be nice to have this new snippet, right?: diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index d6ea74e20306..c5ce5989d8a8 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -83,7 +83,12 @@ struct page { * by the page owner. */ struct list_head lru; - /* See page-flags.h for PAGE_MAPPING_FLAGS */ + /* + * See page-flags.h for PAGE_MAPPING_FLAGS. + * + * Also: the next three fields (mapping, index and + * private) are all used by ZONE_DEVICE pages. + */ struct address_space *mapping; pgoff_t index; /* Our offset within mapping. */ /** thanks, -- John Hubbard NVIDIA