[PATCH]fix kmem -s(slab) to support Linux 3.7 and later

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Dave,

When using crash on Linux 3.8, I found kmem -s is not working well.
After some investigations, I got to know commit
3c58346525d82625e68e24f071804c2dc057b6f4 changes the usage of
kmem_cache.array, nodelists is also stored in it, which caused original
code failed to work.

I made some fix, please refer to the attachment.

--
--
Regards
Qiao Nuohan


>From d08f6047418d3d59d4ec59e7991f57f849b46b4a Mon Sep 17 00:00:00 2001
From: qiaonuohan <qiaonuohan@xxxxxxxxxxxxxx>
Date: Thu, 14 Mar 2013 12:41:15 +0800
Subject: [PATCH] fix kmem -s(slab) to support Linux 3.7 and later

kmem_cache.array is extended to store nodelists, so the original
method to search array limit is out-of-range.
---
 memory.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/memory.c b/memory.c
index 02a6de1..5ceace1 100755
--- a/memory.c
+++ b/memory.c
@@ -8483,8 +8483,7 @@ kmem_cache_s_array_nodes:
             "array cache array", RETURN_ON_ERROR))
 		goto bail_out;
 
-	for (i = max_limit = 0; (i < ARRAY_LENGTH(kmem_cache_s_array)) && 
-	     cpudata[i]; i++) {
+	for (i = max_limit = 0; (i < kt->cpus) && cpudata[i]; i++) {
                 if (!readmem(cpudata[i]+OFFSET(array_cache_limit),
                     KVADDR, &limit, sizeof(int),
                     "array cache limit", RETURN_ON_ERROR))
-- 
1.7.1

--
Crash-utility mailing list
Crash-utility@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/crash-utility

[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux