Re: [PATCH 2/3] crash: ARM: get online CPUs from cpu_active_mask

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

 



On 2014/4/26 3:20, Dave Anderson wrote:
> 
> 
> ----- Original Message -----
>> For ARM32 platfrom, The system will "offline" all CPUs except the
>> crashing one, by clear the cpu_online_mask. So we need to find
>> another way to get online-CPUs number for crash utility.
>>
>> This patch uses cpu_active_mask to get that value.
>>
>> Signed-off-by: Liu Hua <sdu.liu@xxxxxxxxxx>
>> ---
>>  arm.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arm.c b/arm.c
>> index 3c38cd5..c94d7bf 100644
>> --- a/arm.c
>> +++ b/arm.c
>> @@ -1518,7 +1518,7 @@ arm_display_machine_stats(void)
>>  static int
>>  arm_get_smp_cpus(void)
>>  {
>> -	return get_cpus_online();
>> +	return get_cpus_active();
>>  }
>>  
>>  /*
> 
> When did this start happening?  I ask because no other ARM users have 
> reported this until now.  I've only got one sample SMP vmcore, and 
> clearly the non-crashing cpu was not offlined:
> 


Hi Dave,

 commit 36a2e5010fe87 "kexec: offline non panic CPUs on Kdump panic "
 introduces this change. <v3.10.27-1-g36a2e50>

 The following messges come from the ARM boards on my hand. The crash
 utility has added my patchs.

(1) ARM A15 16 CPUs

  crash> sys

      KERNEL: vmlinux
    DUMPFILE: vmcore_my  [PARTIAL DUMP]
        CPUS: 16
        DATE: Fri Feb 28 10:07:55 2014
      UPTIME: 00:03:57
LOAD AVERAGE: 0.03, 0.01, 0.01
       TASKS: 140
    NODENAME: arma15el
     RELEASE: 3.10.37+
     VERSION: #2 SMP Thu Apr 24 21:13:28 CST 2014
     MACHINE: armv7l  (unknown Mhz)
      MEMORY: 3.1 GB
       PANIC: "Internal error: Oops: a07 [#1] SMP ARM" (check log for details

  crash> help -k
       ....
       cpu_possible_map: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
       cpu_present_map: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
       cpu_online_map: 0
       ...


(2) ARM A9 4 CPUs

crash> sys
      KERNEL: vmlinux
    DUMPFILE: vmcore
        CPUS: 2
        DATE: Mon Apr 14 11:09:10 2014
      UPTIME: 00:06:17
LOAD AVERAGE: 0.16, 0.05, 0.02
       TASKS: 45
    NODENAME: arma9el
     RELEASE: 3.10.37+
     VERSION: #6 SMP Tue Apr 22 13:23:30 CST 2014
     MACHINE: armv7l  (unknown Mhz)
      MEMORY: 1.5 GB
       PANIC: "Internal error: Oops: 817 [#1] SMP ARM" (check log for details)

  crash> help -k
       ....
	cpu_possible_map: 0 1
        cpu_present_map: 0 1
        cpu_online_map: 1


   crash> p per_cpu__runqueues

   PER-CPU DATA TYPE:
   struct rq runqueues;
   PER-CPU ADDRESSES:
   [0]: c069a680
   [1]: c06a2680

With my patches, "sys" command is ok. And I can get per_cpu variables correctly.
But something should be done for "help -k". May be I should add fully support
for cpu_active_mask. If necessory, I will resend this patch series.

>   crash> sys
...
> 
> Also, backwards-compatibility must be maintained, and it appears that
> the cpu_active mask was only first introduced in 2.6.27.  So perhaps it
> should be something like:

Absolutely, I will repost this one.

> 
> --- arm.c.orig	2014-04-25 14:44:23.557665220 -0400
> +++ arm.c	2014-04-25 15:13:46.709594145 -0400
> @@ -1518,7 +1518,7 @@
>  static int
>  arm_get_smp_cpus(void)
>  {
> -	return get_cpus_online();
> +	return MAX(get_cpus_active(), get_cpus_online());
>  }
>  
> Dave
> 
> 


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