Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1720428

[PATCH] mm/hmm: struct hmm is only use by HMM mirror functionality v2

Path csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From jglisse@redhat.com
Newsgroups linux.kernel
Subject [PATCH] mm/hmm: struct hmm is only use by HMM mirror functionality v2
Date Fri, 25 Aug 2017 23:40:02 +0200
Message-ID <uiuuC-Rx-29@gated-at.bofh.it> (permalink)
X-Original-To linux-mm@kvack.org
Dmarc-Filter OpenDMARC Filter v1.3.2 mx1.redhat.com 535397EA9D
Authentication-Results ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
Authentication-Results ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jglisse@redhat.com
MIME-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 8bit
X-Scanned-By MIMEDefang 2.79 on 10.5.11.12
X-Greylist Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 25 Aug 2017 21:31:36 +0000 (UTC)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 80
Organization linux.* mail to news gateway
X-Original-Cc linux-kernel@vger.kernel.org, Jérôme Glisse <jglisse@redhat.com>, Andrew Morton <akpm@linux-foundation.org>, Stephen Rothwell <sfr@canb.auug.org.au>, Subhash Gutti <sgutti@nvidia.com>, Evgeny Baskakov <ebaskakov@nvidia.com>
X-Original-Date Fri, 25 Aug 2017 17:31:33 -0400
X-Original-Message-ID <20170825213133.27286-1-jglisse@redhat.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1720428

Show key headers only | View raw


From: Jérôme Glisse <jglisse@redhat.com>

The struct hmm is only use if the HMM mirror functionality is enabled
move associated code behind CONFIG_HMM_MIRROR to avoid build error if
one enable some of the HMM memory configuration without the mirror
feature.

Changed since v1:
  - make it clear that it replace Arnd patch
  - make sure it apply on top of lastest mm

Signed-off-by: Jérôme Glisse <jglisse@redhat.com>
Reported-by: Arnd Bergmann <arnd@arndb.de>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Cc: Stephen Rothwell <sfr@canb.auug.org.au>,
Cc: Subhash Gutti <sgutti@nvidia.com>,
Cc: Evgeny Baskakov <ebaskakov@nvidia.com>
---
 include/linux/hmm.h | 8 ++++----
 mm/hmm.c            | 7 +++----
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/include/linux/hmm.h b/include/linux/hmm.h
index 5866f3194c26..9583d9a15f9c 100644
--- a/include/linux/hmm.h
+++ b/include/linux/hmm.h
@@ -501,18 +501,18 @@ void hmm_device_put(struct hmm_device *hmm_device);
 
 
 /* Below are for HMM internal use only! Not to be used by device driver! */
+#if IS_ENABLED(CONFIG_HMM_MIRROR)
 void hmm_mm_destroy(struct mm_struct *mm);
 
 static inline void hmm_mm_init(struct mm_struct *mm)
 {
 	mm->hmm = NULL;
 }
-
-#else /* IS_ENABLED(CONFIG_HMM) */
-
-/* Below are for HMM internal use only! Not to be used by device driver! */
+#else /* IS_ENABLED(CONFIG_HMM_MIRROR) */
 static inline void hmm_mm_destroy(struct mm_struct *mm) {}
 static inline void hmm_mm_init(struct mm_struct *mm) {}
+#endif /* IS_ENABLED(CONFIG_HMM_MIRROR) */
+
 
 #endif /* IS_ENABLED(CONFIG_HMM) */
 #endif /* LINUX_HMM_H */
diff --git a/mm/hmm.c b/mm/hmm.c
index 4a179a16ab10..cf9cf0db809e 100644
--- a/mm/hmm.c
+++ b/mm/hmm.c
@@ -41,11 +41,12 @@
  */
 DEFINE_STATIC_KEY_FALSE(device_private_key);
 EXPORT_SYMBOL(device_private_key);
-static const struct mmu_notifier_ops hmm_mmu_notifier_ops;
 #endif /* CONFIG_DEVICE_PRIVATE || CONFIG_DEVICE_PUBLIC */
 
 
-#ifdef CONFIG_HMM
+#if IS_ENABLED(CONFIG_HMM_MIRROR)
+static const struct mmu_notifier_ops hmm_mmu_notifier_ops;
+
 /*
  * struct hmm - HMM per mm struct
  *
@@ -128,9 +129,7 @@ void hmm_mm_destroy(struct mm_struct *mm)
 {
 	kfree(mm->hmm);
 }
-#endif /* CONFIG_HMM */
 
-#if IS_ENABLED(CONFIG_HMM_MIRROR)
 static void hmm_invalidate_range(struct hmm *hmm,
 				 enum hmm_update_type action,
 				 unsigned long start,
-- 
2.13.4

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH] mm/hmm: struct hmm is only use by HMM mirror functionality v2 jglisse@redhat.com - 2017-08-25 23:40 +0200

csiph-web