All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pekka Enberg <penberg@kernel.org>
To: Mel Gorman <mel@csn.ul.ie>
Cc: Christoph Lameter <cl@linux.com>,
	Pekka Enberg <penberg@cs.helsinki.fi>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	David Rientjes <rientjes@google.com>,
	npiggin@kernel.dk, yanmin_zhang@linux.intel.com
Subject: Re: [UnifiedV4 00/16] The Unified slab allocator (V4)
Date: Wed, 13 Oct 2010 10:16:45 +0300	[thread overview]
Message-ID: <4CB55CDD.9010908@kernel.org> (raw)
In-Reply-To: <20101012182531.GH30667@csn.ul.ie>

[-- Attachment #1: Type: text/plain, Size: 1525 bytes --]

  On 10/12/10 9:25 PM, Mel Gorman wrote:
> On Wed, Oct 06, 2010 at 11:01:35AM +0300, Pekka Enberg wrote:
>> (Adding more people who've taken interest in slab performance in the
>> past to CC.)
>>
> I have not come even close to reviewing this yet but I made a start on
> putting it through a series of tests. It fails to build on ppc64
>
>    CC      mm/slub.o
> mm/slub.c:1477: warning: 'drain_alien_caches' declared inline after being called
> mm/slub.c:1477: warning: previous declaration of 'drain_alien_caches' was here

Can you try the attached patch to see if it fixes the problem?
> mm/slub.c: In function `alloc_shared_caches':
> mm/slub.c:1748: error: `cpu_info' undeclared (first use in this function)
> mm/slub.c:1748: error: (Each undeclared identifier is reported only once
> mm/slub.c:1748: error: for each function it appears in.)
> mm/slub.c:1748: warning: type defaults to `int' in declaration of `type name'
> mm/slub.c:1748: warning: type defaults to `int' in declaration of `type name'
> mm/slub.c:1748: warning: type defaults to `int' in declaration of `type name'
> mm/slub.c:1748: warning: type defaults to `int' in declaration of `type name'
> mm/slub.c:1748: error: invalid type argument of `unary *'
> make[1]: *** [mm/slub.o] Error 1
> make: *** [mm] Error 2
>
> I didn't look closely yet but cpu_info is an arch-specific variable.
> Checking to see if there is a known fix yet before setting aside time to
> dig deeper.
Yeah, cpu_info.llc_shared_map is an x86ism. Christoph?

             Pekka


[-- Attachment #2: 0001-slub-Fix-drain_alien_cache-redeclaration.patch --]
[-- Type: text/plain, Size: 3876 bytes --]

>From 5e3e319b1c7a92fc58e6b7da0d20df823f93a9c8 Mon Sep 17 00:00:00 2001
From: Pekka Enberg <penberg@kernel.org>
Date: Wed, 13 Oct 2010 10:10:44 +0300
Subject: [PATCH] slub: Fix drain_alien_cache() redeclaration

This patch fixes drain_alien_caches() redeclaration that causes a compliation
warning on PPC:

  CC      mm/slub.o
mm/slub.c:1477: warning: 'drain_alien_caches' declared inline after being called
mm/slub.c:1477: warning: previous declaration of 'drain_alien_caches' was here

Reported-by: Mel Gorman <mel@csn.ul.ie>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
---
 mm/slub.c |  102 +++++++++++++++++++++++++++++-------------------------------
 1 files changed, 49 insertions(+), 53 deletions(-)

diff --git a/mm/slub.c b/mm/slub.c
index 9d9bb07..a23bf2b 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1472,9 +1472,56 @@ static inline int drain_shared_cache(struct kmem_cache *s,
 	}
 	return n;
 }
+/*
+ * Alien caches which are also shared caches
+ */
+
+#ifdef CONFIG_NUMA
+
+static inline struct kmem_cache_queue *__alien_cache(struct kmem_cache *s,
+			struct kmem_cache_queue *q, int node)
+{
+	void *p = q;
+
+	p -= (node << s->alien_shift);
+
+	return (struct kmem_cache_queue *)p;
+}
+
+/* Given an allocation context determine the alien queue to use */
+static inline struct kmem_cache_queue *alien_cache(struct kmem_cache *s,
+		struct kmem_cache_cpu *c, int node)
+{
+	/* If the cache does not have any alien caches return NULL */
+	if (!c->q.shared || node == c->node)
+		return NULL;
+
+	/*
+	 * Map [0..(c->node - 1)] -> [1..c->node].
+	 *
+	 * This effectively removes the current node (which is serviced by
+	 * the shared cache) from the list and avoids hitting 0 (which would
+	 * result in accessing the shared queue used for the cpu cache).
+	 */
+	if (node < c->node)
+		node++;
 
-static void drain_alien_caches(struct kmem_cache *s,
-				struct kmem_cache_cpu *c);
+	return __alien_cache(s, c->q.shared, node);
+}
+
+static inline void drain_alien_caches(struct kmem_cache *s,
+					 struct kmem_cache_cpu *c)
+{
+	int node;
+
+	for_each_node_state(node, N_NORMAL_MEMORY)
+		drain_shared_cache(s, alien_cache(s, c, node));
+}
+
+#else
+static inline void drain_alien_caches(struct kmem_cache *s,
+				 struct kmem_cache_cpu *c) {}
+#endif
 
 /*
  * Drain all objects from a per cpu queue
@@ -1613,57 +1660,6 @@ struct kmem_cache_queue **shared_caches(struct kmem_cache *s, int node)
 	return caches;
 }
 
-/*
- * Alien caches which are also shared caches
- */
-
-#ifdef CONFIG_NUMA
-
-static inline struct kmem_cache_queue *__alien_cache(struct kmem_cache *s,
-			struct kmem_cache_queue *q, int node)
-{
-	void *p = q;
-
-	p -= (node << s->alien_shift);
-
-	return (struct kmem_cache_queue *)p;
-}
-
-/* Given an allocation context determine the alien queue to use */
-static inline struct kmem_cache_queue *alien_cache(struct kmem_cache *s,
-		struct kmem_cache_cpu *c, int node)
-{
-	/* If the cache does not have any alien caches return NULL */
-	if (!c->q.shared || node == c->node)
-		return NULL;
-
-	/*
-	 * Map [0..(c->node - 1)] -> [1..c->node].
-	 *
-	 * This effectively removes the current node (which is serviced by
-	 * the shared cache) from the list and avoids hitting 0 (which would
-	 * result in accessing the shared queue used for the cpu cache).
-	 */
-	if (node < c->node)
-		node++;
-
-	return __alien_cache(s, c->q.shared, node);
-}
-
-static inline void drain_alien_caches(struct kmem_cache *s,
-					 struct kmem_cache_cpu *c)
-{
-	int node;
-
-	for_each_node_state(node, N_NORMAL_MEMORY)
-		drain_shared_cache(s, alien_cache(s, c, node));
-}
-
-#else
-static inline void drain_alien_caches(struct kmem_cache *s,
-				 struct kmem_cache_cpu *c) {}
-#endif
-
 static struct kmem_cache *get_slab(size_t size, gfp_t flags);
 
 /* Map of cpus that have no siblings or where we have broken topolocy info */
-- 
1.7.1


WARNING: multiple messages have this Message-ID (diff)
From: Pekka Enberg <penberg@kernel.org>
To: Mel Gorman <mel@csn.ul.ie>
Cc: Christoph Lameter <cl@linux.com>,
	Pekka Enberg <penberg@cs.helsinki.fi>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	David Rientjes <rientjes@google.com>,
	npiggin@kernel.dk, yanmin_zhang@linux.intel.com
Subject: Re: [UnifiedV4 00/16] The Unified slab allocator (V4)
Date: Wed, 13 Oct 2010 10:16:45 +0300	[thread overview]
Message-ID: <4CB55CDD.9010908@kernel.org> (raw)
In-Reply-To: <20101012182531.GH30667@csn.ul.ie>

[-- Attachment #1: Type: text/plain, Size: 1525 bytes --]

  On 10/12/10 9:25 PM, Mel Gorman wrote:
> On Wed, Oct 06, 2010 at 11:01:35AM +0300, Pekka Enberg wrote:
>> (Adding more people who've taken interest in slab performance in the
>> past to CC.)
>>
> I have not come even close to reviewing this yet but I made a start on
> putting it through a series of tests. It fails to build on ppc64
>
>    CC      mm/slub.o
> mm/slub.c:1477: warning: 'drain_alien_caches' declared inline after being called
> mm/slub.c:1477: warning: previous declaration of 'drain_alien_caches' was here

Can you try the attached patch to see if it fixes the problem?
> mm/slub.c: In function `alloc_shared_caches':
> mm/slub.c:1748: error: `cpu_info' undeclared (first use in this function)
> mm/slub.c:1748: error: (Each undeclared identifier is reported only once
> mm/slub.c:1748: error: for each function it appears in.)
> mm/slub.c:1748: warning: type defaults to `int' in declaration of `type name'
> mm/slub.c:1748: warning: type defaults to `int' in declaration of `type name'
> mm/slub.c:1748: warning: type defaults to `int' in declaration of `type name'
> mm/slub.c:1748: warning: type defaults to `int' in declaration of `type name'
> mm/slub.c:1748: error: invalid type argument of `unary *'
> make[1]: *** [mm/slub.o] Error 1
> make: *** [mm] Error 2
>
> I didn't look closely yet but cpu_info is an arch-specific variable.
> Checking to see if there is a known fix yet before setting aside time to
> dig deeper.
Yeah, cpu_info.llc_shared_map is an x86ism. Christoph?

             Pekka


[-- Attachment #2: 0001-slub-Fix-drain_alien_cache-redeclaration.patch --]
[-- Type: text/plain, Size: 0 bytes --]



  reply	other threads:[~2010-10-13  7:16 UTC|newest]

Thread overview: 89+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-05 18:57 [UnifiedV4 00/16] The Unified slab allocator (V4) Christoph Lameter
2010-10-05 18:57 ` Christoph Lameter
2010-10-05 18:57 ` [UnifiedV4 01/16] slub: Enable sysfs support for !CONFIG_SLUB_DEBUG Christoph Lameter
2010-10-05 18:57   ` Christoph Lameter
2010-10-06 14:02   ` Pekka Enberg
2010-10-06 14:02     ` Pekka Enberg
2010-10-05 18:57 ` [UnifiedV4 02/16] slub: Move functions to reduce #ifdefs Christoph Lameter
2010-10-05 18:57   ` Christoph Lameter
2010-10-06 14:02   ` Pekka Enberg
2010-10-06 14:02     ` Pekka Enberg
2010-10-05 18:57 ` [UnifiedV4 03/16] slub: Add per cpu queueing Christoph Lameter
2010-10-05 18:57   ` Christoph Lameter
2010-10-05 18:57 ` [UnifiedV4 04/16] slub: Allow resizing of per cpu queues Christoph Lameter
2010-10-05 18:57   ` Christoph Lameter
2010-10-05 18:57 ` [UnifiedV4 05/16] slub: Remove MAX_OBJS limitation Christoph Lameter
2010-10-05 18:57   ` Christoph Lameter
2010-10-05 18:57 ` [UnifiedV4 06/16] slub: Drop allocator announcement Christoph Lameter
2010-10-05 18:57   ` Christoph Lameter
2010-10-05 18:57 ` [UnifiedV4 07/16] slub: Object based NUMA policies Christoph Lameter
2010-10-05 18:57   ` Christoph Lameter
2010-10-05 18:57 ` [UnifiedV4 08/16] slub: Get rid of page lock and rely on per node lock Christoph Lameter
2010-10-05 18:57   ` Christoph Lameter
2010-10-05 18:57 ` [UnifiedV4 09/16] slub: Shared cache to exploit cross cpu caching abilities Christoph Lameter
2010-10-05 18:57   ` Christoph Lameter
2010-10-05 18:57 ` [UnifiedV4 10/16] slub: Support Alien Caches Christoph Lameter
2010-10-05 18:57   ` Christoph Lameter
2010-10-05 18:57 ` [UnifiedV4 11/16] slub: Add a "touched" state to queues and partial lists Christoph Lameter
2010-10-05 18:57   ` Christoph Lameter
2010-10-05 18:57 ` [UnifiedV4 12/16] slub: Cached object expiration Christoph Lameter
2010-10-05 18:57   ` Christoph Lameter
2010-10-05 18:57 ` [UnifiedV4 13/16] vmscan: Tie slub object expiration into page reclaim Christoph Lameter
2010-10-05 18:57   ` Christoph Lameter
2010-10-05 18:57 ` [UnifiedV4 14/16] slub: Reduce size of not performance critical slabs Christoph Lameter
2010-10-05 18:57   ` Christoph Lameter
2010-10-05 18:57 ` [UnifiedV4 15/16] slub: Detailed reports on validate Christoph Lameter
2010-10-05 18:57   ` Christoph Lameter
2010-10-05 18:57 ` [UnifiedV4 16/16] slub: Add stats for alien allocation slowpath Christoph Lameter
2010-10-05 18:57   ` Christoph Lameter
2010-10-06  8:01 ` [UnifiedV4 00/16] The Unified slab allocator (V4) Pekka Enberg
2010-10-06  8:01   ` Pekka Enberg
2010-10-06 11:03   ` Richard Kennedy
2010-10-06 11:03     ` Richard Kennedy
2010-10-06 11:19     ` Pekka Enberg
2010-10-06 11:19       ` Pekka Enberg
2010-10-06 15:46       ` Richard Kennedy
2010-10-06 15:46         ` Richard Kennedy
2010-10-06 16:21         ` [UnifiedV4 slabinfo 1/2] Move slabinfo.c to tools/slub/slabinfo.c Christoph Lameter
2010-10-06 16:21           ` Christoph Lameter
2010-10-06 16:21         ` [UnifiedV4 slabinfo 2/2] slub: update slabinfo.c for queuing Christoph Lameter
2010-10-06 16:21           ` Christoph Lameter
2010-10-06 20:56         ` [UnifiedV4 00/16] The Unified slab allocator (V4) Christoph Lameter
2010-10-06 20:56           ` Christoph Lameter
2010-10-06 16:00     ` Christoph Lameter
2010-10-06 16:00       ` Christoph Lameter
2010-10-06 12:37   ` Wu Fengguang
2010-10-06 12:37     ` Wu Fengguang
2010-10-13  2:21     ` Alex,Shi
2010-10-13  2:21       ` Alex,Shi
2010-10-18 18:00       ` Christoph Lameter
2010-10-18 18:00         ` Christoph Lameter
2010-10-19  0:01         ` Alex,Shi
2010-10-19  0:01           ` Alex,Shi
2010-10-06 15:56   ` Christoph Lameter
2010-10-06 15:56     ` Christoph Lameter
2010-10-13 14:14     ` Mel Gorman
2010-10-13 14:14       ` Mel Gorman
2010-10-18 18:13       ` Christoph Lameter
2010-10-18 18:13         ` Christoph Lameter
2010-10-19  9:23         ` Mel Gorman
2010-10-19  9:23           ` Mel Gorman
2010-10-12 18:25   ` Mel Gorman
2010-10-12 18:25     ` Mel Gorman
2010-10-13  7:16     ` Pekka Enberg [this message]
2010-10-13  7:16       ` Pekka Enberg
2010-10-13 13:46       ` Mel Gorman
2010-10-13 13:46         ` Mel Gorman
2010-10-13 16:10     ` Christoph Lameter
2010-10-13 16:10       ` Christoph Lameter
2010-10-06 10:47 ` Andi Kleen
2010-10-06 15:59   ` Christoph Lameter
2010-10-06 16:25     ` Andi Kleen
2010-10-06 16:37       ` Christoph Lameter
2010-10-06 16:43         ` Andi Kleen
2010-10-06 16:49           ` Christoph Lameter
2010-10-06 16:52           ` Christoph Lameter
2010-10-19 20:39 ` David Rientjes
2010-10-19 20:39   ` David Rientjes
2010-10-20 13:47   ` Christoph Lameter
2010-10-20 13:47     ` Christoph Lameter

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=4CB55CDD.9010908@kernel.org \
    --to=penberg@kernel.org \
    --cc=cl@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mel@csn.ul.ie \
    --cc=npiggin@kernel.dk \
    --cc=penberg@cs.helsinki.fi \
    --cc=rientjes@google.com \
    --cc=yanmin_zhang@linux.intel.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 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.