lkml.org 
[lkml]   [2008]   [Jun]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: 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);

\
 
 \ /
  Last update: 2008-06-23 20:59    [W:0.046 / U:1.324 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site