linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pekka J Enberg <penberg@cs.helsinki.fi>
To: Vegard Nossum <vegard.nossum@gmail.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>,
	Steven Rostedt <srostedt@redhat.com>,
	linux-next@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
	Christoph Lameter <clameter@sgi.com>
Subject: Re: linux-next: Tree for June 23
Date: Mon, 23 Jun 2008 21:56:15 +0300 (EEST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0806232155060.4033@sbz-30.cs.Helsinki.FI> (raw)
In-Reply-To: <19f34abd0806230402x502eca3cna927eb8742553570@mail.gmail.com>

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);

  parent reply	other threads:[~2008-06-23 18:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-23  8:25 linux-next: Tree for June 23 Stephen Rothwell
2008-06-23 10:23 ` Vegard Nossum
2008-06-23 10:26   ` Vegard Nossum
2008-06-23 11:02     ` Vegard Nossum
2008-06-23 12:26       ` Vegard Nossum
2008-06-23 17:26         ` Vegard Nossum
2008-06-23 17:43           ` Vegard Nossum
2008-06-23 18:56       ` Pekka J Enberg [this message]
2008-06-23 19:21         ` Christoph Lameter
2009-06-23  5:33 Stephen Rothwell
2009-06-23  6:07 ` Stephen Rothwell
2010-06-23  5:45 Stephen Rothwell
2011-06-23  5:54 Stephen Rothwell

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=Pine.LNX.4.64.0806232155060.4033@sbz-30.cs.Helsinki.FI \
    --to=penberg@cs.helsinki.fi \
    --cc=clameter@sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    --cc=srostedt@redhat.com \
    --cc=vegard.nossum@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).