From patchwork Fri May 4 18:33:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 10381371 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C2FB060353 for ; Fri, 4 May 2018 18:59:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B29F12954C for ; Fri, 4 May 2018 18:59:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A736429572; Fri, 4 May 2018 18:59:07 +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=-2.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,T_DKIM_INVALID 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 45B0C29583 for ; Fri, 4 May 2018 18:59:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A09826B0275; Fri, 4 May 2018 14:33:37 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 987246B027A; Fri, 4 May 2018 14:33:37 -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 7608D6B0275; Fri, 4 May 2018 14:33:37 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg0-f70.google.com (mail-pg0-f70.google.com [74.125.83.70]) by kanga.kvack.org (Postfix) with ESMTP id 228B86B0278 for ; Fri, 4 May 2018 14:33:37 -0400 (EDT) Received: by mail-pg0-f70.google.com with SMTP id z6-v6so14214645pgu.20 for ; Fri, 04 May 2018 11:33:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references; bh=Vd79HlxXcdbVZ8rsmGDje6mFgAzxS5SDcDE77/9/8NU=; b=Vh9ZtyAAqxhtVZ2fwKM4NBKdANtV4VNSiOHXge7VLZaxYhz/QXRZUfn2/nagJCEANT bYEauMUgi0h1bJHtZb7WM/oQUigskLWTXP0Gs5gGMFXOh1JUDg1APNBgDIl8nSsfwJVC 5NNVfNKctnoem+kPWxFk97e3gDdD7Fk28fENtrmgFXOGXtCtiRTmA6FfTrsKmL5hrZX+ 2wpDVc3sH7d2RqD2RmNYAJvrGBATHxGtfehZ9kneP5a3UQDyRvj3603F7pV8sldtLGAo DYA82jsABr0jhwcHQfmG/3MWRa2m2Cmw368HIA8Kwsbrs42SGhoWXcUZBOD+x9eh7NNR piRg== X-Gm-Message-State: ALQs6tCkZIf9ydfT2QkxT5iQzRrqLPS0r2+dy5/URM7PjsI7BOAfBtvk tv68Ct3tSC9V+0yv5dJg+H8fxv8gldIsShBXsHoyr8OvHvUfXPQVYapHuk1FYiCaAvaa9KVMh+t /4ASBlAZAnDG88yPyrcv8K7Jdqd189L1SfGRWahUrdxSYQ9gcwAaQ0GYIdSsPqRHH+Q== X-Received: by 10.98.80.80 with SMTP id e77mr28205016pfb.16.1525458816806; Fri, 04 May 2018 11:33:36 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr5BYjpZA7SeE3Qm4c2WG5FCdwVEfjGoT8R+HonR0VacxgBzRoCIVPqt3t+E2MdQn5MDsd/ X-Received: by 10.98.80.80 with SMTP id e77mr28204616pfb.16.1525458806393; Fri, 04 May 2018 11:33:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525458806; cv=none; d=google.com; s=arc-20160816; b=KGYG0lUfevD9Zt0x0eqc0CuQJVQ7WNG0wg5cg7Wbt1kJARS5Q435TsrnEkEgZjn9Mc e5OspPRUSnbuE19TKGep9qPkYDL9KPSNEoxudRkPB+UHcq0lZedzonO2so+aO2ph7GmQ NXRHElMfcUZFIjCLEMjBK0qvKtnI41Q4slpqey9KOU+1AFJWwWRT27tsrqR9Wzyi3KQ5 F0Z6fS7d6lDjRwE68Bc62Bxb4O4p5IWtJUgFtbxZOiprdFeW39fqWs0xE2isiJshSDXV AUvOlEp/vNSEjFidrBU2/AJ8NTRmwnnekVkrrxi3Ou4oRHibB5YEa96Y+iX8TCB8Yfdf mWhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=Vd79HlxXcdbVZ8rsmGDje6mFgAzxS5SDcDE77/9/8NU=; b=PtFGzZhX1P2zk1IdPJ2ps5RR9qXjzVgXTB5sESAUCFT+xMwZM1suXO4M1k0DaCGSCr 12bIt25W3GZWWmOmUsbQyj8ljTNMI+1b5qXQBZv/3ClZ7nJpL7cqWCYsFpXEZnT5+O2p ypWK3aDP9JRTUu71Mcmhs1bfd6Y+vGF4HVfODht76J+LhcJWe0nanij/oFfo4qvaeOfS ch/etXumfPmzWbAXQ7PnB7VLv9dv9C94VeJHQFz3uWgvMZ83NdyNh1u2K0ZPBqaGWJrX AlLj1S/GmH1xsrg97itVLTdq5Tvl+n9UIMn9pFI3YnWveA601zONKLMy6V3XdDbjs273 nixQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20170209 header.b=utPjTWiC; spf=pass (google.com: best guess record for domain of willy@infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom=willy@infradead.org Received: from bombadil.infradead.org (bombadil.infradead.org. [2607:7c80:54:e::133]) by mx.google.com with ESMTPS id 6si16310510pft.35.2018.05.04.11.33.26 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 May 2018 11:33:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of willy@infradead.org designates 2607:7c80:54:e::133 as permitted sender) client-ip=2607:7c80:54:e::133; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20170209 header.b=utPjTWiC; spf=pass (google.com: best guess record for domain of willy@infradead.org designates 2607:7c80:54:e::133 as permitted sender) smtp.mailfrom=willy@infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Vd79HlxXcdbVZ8rsmGDje6mFgAzxS5SDcDE77/9/8NU=; b=utPjTWiCh4obaoNaFvMt10KuT 2Kc+jNX4Kmuk4bdHJg468vHTqpMaHpsWS+s2wg/AisQB4RFYrP3ufNQu2gmvVtz76GBQT+bTnTqwZ IZWA6LpD3qbyIE2TbqK+vRqonDUqzu+0MzJKinWDya6RH16kYEk9NL8uK8yi2AGEPVlefG4lbhme6 NqSBI3eg0Whc61SfwR5bFqhA+uFNGo1Vrl31a45rSe/IGD7fYUI3SKH5VfL59Z1m154MwIQNITqvN IGrm8RiIe1m4xxFCqkebHyNKp7Zsibnr1VGUiArpULjX2w/NTMLXw5vmAdzdR+dZ7CvZIdGcz6Gyx VW1r4IAmg==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fEfWH-0003nN-Ia; Fri, 04 May 2018 18:33:25 +0000 From: Matthew Wilcox To: linux-mm@kvack.org Cc: Matthew Wilcox , Andrew Morton , "Kirill A . Shutemov" , Christoph Lameter , Lai Jiangshan , Pekka Enberg , Vlastimil Babka , Dave Hansen , =?UTF-8?q?J=C3=A9r=C3=B4me=20Glisse?= Subject: [PATCH v5 12/17] mm: Add pt_mm to struct page Date: Fri, 4 May 2018 11:33:13 -0700 Message-Id: <20180504183318.14415-13-willy@infradead.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180504183318.14415-1-willy@infradead.org> References: <20180504183318.14415-1-willy@infradead.org> 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 From: Matthew Wilcox x86 overloads the page->index field to store a pointer to the mm_struct. Rename this to pt_mm so it's visible to other users. Signed-off-by: Matthew Wilcox Acked-by: Vlastimil Babka --- arch/x86/mm/pgtable.c | 5 ++--- include/linux/mm_types.h | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c index ffc8c13c50e4..938dbcd46b97 100644 --- a/arch/x86/mm/pgtable.c +++ b/arch/x86/mm/pgtable.c @@ -114,13 +114,12 @@ static inline void pgd_list_del(pgd_t *pgd) static void pgd_set_mm(pgd_t *pgd, struct mm_struct *mm) { - BUILD_BUG_ON(sizeof(virt_to_page(pgd)->index) < sizeof(mm)); - virt_to_page(pgd)->index = (pgoff_t)mm; + virt_to_page(pgd)->pt_mm = mm; } struct mm_struct *pgd_page_get_mm(struct page *page) { - return (struct mm_struct *)page->index; + return page->pt_mm; } static void pgd_ctor(struct mm_struct *mm, pgd_t *pgd) diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 90a6dbeeef11..5a519279dcd5 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -139,7 +139,7 @@ struct page { unsigned long _pt_pad_1; /* compound_head */ pgtable_t pmd_huge_pte; /* protected by page->ptl */ unsigned long _pt_pad_2; /* mapping */ - unsigned long _pt_pad_3; + struct mm_struct *pt_mm; #if ALLOC_SPLIT_PTLOCKS spinlock_t *ptl; #else