From: Arnd Bergmann <arnd@arndb.de>
To: "Jérôme Glisse" <jglisse@redhat.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
Andrew Morton <akpm@linux-foundation.org>,
Stephen Rothwell <sfr@canb.auug.org.au>,
Subhash Gutti <sgutti@nvidia.com>,
Evgeny Baskakov <ebaskakov@nvidia.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: [PATCH] mm: HMM always needs MMU_NOTIFIER
Date: Fri, 25 Aug 2017 01:08:23 +0200 [thread overview]
Message-ID: <20170824230850.1810408-1-arnd@arndb.de> (raw)
When building a kernel with HMM enabled but without MMU_NOTIFIER,
we run into a build error:
mm/hmm.c:66:22: error: field 'mmu_notifier' has incomplete type
struct mmu_notifier mmu_notifier;
If I read this right, the dependency is correct, but the #ifdef
annotations in the mm/hmm.c are not. This changes them in
a way to make it all build cleanly.
Fixes: e4e0061ea15c ("mm/device-public-memory: device memory cache coherent with CPU")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
I did not try very hard to understand what the code is
supposed to do, please check if this makes sense beyond fixing
the build before applying.
---
mm/hmm.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/mm/hmm.c b/mm/hmm.c
index 4a179a16ab10..b9e9f14e7454 100644
--- a/mm/hmm.c
+++ b/mm/hmm.c
@@ -41,11 +41,16 @@
*/
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 */
+void hmm_mm_destroy(struct mm_struct *mm)
+{
+ kfree(mm->hmm);
+}
+
+#if IS_ENABLED(CONFIG_HMM_MIRROR)
+static const struct mmu_notifier_ops hmm_mmu_notifier_ops;
-#ifdef CONFIG_HMM
/*
* struct hmm - HMM per mm struct
*
@@ -124,13 +129,6 @@ static struct hmm *hmm_register(struct mm_struct *mm)
return mm->hmm;
}
-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.9.0
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next reply other threads:[~2017-08-24 23:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-24 23:08 Arnd Bergmann [this message]
2017-08-25 0:42 ` [PATCH] mm/hmm: struct hmm is only use by HMM mirror functionality jglisse
2017-08-25 20:01 ` Andrew Morton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170824230850.1810408-1-arnd@arndb.de \
--to=arnd@arndb.de \
--cc=akpm@linux-foundation.org \
--cc=ebaskakov@nvidia.com \
--cc=jglisse@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=sfr@canb.auug.org.au \
--cc=sgutti@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox