[Crash-utility] [PATCH v2 17/25] fix max_cpudata_limit() when offlined cpu exists

Qiao Nuohan qiaonuohan at cn.fujitsu.com
Mon Sep 29 02:09:15 UTC 2014


When determining the largest cpudata limit for kmem_cache, the member,
limit, of kmem_cache.array[NR_CPUS] is needed, and the process will
stop when kmem_cache.array[cpu] equals to NULL. However, when offline
cpus exist, kmem_cache.array[cpu] of offline cpus are alse NULL. Then
the process of determining the largest cpudata limit will ignore the
cpus after the offlined cpu.

This patch is used to fix the above problem.

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

diff --git a/memory.c b/memory.c
index fbbd01d..6c7f495 100755
--- a/memory.c
+++ b/memory.c
@@ -9181,7 +9181,13 @@ kmem_cache_s_array_nodes:
             "array cache array", RETURN_ON_ERROR))
 		goto bail_out;
 
-	for (i = max_limit = 0; (i < kt->cpus) && cpudata[i]; i++) {
+	for (i = max_limit = 0; i < kt->cpus; i++) {
+		if (check_offline_cpu(i))
+			continue;
+
+		if (!cpudata[i])
+			break;
+
                 if (!readmem(cpudata[i]+OFFSET(array_cache_limit),
                     KVADDR, &limit, sizeof(int),
                     "array cache limit", RETURN_ON_ERROR)) {
-- 
1.8.5.3




More information about the Crash-utility mailing list