From: Pekka Enberg <penberg@kernel.org>
To: Chen Gang <gang.chen@asianux.com>
Cc: cl@linux-foundation.org, mpm@selenic.com, linux-mm@kvack.org,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] mm/slub.c: remove 'per_cpu' which is useless variable
Date: Thu, 11 Jul 2013 09:45:51 +0300 [thread overview]
Message-ID: <51DE549F.9070505@kernel.org> (raw)
In-Reply-To: <51DA734B.4060608@asianux.com>
Hi,
On 07/08/2013 11:07 AM, Chen Gang wrote:
> Remove 'per_cpu', since it is useless now after the patch: "205ab99
> slub: Update statistics handling for variable order slabs".
Whoa, that's a really old commit. Christoph?
> Also beautify code with tab alignment.
That needs to be a separate patch.
>
> 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;
>
--
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 prev parent reply other threads:[~2013-07-11 6:45 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-08 8:07 Chen Gang
2013-07-11 6:45 ` Pekka Enberg [this message]
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 0:42 ` Wanpeng Li
2013-07-22 1:30 ` Chen Gang
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=51DE549F.9070505@kernel.org \
--to=penberg@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=cl@linux-foundation.org \
--cc=gang.chen@asianux.com \
--cc=linux-mm@kvack.org \
--cc=mpm@selenic.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