From 7a5b0d9eb6642b994451c328d748b2e4481d23e0 Mon Sep 17 00:00:00 2001 From: Qiao Nuohan Date: Thu, 25 Sep 2014 15:35:35 +0800 Subject: [PATCH v3 14/21] fix max_cpudata_limit() when offlined cpu exists 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 --- memory.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/memory.c b/memory.c index 6b64e21..c321b77 100755 --- a/memory.c +++ b/memory.c @@ -9182,7 +9182,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