From: David Howells <dhowells@redhat.com>
To: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Cc: dhowells@redhat.com, aarcange@redhat.com, torvalds@osdl.org,
akpm@linux-foundation.org, linux-mm@vger.kernel.org
Subject: KSM broken in the CONFIG_MMU=n case
Date: Wed, 16 Dec 2009 16:38:35 +0000 [thread overview]
Message-ID: <19082.1260981515@redhat.com> (raw)
Hi Hugh,
The KSM code is broken in the CONFIG_MMU=n case as enum ttu_flags is required,
but not defined. Simply predeclaring it doesn't help as the argument isn't a
pointer to a value of that type.
I've attached a patch below to deal with it; it's a bit messy, though, as the
fallback ksm_exit() is required in both the NOMMU and no-KSM cases.
David
---
From: David Howells <dhowells@redhat.com>
Subject: [PATCH] NOMMU: Fix KSM in the CONFIG_MMU=n case
Fix KSM in the CONFIG_MMU=n case:
In file included from kernel/fork.c:52:
include/linux/ksm.h:129: warning: 'enum ttu_flags' declared inside parameter list
include/linux/ksm.h:129: warning: its scope is only this definition or declaration, which is probably not what you want
include/linux/ksm.h:129: error: parameter 2 ('flags') has incomplete type
by making most of linux/ksm.h contingent on CONFIG_MMU=y. The fallback
version of ksm_exit() requires special handling as that is also used in the
MMU=y, KSM=n case.
Signed-off-by: David Howells <dhowells@redhat.com>
---
include/linux/ksm.h | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/include/linux/ksm.h b/include/linux/ksm.h
index bed5f16..7f1e1f0 100644
--- a/include/linux/ksm.h
+++ b/include/linux/ksm.h
@@ -16,6 +16,7 @@
struct stable_node;
struct mem_cgroup;
+#ifdef CONFIG_MMU
#ifdef CONFIG_KSM
int ksm_madvise(struct vm_area_struct *vma, unsigned long start,
unsigned long end, int advice, unsigned long *vm_flags);
@@ -105,10 +106,6 @@ static inline int ksm_fork(struct mm_struct *mm, struct mm_struct *oldmm)
return 0;
}
-static inline void ksm_exit(struct mm_struct *mm)
-{
-}
-
static inline int PageKsm(struct page *page)
{
return 0;
@@ -141,5 +138,12 @@ static inline void ksm_migrate_page(struct page *newpage, struct page *oldpage)
{
}
#endif /* !CONFIG_KSM */
+#endif /* CONFIG_MMU */
+
+#if !defined(CONFIG_MMU) || !defined(CONFIG_KSM)
+static inline void ksm_exit(struct mm_struct *mm)
+{
+}
+#endif
#endif /* __LINUX_KSM_H */
--
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>
reply other threads:[~2009-12-16 17:18 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=19082.1260981515@redhat.com \
--to=dhowells@redhat.com \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=hugh.dickins@tiscali.co.uk \
--cc=linux-mm@vger.kernel.org \
--cc=torvalds@osdl.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.