From: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
To: linux-kernel@vger.kernel.org
Cc: akpm@linux-foundation.org, Paul Mundt <lethal@linux-sh.org>,
Nick Piggin <npiggin@suse.de>
Subject: [PATCH] RFC: mm: Fix build error SLBQ when CONFIG_SMP is not enable
Date: Mon, 20 Apr 2009 15:11:12 +0900 [thread overview]
Message-ID: <49EC1200.6020707@renesas.com> (raw)
Hi,
I fixed build error and tested source code base only,
because I don't know test method of SLAB.
Please give me an opinion about this revision.
Thanks,
Nobuhiro
---
Kernel become build error, because functions depending on COMFIG_SMP enabled.
----
CC mm/slqb.o
mm/slqb.c: In function '__slab_free':
mm/slqb.c:1735: error: implicit declaration of function 'slab_free_to_remote'
mm/slqb.c: In function 'kmem_cache_open':
mm/slqb.c:2274: error: implicit declaration of function 'kmem_cache_dyn_array_free'
mm/slqb.c:2275: warning: label 'error_cpu_array' defined but not used
mm/slqb.c: In function 'kmem_cache_destroy':
mm/slqb.c:2395: error: implicit declaration of function 'claim_remote_free_list'
mm/slqb.c: In function 'kmem_cache_init':
mm/slqb.c:2885: error: 'per_cpu__kmem_cpu_nodes' undeclared (first use in this function)
mm/slqb.c:2885: error: (Each undeclared identifier is reported only once
mm/slqb.c:2885: error: for each function it appears in.)
mm/slqb.c:2886: error: 'kmem_cpu_cache' undeclared (first use in this function)
make[1]: *** [mm/slqb.o] Error 1
make: *** [mm] Error 2
----
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
CC: Andrew Morton <akpm@linux-foundation.org>
CC: Nick Piggin <npiggin@suse.de>
CC: Paul Mundt <lethal@linux-sh.org>
---
mm/slqb.c | 20 ++++++++++++++++----
1 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/mm/slqb.c b/mm/slqb.c
index 37949f5..1858b3d 100644
--- a/mm/slqb.c
+++ b/mm/slqb.c
@@ -1728,7 +1728,7 @@ static __always_inline void __slab_free(struct kmem_cache *s,
flush_free_list(s, l);
} else {
-#ifdef CONFIG_NUMA
+#ifdef CONFIG_SMP
/*
* Freeing an object that was allocated on a remote node.
*/
@@ -1937,7 +1937,9 @@ static DEFINE_PER_CPU(struct kmem_cache_node, kmem_cpu_nodes); /* XXX per-nid */
#ifdef CONFIG_NUMA
static struct kmem_cache kmem_node_cache;
+# ifdef CONFIG_SMP
static DEFINE_PER_CPU(struct kmem_cache_cpu, kmem_node_cpus);
+# endif
static DEFINE_PER_CPU(struct kmem_cache_node, kmem_node_nodes); /*XXX per-nid */
#endif
@@ -2270,7 +2272,7 @@ static int kmem_cache_open(struct kmem_cache *s,
error_nodes:
free_kmem_cache_nodes(s);
error_node_array:
-#ifdef CONFIG_NUMA
+#if defined(CONFIG_NUMA) && defined(CONFIG_SMP)
kmem_cache_dyn_array_free(s->node_slab);
error_cpu_array:
#endif
@@ -2392,7 +2394,9 @@ void kmem_cache_destroy(struct kmem_cache *s)
continue;
l = &n->list;
+#ifdef CONFIG_SMP
claim_remote_free_list(s, l);
+#endif
flush_free_list_all(s, l);
WARN_ON(l->freelist.nr);
@@ -2623,7 +2627,9 @@ int kmem_cache_shrink(struct kmem_cache *s)
l = &n->list;
spin_lock_irq(&n->list_lock);
+#ifdef CONFIG_SMP
claim_remote_free_list(s, l);
+#endif
flush_free_list(s, l);
spin_unlock_irq(&n->list_lock);
}
@@ -2650,7 +2656,9 @@ static void kmem_cache_reap_percpu(void *arg)
}
if (phase == 1) {
+#ifdef CONFIG_SMP
claim_remote_free_list(s, l);
+#endif
flush_free_list_all(s, l);
}
}
@@ -2676,7 +2684,9 @@ static void kmem_cache_reap(void)
l = &n->list;
spin_lock_irq(&n->list_lock);
+#ifdef CONFIG_SMP
claim_remote_free_list(s, l);
+#endif
flush_free_list_all(s, l);
spin_unlock_irq(&n->list_lock);
}
@@ -2703,7 +2713,9 @@ static void cache_trim_worker(struct work_struct *w)
struct kmem_cache_list *l = &n->list;
spin_lock_irq(&n->list_lock);
+#ifdef CONFIG_SMP
claim_remote_free_list(s, l);
+#endif
flush_free_list(s, l);
spin_unlock_irq(&n->list_lock);
}
@@ -2881,11 +2893,11 @@ void __init kmem_cache_init(void)
n = &per_cpu(kmem_cache_nodes, i);
init_kmem_cache_node(&kmem_cache_cache, n);
kmem_cache_cache.node_slab[i] = n;
-
+#ifdef CONFIG_SMP
n = &per_cpu(kmem_cpu_nodes, i);
init_kmem_cache_node(&kmem_cpu_cache, n);
kmem_cpu_cache.node_slab[i] = n;
-
+#endif
n = &per_cpu(kmem_node_nodes, i);
init_kmem_cache_node(&kmem_node_cache, n);
kmem_node_cache.node_slab[i] = n;
-- 1.6.2.2
reply other threads:[~2009-04-20 6:12 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=49EC1200.6020707@renesas.com \
--to=iwamatsu.nobuhiro@renesas.com \
--cc=akpm@linux-foundation.org \
--cc=lethal@linux-sh.org \
--cc=linux-kernel@vger.kernel.org \
--cc=npiggin@suse.de \
/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
Powered by JetHome