linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/slub.c: remove 'per_cpu' which is useless variable
@ 2013-07-08  8:07 Chen Gang
  2013-07-11  6:45 ` Pekka Enberg
  0 siblings, 1 reply; 24+ messages in thread
From: Chen Gang @ 2013-07-08  8:07 UTC (permalink / raw)
  To: cl, penberg, mpm; +Cc: linux-mm, Andrew Morton

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>

^ permalink raw reply related	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2013-07-22  1:31 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-08  8:07 [PATCH] mm/slub.c: remove 'per_cpu' which is useless variable Chen Gang
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

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