From ed64a2fcf1fff6af24043bbe5d60b33b80381982 Mon Sep 17 00:00:00 2001
From: Qiao Nuohan <qiaonuohan@cn.fujitsu.com>
Date: Sat, 23 Aug 2014 17:04:55 +0800
Subject: [PATCH 18/23] x86_64: modify kmem -S(SLUB) only to display online
 cpus' data

if SLUB is configured, kmem -S will display per-cpu data. This patch
will skip offline cpu.

Signed-off-by: Qiao Nuohan <qiaonuohan@cn.fujitsu.com>
---
 memory.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/memory.c b/memory.c
index 65447c9..ce524ba 100755
--- a/memory.c
+++ b/memory.c
@@ -17349,6 +17349,9 @@ do_kmem_cache_slub(struct meminfo *si)
 	per_cpu = (ulong *)GETBUF(sizeof(ulong) * vt->numnodes);
 
         for (i = 0; i < kt->cpus; i++) {
+		if (check_offline_cpu(i))
+			continue;
+
 		cpu_slab_ptr = get_cpu_slab_ptr(si, i, NULL);
 
 		fprintf(fp, "CPU %d SLAB:\n%s", i, 
-- 
1.8.5.3

