From: Chen Gang <gang.chen@asianux.com>
To: cl@linux-foundation.org, penberg@kernel.org, mpm@selenic.com
Cc: linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH] mm/slub.c: remove 'per_cpu' which is useless variable
Date: Mon, 08 Jul 2013 16:07:39 +0800 [thread overview]
Message-ID: <51DA734B.4060608@asianux.com> (raw)
Remove 'per_cpu', since it is useless now after the patch: "205ab99
slub: Update statistics handling for variable order slabs".
Also beautify code with tab alignment.
Signed-off-by: Chen Gang <gang.chen@asianux.com>
---
mm/slub.c | 17 ++++++-----------
1 files changed, 6 insertions(+), 11 deletions(-)
diff --git a/mm/slub.c b/mm/slub.c
index 2caaa67..aa847eb 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -4271,12 +4271,10 @@ static ssize_t show_slab_objects(struct kmem_cache *s,
int node;
int x;
unsigned long *nodes;
- unsigned long *per_cpu;
- nodes = kzalloc(2 * sizeof(unsigned long) * nr_node_ids, GFP_KERNEL);
+ nodes = kzalloc(sizeof(unsigned long) * nr_node_ids, GFP_KERNEL);
if (!nodes)
return -ENOMEM;
- per_cpu = nodes + nr_node_ids;
if (flags & SO_CPU) {
int cpu;
@@ -4307,8 +4305,6 @@ static ssize_t show_slab_objects(struct kmem_cache *s,
total += x;
nodes[node] += x;
}
-
- per_cpu[node]++;
}
}
@@ -4318,12 +4314,11 @@ static ssize_t show_slab_objects(struct kmem_cache *s,
for_each_node_state(node, N_NORMAL_MEMORY) {
struct kmem_cache_node *n = get_node(s, node);
- if (flags & SO_TOTAL)
- x = atomic_long_read(&n->total_objects);
- else if (flags & SO_OBJECTS)
- x = atomic_long_read(&n->total_objects) -
- count_partial(n, count_free);
-
+ if (flags & SO_TOTAL)
+ x = atomic_long_read(&n->total_objects);
+ else if (flags & SO_OBJECTS)
+ x = atomic_long_read(&n->total_objects) -
+ count_partial(n, count_free);
else
x = atomic_long_read(&n->nr_slabs);
total += x;
--
1.7.7.6
--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next reply other threads:[~2013-07-08 8:08 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-08 8:07 Chen Gang [this message]
2013-07-11 6:45 ` Pekka Enberg
2013-07-11 6:50 ` Chen Gang
2013-07-11 16:45 ` Christoph Lameter
2013-07-11 18:28 ` Pekka Enberg
2013-07-11 20:16 ` Christoph Lameter
2013-07-11 23:52 ` Chen Gang
2013-07-12 0:23 ` [PATCH v2] " Chen Gang
2013-07-12 0:55 ` [PATCH] mm/slub.c: add parameter length checking for alloc_loc_track() Chen Gang
2013-07-12 13:49 ` Christoph Lameter
2013-07-15 0:17 ` Chen Gang
2013-07-15 15:16 ` Christoph Lameter
2013-07-16 1:03 ` Chen Gang
2013-07-17 15:03 ` Christoph Lameter
2013-07-18 0:43 ` Chen Gang
2013-07-18 13:45 ` Christoph Lameter
2013-07-19 0:05 ` Chen Gang F T
2013-07-19 13:57 ` Christoph Lameter
2013-07-22 0:27 ` Chen Gang
2013-07-22 0:42 ` Wanpeng Li
2013-07-22 1:30 ` Chen Gang
2013-07-22 0:42 ` Wanpeng Li
2013-07-12 13:45 ` [PATCH v2] mm/slub.c: remove 'per_cpu' which is useless variable Christoph Lameter
2013-07-15 0:08 ` Chen Gang
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=51DA734B.4060608@asianux.com \
--to=gang.chen@asianux.com \
--cc=akpm@linux-foundation.org \
--cc=cl@linux-foundation.org \
--cc=linux-mm@kvack.org \
--cc=mpm@selenic.com \
--cc=penberg@kernel.org \
/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