From: jglisse@redhat.com
To: linux-mm@kvack.org
Cc: linux-kernel@vger.kernel.org,
"Jérôme Glisse" <jglisse@redhat.com>,
"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>
Subject: [PATCH] mm/hmm: struct hmm is only use by HMM mirror functionality
Date: Thu, 24 Aug 2017 20:42:26 -0400 [thread overview]
Message-ID: <1503621746-17876-1-git-send-email-jglisse@redhat.com> (raw)
In-Reply-To: <20170824230850.1810408-1-arnd@arndb.de>
From: JA(C)rA'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.
Signed-off-by: JA(C)rA'me Glisse <jglisse@redhat.com>
Cc: 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 | 7 +++----
mm/hmm.c | 4 +---
2 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/include/linux/hmm.h b/include/linux/hmm.h
index 5866f31..b4355d7 100644
--- a/include/linux/hmm.h
+++ b/include/linux/hmm.h
@@ -499,7 +499,7 @@ struct hmm_device *hmm_device_new(void *drvdata);
void hmm_device_put(struct hmm_device *hmm_device);
#endif /* CONFIG_DEVICE_PRIVATE || CONFIG_DEVICE_PUBLIC */
-
+#if IS_ENABLED(CONFIG_HMM_MIRROR)
/* Below are for HMM internal use only! Not to be used by device driver! */
void hmm_mm_destroy(struct mm_struct *mm);
@@ -507,12 +507,11 @@ static inline void hmm_mm_init(struct mm_struct *mm)
{
mm->hmm = NULL;
}
-
-#else /* IS_ENABLED(CONFIG_HMM) */
-
+#else /* IS_ENABLED(CONFIG_HMM_MIRROR) */
/* Below are for HMM internal use only! Not to be used by device driver! */
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 3faa4d4..7e4f42b 100644
--- a/mm/hmm.c
+++ b/mm/hmm.c
@@ -43,7 +43,7 @@ DEFINE_STATIC_KEY_FALSE(device_private_key);
EXPORT_SYMBOL(device_private_key);
-#ifdef CONFIG_HMM
+#if IS_ENABLED(CONFIG_HMM_MIRROR)
static const struct mmu_notifier_ops hmm_mmu_notifier_ops;
/*
@@ -128,9 +128,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.7.5
--
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 prev parent reply other threads:[~2017-08-25 0:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-24 23:08 [PATCH] mm: HMM always needs MMU_NOTIFIER Arnd Bergmann
2017-08-25 0:42 ` jglisse [this message]
2017-08-25 20:01 ` [PATCH] mm/hmm: struct hmm is only use by HMM mirror functionality 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=1503621746-17876-1-git-send-email-jglisse@redhat.com \
--to=jglisse@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=arnd@arndb.de \
--cc=ebaskakov@nvidia.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;
as well as URLs for NNTP newsgroup(s).