From patchwork Wed Jul 24 23:26:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ralph Campbell X-Patchwork-Id: 11057705 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B0C0B1398 for ; Wed, 24 Jul 2019 23:27:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9DB8F2893B for ; Wed, 24 Jul 2019 23:27:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9125B2893A; Wed, 24 Jul 2019 23:27:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E9A042893A for ; Wed, 24 Jul 2019 23:27:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4A7718E0018; Wed, 24 Jul 2019 19:27:16 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 432F68E0002; Wed, 24 Jul 2019 19:27:16 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 284478E0018; Wed, 24 Jul 2019 19:27:16 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-yw1-f72.google.com (mail-yw1-f72.google.com [209.85.161.72]) by kanga.kvack.org (Postfix) with ESMTP id EE9938E0002 for ; Wed, 24 Jul 2019 19:27:15 -0400 (EDT) Received: by mail-yw1-f72.google.com with SMTP id d18so35607994ywb.19 for ; Wed, 24 Jul 2019 16:27:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding:dkim-signature; bh=R7tBXQO9rPgjXDqjGz3N+EME0mRb0btVdpzxMZ8l/ZM=; b=APOZ+Lw39yHfIDKohjKbAuMg0jQRMvwnBNkQ6H9PSbh50VtRG5FgXHfvgqW/KbucmW UMgjdPFj8DAfHq70dazTicWo8aOlsalm/lPl8ObqEC+P9JenHChYXzxU2/fXTJ6PiUyJ SRYzYoAPviLT/IzWa/pWE64TsUWuShdN+VYige1DFXCyKrBh+yTAhPrVpZ0URx98URyu 8xybmJ9KNCXvopr87/1dPQgt8I9DGPE4nVpE7go4MqzPZ0HNFUvJBeeshceJL+w9P4JG 31LVFqcnj0K0PtLH5YfoEgoAKpvr3w1eQ2eb04ZksAcazRh5SXrgwypE7+ZgQsxhScdf sxmw== X-Gm-Message-State: APjAAAUP5hcWTnArGx3MrzJnl1WBJHll75tXuRKcrLLzT0s7lIbyCiX5 oVCOm2G7+fI/NUGZlzUe5pXTiskuiVyFYJ15NgWPr75ZbR3T2SjQyVPSvIqMMzSDYmb3NAxN0zl Du7awsVXnbarMelcKhx6hM9/zxyBkPJxvk0HTOHv4D2TjjzAKwXsMhWxWPP5QF4HOnQ== X-Received: by 2002:a0d:e60a:: with SMTP id p10mr48694026ywe.370.1564010835745; Wed, 24 Jul 2019 16:27:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqzO0u06OhGdOO2oLtl2dlrHWlRv22E8wYePXgXSqgHi4CGSKfecUc2gg2bg3JtHeBBeNy2f X-Received: by 2002:a0d:e60a:: with SMTP id p10mr48694002ywe.370.1564010835183; Wed, 24 Jul 2019 16:27:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564010835; cv=none; d=google.com; s=arc-20160816; b=GsfBV+e7OjoLbR8OCCibIWGpbhwxrdoYK/dEInvoMO8KAPegm4N76bZf0P55wX1QFB wPXsibd2CVXd+ISkBzisSVy0FQSze5N13DuV7aos38gFow6x/oPksVkLAMgujnQNkO1L dTJBNtDOlllcmF9HD9di7zSMdGt/+YaBjboQ4hsynXnVCfj0DudnU8b6OQCNIwClc1/z ODMRT2iR0RYnfVt3H9WrhDy4U6tAciXRSkbu4BTjxQyYAJA5nySMjFfzr+ZBateD88oa mXeZ2FuEjUp//VUzj2/G22ERzs0cSCJMDRtZ6JJ6du5JC4Dlmn1LN7ggchi8O7KTZVRf JD8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=dkim-signature:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from; bh=R7tBXQO9rPgjXDqjGz3N+EME0mRb0btVdpzxMZ8l/ZM=; b=VSnplsgxIh33I+u4OR4bS3pLxmuTM5HV0hBB6JcLdLGWbxTA87t/t6LWmyTEtLE1xg q2GYxuescJ3yMXT0K2lMhSByWgWhKHhQxj7VezxAFYmS4J2F5r2bLXKaMP8JErgtZ0uB r0T9nuBELRxVDRqutRonVeP8Lqwy0zMf1f2/Z2vIcKEbKEg7aQNNOFJqJ7kpMaldO00h vaJ69KyoGwJmhMo4Ko8Qtxo69LgilHZ3mJ9s9+UjBOVjDZ2yDhiDQun00Ybp/FX6FfE0 UwifJoVtkZcYBvLHoBbnqeJsksnURRpaB/Z4ExJAhgjm0/hBWtunWiXgvRsdhNdJqxV0 OxcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=kuNrmdut; spf=pass (google.com: domain of rcampbell@nvidia.com designates 216.228.121.143 as permitted sender) smtp.mailfrom=rcampbell@nvidia.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: from hqemgate14.nvidia.com (hqemgate14.nvidia.com. [216.228.121.143]) by mx.google.com with ESMTPS id l125si16518386ybl.374.2019.07.24.16.27.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Jul 2019 16:27:15 -0700 (PDT) Received-SPF: pass (google.com: domain of rcampbell@nvidia.com designates 216.228.121.143 as permitted sender) client-ip=216.228.121.143; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=kuNrmdut; spf=pass (google.com: domain of rcampbell@nvidia.com designates 216.228.121.143 as permitted sender) smtp.mailfrom=rcampbell@nvidia.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by hqemgate14.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Wed, 24 Jul 2019 16:27:14 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate102.nvidia.com (PGP Universal service); Wed, 24 Jul 2019 16:27:13 -0700 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Wed, 24 Jul 2019 16:27:13 -0700 Received: from HQMAIL105.nvidia.com (172.20.187.12) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 24 Jul 2019 23:27:08 +0000 Received: from hqnvemgw01.nvidia.com (172.20.150.20) by HQMAIL105.nvidia.com (172.20.187.12) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Wed, 24 Jul 2019 23:27:08 +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 ; Wed, 24 Jul 2019 16:27:07 -0700 From: Ralph Campbell To: CC: , Ralph Campbell , John Hubbard , Matthew Wilcox , Vlastimil Babka , Christoph Lameter , "Dave Hansen" , =?utf-8?b?SsOpcsO0bWUgR2xpc3Nl?= , "Kirill A . Shutemov" , Lai Jiangshan , Martin Schwidefsky , Pekka Enberg , Randy Dunlap , Andrey Ryabinin , Christoph Hellwig , Jason Gunthorpe , Andrew Morton , Linus Torvalds Subject: [PATCH v3 1/3] mm: document zone device struct page field usage Date: Wed, 24 Jul 2019 16:26:58 -0700 Message-ID: <20190724232700.23327-2-rcampbell@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190724232700.23327-1-rcampbell@nvidia.com> References: <20190724232700.23327-1-rcampbell@nvidia.com> MIME-Version: 1.0 X-NVConfidentiality: public DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1564010834; bh=R7tBXQO9rPgjXDqjGz3N+EME0mRb0btVdpzxMZ8l/ZM=; 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=kuNrmdutQu8OtJz0LkyZEgZtbgpSB31azxVA6IxHVhWwyekrrPMk35utH++IUUR0V ySZRHjTnQuRxkH0mSRZr0lRX8zjcwQo3cSTXfApyuOpwqFkqCoCiNAHnUNbMP3YhOs fvYiGYGvu8V9As7306izV/f8A7DsPZU0zIOSCCJa6mCtyaXg6gIRyFnjjzs13WYPWA +RuZoYfW0QBPbXhlmlgRYiiMtwtonS/EbKE7Gq9TxQbZtH0EPUSzQ1XJO4Adpk0SXl Wr32U6NJLVw+CC1G77WQ4pgNY01eGesQd/e/J1j5Yk22sCMPNUCHDfJLKSuGCaJAHh /9ROeBw+Xc+CA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP 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. Add comments to struct page and remove the unused "_zd_pad_1" field to make this more clear. Signed-off-by: Ralph Campbell Reviewed-by: John Hubbard Cc: Matthew Wilcox Cc: Vlastimil Babka Cc: Christoph Lameter Cc: Dave Hansen Cc: Jérôme 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 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 3a37a89eb7a7..6a7a1083b6fb 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -159,7 +159,16 @@ 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 */ + /* + * ZONE_DEVICE private pages are counted as being + * mapped so the next 3 words hold the mapping, index, + * and private fields from the source anonymous or + * page cache page while the page is migrated to device + * private memory. + * ZONE_DEVICE MEMORY_DEVICE_FS_DAX pages also + * use the mapping, index, and private fields when + * pmem backed DAX files are mapped. + */ }; /** @rcu_head: You can use this to free a page by RCU. */