From patchwork Fri May 18 19:45:15 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: 10412009 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 CCDE4602C2 for ; Fri, 18 May 2018 19:47:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BC1BA28ABD for ; Fri, 18 May 2018 19:47:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B0F0628ABF; Fri, 18 May 2018 19:47:31 +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 23A4328ABD for ; Fri, 18 May 2018 19:47:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D636E6B0680; Fri, 18 May 2018 15:47:29 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id D13C06B0682; Fri, 18 May 2018 15:47:29 -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 C03B26B0683; Fri, 18 May 2018 15:47:29 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf0-f198.google.com (mail-pf0-f198.google.com [209.85.192.198]) by kanga.kvack.org (Postfix) with ESMTP id 7C5D36B0680 for ; Fri, 18 May 2018 15:47:29 -0400 (EDT) Received: by mail-pf0-f198.google.com with SMTP id e20-v6so5298498pff.14 for ; Fri, 18 May 2018 12:47:29 -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=GF07c/kVLEdBFgp0ipukSUo+/WFvYVRUOUWWjHAW+3w=; b=VwIkICJ/9Wy61RRFNeJ8FqKDY6Nkw77NHgVMeFXCBD1goq3a6luuTme0DadzPImqoR YVlBhJj+Kzicz5OXDVNTbrEhHmUajL0bh9P2Cdu+OZfBB+w3oSOwJf/Exctebvv+w+Ed sxexx0/4l5iSIWMcSTCvPYK4kC6F63j94J8X4W71TEZKX8xONscNyqTEMncJFfQe7hsV 8S91Oa07n/prClJ9vHDBzda2sL9PC7d+T/pMhi5QtR2TYsaFiHEKPaimznZYqT299o0c PJly81IqSnRSpaJ/oaKus7+4X+jri/Nrswk7/yEWkCeB6Qd4vkTmEzn4gQYWekIHW5Mc X6PQ== X-Gm-Message-State: ALKqPwd8sD0h9scVu/WRhBso+6nW+syX0ugLtba73OKBP154VAx7u8MI 9fCkpn2jVe+u2KkET/dzZCfwQZo8odc63t7Xrcjv8W7PxmxecN7vXUh6Db4SNlbpzCkrEUkJRD4 1NrybmT4o6xyQzg/lLhVSNJ+/chAdXl7/SX/jVdZmJU5J/fLQTc1HPViKJ/Lg8GozDA== X-Received: by 2002:a62:9056:: with SMTP id a83-v6mr10699333pfe.186.1526672849202; Fri, 18 May 2018 12:47:29 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp6OUYkf2jrH09ugQSw5UA3BfQ89ihjHXr/568qd3xFMVns8Vp//qG+xDiaY2dYA6PSQZvP X-Received: by 2002:a62:9056:: with SMTP id a83-v6mr10694825pfe.186.1526672724525; 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=Vy2cQTp3C7xynaZuRfA4Bq/24tLmMAacvI6lZhuuAxb2bxkH5/el566W60o16PpVy4 8Ew51M85yehxzBObN3M+w3RZhmnKMvQpaRId36Jt5OwawxjMeb4q1EZatES0+YrrdypU 5INrlaf52qy9Zyx4LyMyuE4Muhhp+qOzcTIRLQyIjdWVbY0b4j+i3s4PvMzQddMDmp/b JNMqeowUdLaWB1iMJIl/6W6ki2q6B8fc2iAR+O32e5+/F684xGG8egNJLk8cy7//qPTR r/B0hlotd89qMKlT0llxnwT8IG9lWU4kMoBv0L0ETS41ywc9Wywkx1pr9qhL4E+SeuOb bkjQ== 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=GF07c/kVLEdBFgp0ipukSUo+/WFvYVRUOUWWjHAW+3w=; b=1Bcg5Ai3J5GZClA298cRitT//pyvB8pKglpWErRjegHMEioSKfxcZ1/HTcwmP++ox8 QDxSybG8uLr4PfdamK5Ex+h9jWlZdcjnfyFfJv9ac9EV8rIe85pze4t9mSGxDnHrPXes 8y7BWEXwOaKZ01krPC1c4MQ4zsYunUdRLmXg9WIn2jqSUHeLtmiMlZBVbVyUB9fC+g9N 1MSvWDs8rz14Xrnb0haGYmIKQuFBYsH6dZMjTEHAtZ1qMpmFenev12ZHU+1eg4rdYj3m +try5DzqEtJewKimgheWPzP3BZRn8XvyGKrELUbwC8+M2IWXYPdsySZePBosLOv4j6Mo pzeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20170209 header.b=StUqERs5; 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 w20-v6si1342287pgc.645.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=StUqERs5; 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=GF07c/kVLEdBFgp0ipukSUo+/WFvYVRUOUWWjHAW+3w=; b=StUqERs5rWa6VnNuEYYZ6GvUx 3SI3wuFYV7sjSesn1YIafOzSBLfrLt1QF2JG5bMD8sgB4nmjCJj/FPnTHH4uTrDthT0q670EJ+j8e O1I3SzJIqnAUKxuuTLAF8Ek9pAu3vyx3VawFivbCgbSxYi/Um3y968Gb3SdeBhunZho6dc1dNRyt6 pncT9d48fx/ddKJByL0i9TkN+K3ihKgReJenvvwqKCeDaAkdWyK4FFmhh/SH+vpz17PNYB6ACKZnY 4aZfcRwDnt4d+gO/Ei52ktkHLXRF1jWc3ua4HCDJP5rqntujAUxStobLmBmYhuTJvWHPbhPJu6bPk o/V9Tl9HA==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fJlJb-00011x-SW; 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 13/17] mm: Add hmm_data to struct page Date: Fri, 18 May 2018 12:45:15 -0700 Message-Id: <20180518194519.3820-14-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 Make hmm_data an explicit member of the struct page union. Signed-off-by: Matthew Wilcox Acked-by: Vlastimil Babka --- include/linux/hmm.h | 8 ++------ include/linux/mm_types.h | 12 ++++++------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/include/linux/hmm.h b/include/linux/hmm.h index 39988924de3a..91c1b2dccbbb 100644 --- a/include/linux/hmm.h +++ b/include/linux/hmm.h @@ -522,9 +522,7 @@ void hmm_devmem_remove(struct hmm_devmem *devmem); static inline void hmm_devmem_page_set_drvdata(struct page *page, unsigned long data) { - unsigned long *drvdata = (unsigned long *)&page->pgmap; - - drvdata[1] = data; + page->hmm_data = data; } /* @@ -535,9 +533,7 @@ static inline void hmm_devmem_page_set_drvdata(struct page *page, */ static inline unsigned long hmm_devmem_page_get_drvdata(const struct page *page) { - const unsigned long *drvdata = (const unsigned long *)&page->pgmap; - - return drvdata[1]; + return page->hmm_data; } diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 7eb7092424b7..530a9a2b039b 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -146,15 +146,15 @@ struct page { spinlock_t ptl; #endif }; + struct { /* ZONE_DEVICE pages */ + /** @pgmap: Points to the hosting device page map. */ + struct dev_pagemap *pgmap; + unsigned long hmm_data; + unsigned long _zd_pad_1; /* uses mapping */ + }; /** @rcu_head: You can use this to free a page by RCU. */ struct rcu_head rcu_head; - - /** - * @pgmap: For ZONE_DEVICE pages, this points to the hosting - * device page map. - */ - struct dev_pagemap *pgmap; }; union { /* This union is 4 bytes in size. */