Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4093932ybi; Fri, 19 Jul 2019 14:52:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqzv7F55T1WQ9aS4HwPgxKWYv5HS+Er86iFQ0dfmdWkDiUBsCkJ9aUOcLqzcnfuz5aqwEpAL X-Received: by 2002:a17:90a:8c06:: with SMTP id a6mr61321339pjo.45.1563573170822; Fri, 19 Jul 2019 14:52:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563573170; cv=none; d=google.com; s=arc-20160816; b=EouHbEQMr5XZq3UZEaX1pBCka+rcGxP/Xnotl/sHwoHg2yzINXITT8JsZo3Yqc881b khK34xIFHftu0CsLZDX2rQELvv1WDpDqxQkFtsWdrYVyQjOQu1/YXBeM8tTVPG0gI5/2 4+0npu5ebGbyaQbr038R3L4SvX4QRnJi4knhflFWUAxw8DK2Z6aS5scg9yVgpb9rLHdt x6YVxevf8D1qfwm4n1DML+MXoeC7hGalm3ttM2P71bTlWllv3N8yjMEBafDUCXkeuYs4 CYhLuj4asNrkNcncS3RmODPxMH9pnyCLPVeHCSEj1d+ADsBYHmP19YXe6qdK61uvyuEG yKTw== 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 :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=n97TMr2JNhrSZ7vCgIqLLYdPmnZDRy5pEGPbgjYfhkI=; b=pPvy9pHniLhUxJkS54FwV5FE/TkjOEy5tIxR8ajYK71eOrRYRQgZi/52tMQ6Mek2wd CfA7bOnwBEZZo+ipdUD8RV4iCAJwDdGDIMUPEYX8FK8fZFYFRs/4Q820j41shFZBZnze rePYXuaX8FHZIW0r1yve94KsXO54nF9JmxHqfQxsgQ5eKJKLJPvQP4TeB4Qr49Xxjrfk qxlZlwCmKDhBSJOcfCbyG08VHiN/2QSRWuBpzcZ6hJ3bLOR6K2hgKE+7c5GWPrx5uwc5 Sy7171BmJGZdwonqMNFKm6WStsXc5DoQazaRMt//3AJBZdDhsZ9JVceXxE8iStcw1T4y mQmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=XEXD8+Mp; 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 b93si1944201plb.11.2019.07.19.14.52.35; Fri, 19 Jul 2019 14:52:50 -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=XEXD8+Mp; 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 S1732452AbfGSTHF (ORCPT + 99 others); Fri, 19 Jul 2019 15:07:05 -0400 Received: from hqemgate14.nvidia.com ([216.228.121.143]:11160 "EHLO hqemgate14.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728164AbfGSTHE (ORCPT ); Fri, 19 Jul 2019 15:07:04 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate14.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Fri, 19 Jul 2019 12:07:04 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Fri, 19 Jul 2019 12:07:03 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Fri, 19 Jul 2019 12:07:03 -0700 Received: from HQMAIL111.nvidia.com (172.20.187.18) by HQMAIL106.nvidia.com (172.18.146.12) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 19 Jul 2019 19:07:03 +0000 Received: from HQMAIL107.nvidia.com (172.20.187.13) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 19 Jul 2019 19:07:00 +0000 Received: from hqnvemgw01.nvidia.com (172.20.150.20) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Fri, 19 Jul 2019 19:07:00 +0000 Received: from rcampbell-dev.nvidia.com (Not Verified[10.110.48.66]) by hqnvemgw01.nvidia.com with Trustwave SEG (v7,5,8,10121) id ; Fri, 19 Jul 2019 12:07:00 -0700 From: Ralph Campbell To: CC: , Ralph Campbell , Matthew Wilcox , Vlastimil Babka , Christoph Lameter , Dave Hansen , =?UTF-8?q?J=C3=A9r=C3=B4me=20Glisse?= , "Kirill A . Shutemov" , Lai Jiangshan , Martin Schwidefsky , "Pekka Enberg" , Randy Dunlap , "Andrey Ryabinin" , Christoph Hellwig , "Jason Gunthorpe" , Andrew Morton , Linus Torvalds Subject: [PATCH 1/3] mm: document zone device struct page reserved fields Date: Fri, 19 Jul 2019 12:06:47 -0700 Message-ID: <20190719190649.30096-2-rcampbell@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190719190649.30096-1-rcampbell@nvidia.com> References: <20190719190649.30096-1-rcampbell@nvidia.com> MIME-Version: 1.0 X-NVConfidentiality: public Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1563563224; bh=n97TMr2JNhrSZ7vCgIqLLYdPmnZDRy5pEGPbgjYfhkI=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:X-NVConfidentiality: Content-Type:Content-Transfer-Encoding; b=XEXD8+MpeZa8W8p+pE1zOfZ44fRxNZfhiDWMcWxGdu0UuRY6HiaEZ343XnQhe8G9l plFxe13YRg7+09Pz3X/2r5ztqQ7vDggzGl7dYEf2qZhHAFEEIdiXXDfJIM11GZaBXD 8Sn/eycEEMOXvMVmcYByNs3x4Hgc294+XGXs2WN7VREX6SoSERQlIZ2kWAFpsBezK1 2qPKW/Tai815rjsLCrsQlfRNce4ANwWohy9W95HfonwFgt6rH/hFQ5j/SDdTFdiNVN fyGTBqmwrAFuong+CNyxx6UPxHoDak9BCXrLSaPipZ+8bknLhdkw5Dh6BPDewv6qoB LscjOGnASY84g== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Struct page for ZONE_DEVICE private pages uses the reserved fields when anonymous pages are migrated to device private memory. This is so the page->mapping and page->index fields are preserved and the page can be migrated back to system memory. Document this in comments so it is more clear. Signed-off-by: Ralph Campbell Cc: Matthew Wilcox Cc: Vlastimil Babka Cc: Christoph Lameter Cc: Dave Hansen Cc: J=C3=A9r=C3=B4me Glisse Cc: "Kirill A . Shutemov" Cc: Lai Jiangshan Cc: Martin Schwidefsky Cc: Pekka Enberg Cc: Randy Dunlap Cc: Andrey Ryabinin Cc: Christoph Hellwig Cc: Jason Gunthorpe Cc: Andrew Morton Cc: Linus Torvalds --- include/linux/mm_types.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 3a37a89eb7a7..d6ea74e20306 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -159,7 +159,14 @@ struct page { /** @pgmap: Points to the hosting device page map. */ struct dev_pagemap *pgmap; void *zone_device_data; - 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 */ }; =20 /** @rcu_head: You can use this to free a page by RCU. */ --=20 2.20.1