linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Alex,Shi" <alex.shi@intel.com>
To: "cl@linux.com" <cl@linux.com>, Pekka Enberg <penberg@cs.helsinki.fi>
Cc: linux-mm@kvack.org, "Chen, Tim C" <tim.c.chen@intel.com>,
	"Huang, Ying" <ying.huang@intel.com>
Subject: [PATCH] slub: remove a minus instruction in get_partial_node
Date: Thu, 29 Sep 2011 18:05:16 +0800	[thread overview]
Message-ID: <1317290716.4188.1227.camel@debian> (raw)

Don't do a minus action in get_partial_node function here, since
it is always zero.

Signed-off-by: Alex Shi <alex.shi@intel.com>
---
 mm/slub.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/mm/slub.c b/mm/slub.c
index 492beab..eb36a6b 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1613,7 +1613,7 @@ static void *get_partial_node(struct kmem_cache *s,
 	spin_lock(&n->list_lock);
 	list_for_each_entry_safe(page, page2, &n->partial, lru) {
 		void *t = acquire_slab(s, n, page, object == NULL);
-		int available;
+		int available = 0;
 
 		if (!t)
 			continue;
@@ -1623,7 +1623,6 @@ static void *get_partial_node(struct kmem_cache *s,
 			c->node = page_to_nid(page);
 			stat(s, ALLOC_FROM_PARTIAL);
 			object = t;
-			available =  page->objects - page->inuse;
 		} else {
 			page->freelist = t;
 			available = put_cpu_partial(s, page, 0);
-- 
1.7.0



--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

             reply	other threads:[~2011-09-29 10:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-29 10:05 Alex,Shi [this message]
2011-09-29 14:18 ` [PATCH] slub: remove a minus instruction in get_partial_node Christoph Lameter
2011-10-02 12:55   ` Shi, Alex
2011-10-03 13:55     ` Christoph Lameter
2011-10-08  2:48       ` Alex,Shi
2011-10-10 17:11         ` Christoph Lameter
2011-10-11  9:50           ` Alex,Shi

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=1317290716.4188.1227.camel@debian \
    --to=alex.shi@intel.com \
    --cc=cl@linux.com \
    --cc=linux-mm@kvack.org \
    --cc=penberg@cs.helsinki.fi \
    --cc=tim.c.chen@intel.com \
    --cc=ying.huang@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 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).