[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0806232155060.4033@sbz-30.cs.Helsinki.FI>
Date: Mon, 23 Jun 2008 21:56:15 +0300 (EEST)
From: Pekka J Enberg <penberg@...helsinki.fi>
To: Vegard Nossum <vegard.nossum@...il.com>
cc: Stephen Rothwell <sfr@...b.auug.org.au>,
Steven Rostedt <srostedt@...hat.com>,
linux-next@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>,
Christoph Lameter <clameter@....com>
Subject: Re: linux-next: Tree for June 23
On Mon, 23 Jun 2008, Vegard Nossum wrote:
> Okay, I can confirm that this happens with today's tree too. I also
> get this (new) warning:
>
> mm/slub.c: In function 'kmem_cache_defrag':
> mm/slub.c:3046: warning: 'reclaimed' may be used uninitialized in this function
>
> Otherwise things seem to work good :-)
Christoph, while the warning itself seems harmless, I think we need to do
something like the following; otherwise the return value for
kmem_cache_defrag() will be incorrect on NUMA machines that have more than
one N_NORMAL_MEMORY nodes.
Pekka
diff --git a/mm/slub.c b/mm/slub.c
index deb8153..7707550 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -3043,7 +3043,7 @@ int kmem_cache_defrag(int node)
return 0;
list_for_each_entry(s, &slab_caches, list) {
- unsigned long reclaimed;
+ unsigned long reclaimed = 0;
/*
* Defragmentable caches come first. If the slab cache is not
@@ -3056,7 +3056,7 @@ int kmem_cache_defrag(int node)
int nid;
for_each_node_state(nid, N_NORMAL_MEMORY)
- reclaimed = __kmem_cache_shrink(s, nid,
+ reclaimed += __kmem_cache_shrink(s, nid,
MAX_PARTIAL);
} else
reclaimed = __kmem_cache_shrink(s, node, MAX_PARTIAL);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists