From patchwork Fri May 18 19:45:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Matthew Wilcox (Oracle)" X-Patchwork-Id: 10412001 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 A85FB6031B for ; Fri, 18 May 2018 19:46:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9746328AAF for ; Fri, 18 May 2018 19:46:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8B99428ABA; Fri, 18 May 2018 19:46:57 +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 F36B228AAF for ; Fri, 18 May 2018 19:46:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 154ED6B0679; Fri, 18 May 2018 15:46:56 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 106016B067A; Fri, 18 May 2018 15:46:56 -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 F37D66B067B; Fri, 18 May 2018 15:46:55 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pl0-f72.google.com (mail-pl0-f72.google.com [209.85.160.72]) by kanga.kvack.org (Postfix) with ESMTP id B3F376B0679 for ; Fri, 18 May 2018 15:46:55 -0400 (EDT) Received: by mail-pl0-f72.google.com with SMTP id x32-v6so5612506pld.16 for ; Fri, 18 May 2018 12:46:55 -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=fEbtiOEOGlfqZgfeHU84ad2JxE3AP/qShxH7YDKIysk=; b=akFsXT3VZxxtPfmKye5blPcj2fANLeuH/VmnW2kdxhX/hIqaWKk1Ynrpr7Eew1v4TY mxRnhN3ietSkAzZ4agmQZ82jceOBOn0D+0Zfqyg4lbWa4iQRFv4Xhq+Aa5isgUyoSb4N eUf0Lrz70FluUjQvXrGilBGYXhptveFm6KVO6yiXvT8u4lHdqVxnnmsYzS7yP69BE5bQ 0XqM4l1jX4cXg4D7kixSJJnMOzAidccmf62BWTznb/zX+CgelvX2NuZfItcUPsrB38+N gizHb/DE3tCDPOhn2q/cAivcy3PjDfDKUfX6RvTuC+RulLeXqddcpnMND65L9iYpaDlS F0YA== X-Gm-Message-State: ALKqPwePnWSFvOuLgMjIgK9ySt03QTNHwpDyq33whFBXMbJxDGNERDEf 0DmZBNwiaY0Gbk0HHekbV4UbbqU53q6aTXFmzRVO0ClhPWTLf5DdpVDp+sbUPOoKvkD2bkJkSen noddMOXYCjgUwx3SemozJ82nFpZd6xWGxA6060cdNtyVJuxr74EWeRujFRcQKHEba7Q== X-Received: by 2002:a17:902:7d87:: with SMTP id a7-v6mr11136344plm.264.1526672815448; Fri, 18 May 2018 12:46:55 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrinph4MxzQjBWqCIRZ86ExR2gJZ30RRMy78QJlTu+iJZvgg4oDuXaWboyzgWIQB9owsvjw X-Received: by 2002:a17:902:7d87:: with SMTP id a7-v6mr11132905plm.264.1526672724233; Fri, 18 May 2018 12:45:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526672724; cv=none; d=google.com; s=arc-20160816; b=cUa3clKQGbXZxNVwlrZN2gM0SCrrS6Q0KX6aCwGqf+1aB+UI/+fQQUfzHGUQyNFrrR bxFETXKP01NHmLI7zLckBWQI+NCEZ8yC/X0ScIEeNrJQK0llu8KRJiNss8Zw4e6ajmoG /VMFL1nCF8bvI+ch3Chcj61P9jQYZLEAsWnkreeICTaZIn+kUwZPRIr+PYENZ1+JMALd jdI6alR/1JkNCuJNgfNnncV+/5hNdIHys6S34/+o6/SdNXC6cq/yw/HqoNB5QPmDcPVP IJJHKf7b6XVOii1pQLTpjfccOsWNJFKTkLRYtOO2Ol/B9HjOYvetbdKTsrMPXqgEk99f J5eA== 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=fEbtiOEOGlfqZgfeHU84ad2JxE3AP/qShxH7YDKIysk=; b=meyI8Cg0iQv/ONAX2i9Igk51z+KArDbR3LWm5h6PmUA3xVQVsDJabW2fICson2HGlO X0R1+Z9giNDaqXhZtTqFNA3zA34elBjRkH1p1Ffr1moA4CD3Z2CPA39Ohrcqd2IHk4QM RerjvqXxf9sl1rhfsXE/WM8VrrzpNU77/PH1VxdCsFtqARPF/9cWX8OrmSGWLnAk0utt v3xAw6tYVB9QyZjKWgUcsHaq2Il241vEH84rtwt4xPfa6RZFLBftDbpNBDihASaTPbaM 5k9X0L/yFAalXPOEQp3NRHvZFCXgFzP4+/imr4glwSxb8D0g7HWjP8q8GrfawmQKevnA 4Lvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20170209 header.b=V/zHUfID; 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 l11-v6si5170602pgp.426.2018.05.18.12.45.24 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 18 May 2018 12:45:24 -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=V/zHUfID; 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=fEbtiOEOGlfqZgfeHU84ad2JxE3AP/qShxH7YDKIysk=; b=V/zHUfID532+pwatXdhV2FqO9 QkIIQCA+qXk7dy3KRvVlBCktt2z3CFrXH7jwoBaPfz4/ygy3WcW5YqCNrpMmSZtfSh/CCOO5X8o2A fL3wpKv9Yq4vf1OdkOAMkD7GYZjRJYHNLYwGsX4H2yL6pa8DfAoHe8dvmxFHJQ+e8cguaaOMbFeBw QcLF1mWs4aLTDZ65d2yq1dgDFcD+KdVnjtRgeO7/Y5SF46kG6LHGpjakwOxBM07rm+YLhtG2zYOzM DIvSkG092FlkVY6LiXGNkdvpg8WXoUSAHKgTdXseXAXbP5WOuLv+C2iNhanqvZT77QcCz2spu+6A+ y6afUYENg==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fJlJb-00011i-MF; Fri, 18 May 2018 19:45:23 +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 v6 12/17] mm: Add pt_mm to struct page Date: Fri, 18 May 2018 12:45:14 -0700 Message-Id: <20180518194519.3820-13-willy@infradead.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180518194519.3820-1-willy@infradead.org> References: <20180518194519.3820-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 For pgd page table pages, 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..7eb7092424b7 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; /* x86 pgds only */ #if ALLOC_SPLIT_PTLOCKS spinlock_t *ptl; #else