From patchwork Fri May 4 18:33:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 10381373 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 B126C60541 for ; Fri, 4 May 2018 18:59:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A1BC2294EA for ; Fri, 4 May 2018 18:59:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 969C72954C; Fri, 4 May 2018 18:59:08 +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 46D8F29586 for ; Fri, 4 May 2018 18:59:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CDE506B0270; Fri, 4 May 2018 14:33:28 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id C8E846B0271; Fri, 4 May 2018 14:33:28 -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 BA42D6B0272; Fri, 4 May 2018 14:33:28 -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 77FC66B0270 for ; Fri, 4 May 2018 14:33:28 -0400 (EDT) Received: by mail-pf0-f198.google.com with SMTP id s3so17970180pfh.0 for ; Fri, 04 May 2018 11:33:28 -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=hz0IqUEBGUsacY/SuvFSSmMTdvDh0XLEg+uW//K/ol8=; b=o+aBMgJbEquFWR5htbqoqng96HsnxyyqIMDndGKqcqBykMkU7J0UVrNldaHXPzJnWD 9XynKx+8Bf38XcpbsTAjX4JMC1KcUu91H1v2cDUOPMRbKRcFs1iZ68bYwwYrP1pZMc+C be7wObxGPws2Mdm6RdqwqtdXydZTdPEwezgMwHuH1cGRC47fivISWT5wxQAUN3IboPfl HUxFpHeh16ffnzSm3JcmwzAvAJ/xyg/Jm+VBuOL8ljqFKRVpdwxJEo4RvNTChtViw/2B rCCM3AvFcLMFJU3j4ChNxIa/VwWpW4tNTWmwoyvaPLs5CpzqEjN5aaOmZ1GucjZkY45r yplg== X-Gm-Message-State: ALQs6tCG1BBaZntwgB7aibL/ZkR7aWq5t9baQToD87nCKPIqo1O1h9BK ORAC/DcOvmxNjEcLk4jACtD4laysJDE3MkYJ2YmkrFgjDWCNuQ+MqgklMJD9YEjxVQv3R98r9Sb InplnZljDotcvpVuv44Jp+oSLI4cTnu3bfhFGpKJ22NomMEqOGHDchXjj97p72DvzgA== X-Received: by 2002:a65:668f:: with SMTP id b15-v6mr22584709pgw.183.1525458808080; Fri, 04 May 2018 11:33:28 -0700 (PDT) X-Google-Smtp-Source: AB8JxZok2B23yeo4LUif3oHXipjrj+0smQ+iub9KK2/IAzjngx8V6J+mWJFXwHLSJmXC8ssIBIhF X-Received: by 2002:a65:668f:: with SMTP id b15-v6mr22584678pgw.183.1525458807286; Fri, 04 May 2018 11:33:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525458807; cv=none; d=google.com; s=arc-20160816; b=G2izV1ku37E6Vx1iSIbu0lBPGRk6PObV85KBkYY0x0vRwJWWsS6/jZWWtlb8KnB3+j W2HLO8OTsi9tF5JEiaxErauaw76O9Dtx3vO4F9j55wfDAxnkGqRbvbVj0p4zlKZN6PIr V/hS6CRv9nJhAPYETtQBFCWJEuwum+FdO6EiCCSJt4X9rEkqoEJCy/kEHKRt98i0S10C KraWOksPfBUuD+XdrINwTj9Lk4aOPmrbYURxoCmLL79W0ZL6CNjtt5Vdks3/dvsT5gVt NTV2jptjYRmi/Y6ud5I2N6YLMOIjjqisN0flPs1l9r2HdzGlaWldvEhBBouTe4qQmZuu 29Xw== 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=hz0IqUEBGUsacY/SuvFSSmMTdvDh0XLEg+uW//K/ol8=; b=qnCjyffRqnNxxIAinYfeEff8gjizrieyuLnNYg3QWJ3d3Gu4nurCSV3pzu9SsbZMT6 4OFcz2whlVRFAhgAZCZFtVkZVHr8Y6T5iGUL3ao8uuB6etdTaRS00cTtbCffZkrRZz7R 4bJrWgCVd6dPKhBZWzg+pg/+alNiNcoHOgp053KnPy68t4QwycnZwljK31HyWjCBOHFw XqEBTOYZaya1Yb/txobX5tKw9CYYW3lU7mlsezSQBlkRSYm21yh3Vy4rAGJcEReo5fV/ mhIhNMXB5CxHf4L/I2H2Obn9jEhxg/1pn5L6ajodOdZzSx0v+aslBK6Svy466xI9WcEs EF9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20170209 header.b=QjcyRtRF; 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 e92-v6si16325724pld.16.2018.05.04.11.33.27 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 04 May 2018 11:33:27 -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=QjcyRtRF; 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=hz0IqUEBGUsacY/SuvFSSmMTdvDh0XLEg+uW//K/ol8=; b=QjcyRtRFOCE+HmLrUJUiwcm7L E7gvD2pEsYeBdgq736UoT5ANPcHkjucZh+IKaE0gEP4G5ZsSV4q91Q1JEN/hWR2kwSYp861N13aL0 N0YfOz3JoOJgAxFXQ5+Y6pzz0Fw6BjpvQmoYu24pakdLuKhOUG83Wut0nd+xHtAo/5w1hLS5M+LhM QFuMFzHYhxZ5OrC1C+vokZhHKI1pMopH1YXEMjoMi6gyidwihkUxTz+DFqp8UlmfKUUDe2Mw7zVV7 d4QBAMHK/521vOF6rOL6P4DSXPGAZNVqEcsc8K6ITGGpweUObs48YhLAhZS+zszC/CegvqArzJIOy 4HovsWPWQ==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fEfWI-0003nh-3u; Fri, 04 May 2018 18:33:26 +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 13/17] mm: Add hmm_data to struct page Date: Fri, 4 May 2018 11:33:14 -0700 Message-Id: <20180504183318.14415-14-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 Make hmm_data an explicit member of the struct page union. Signed-off-by: Matthew Wilcox --- include/linux/hmm.h | 8 ++------ include/linux/mm_types.h | 14 +++++++++----- 2 files changed, 11 insertions(+), 11 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 5a519279dcd5..fa05e6ca31ed 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -150,11 +150,15 @@ struct page { /** @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; + struct { + /** + * @pgmap: For ZONE_DEVICE pages, this points to the + * hosting device page map. + */ + struct dev_pagemap *pgmap; + unsigned long hmm_data; + unsigned long _zd_pad_1; /* uses mapping */ + }; }; union { /* This union is 4 bytes in size. */