[Crash-utility] FW: Number of cpus on ARM

Dave Anderson anderson at redhat.com
Thu Oct 16 12:47:43 UTC 2014



----- Original Message -----
> Hi
> 
> I have tried the arm_get_smp_cpus implementation given below and it works
> fine on all examples I have tested.
> 
> What about ARM64? Same update?

Maybe later.  ARM64 kdump support is still being developed, and on a live system,
it seems that I can't offline a cpu: 

  [root at apm-mustang-ev2-03 cpu7]# cat /sys/devices/system/cpu/cpu7/online
  1
  [root at apm-mustang-ev2-03 cpu7]# echo 0 > /sys/devices/system/cpu/cpu7/online
  -bash: echo: write error: Operation not supported
  [root at apm-mustang-ev2-03 cpu7]#

So for now I'll just make the change to 32-bit ARM.

Dave


> 
> Jan
> 
> Jan Karlsson
> Senior Software Engineer
> System Assurance
> 
> Sony Mobile Communications
> Tel: +46 703 062 174
> jan.karlsson at sonymobile.com
> 
> sonymobile.com
> 
> 
> 
> -----Original Message-----
> From: crash-utility-bounces at redhat.com
> [mailto:crash-utility-bounces at redhat.com] On Behalf Of Dave Anderson
> Sent: den 15 oktober 2014 15:36
> To: Discussion list for crash utility usage, maintenance and development
> Subject: Re: [Crash-utility] FW: Number of cpus on ARM
> 
> 
> 
> ----- Original Message -----
> > 
> > 
> > ----- Original Message -----
> > > 
> > > Hello
> > > 
> > > That would be a possibility but I prefer if crash can calculate the
> > > correct number of cpus itself.
> > >
> >  
> > Right, the --cpus option is only there as a workaround.
> > 
> > > If we just want to set the number of cpus to the number of cpus
> > > present, then the function “get_cpus_present()” could probably be used.
> > 
> > I prefer your patch copying ARM64.  You could throw get_cpus_present()
> > in there, but it wouldn't apply to 2.6.29 and earlier kernels.
> 
> I take that back -- I've got an ARM ramdump where they take all cpus offline
> before taking the dump.  How about this:
> 
> static int
> arm_get_smp_cpus(void)
> {
>         int cpus;
> 
>         if (cpus = get_cpus_present())
>                 return cpus;
>         else
>                 return MAX(get_cpus_online(), get_highest_cpu_online()+1); }
> 
> It covers all bases with all the sample dumpfiles I've got on hand.
> 
> Dave
> 
> 
>  
> > Dave
> >  
> > > 
> > > 
> > > Jan
> > > 
> > > 
> > > 
> > > Jan Karlsson
> > > 
> > > Senior Software Engineer
> > > 
> > > System Assurance
> > > 
> > > 
> > > 
> > > Sony Mobile Communications
> > > 
> > > Tel: +46 703 062 174
> > > 
> > > jan.karlsson at sonymobile.com
> > > 
> > > 
> > > 
> > > sonymobile.com
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > From: crash-utility-bounces at redhat.com
> > > [mailto:crash-utility-bounces at redhat.com] On Behalf Of Arun KS
> > > Sent: den 15 oktober 2014 11:57
> > > To: Discussion list for crash utility usage, maintenance and
> > > development
> > > Subject: Re: [Crash-utility] FW: Number of cpus on ARM
> > > 
> > > 
> > > 
> > > 
> > > 
> > > Hello Jan,
> > > 
> > > 
> > > 
> > > 
> > > 
> > > Can you try with option --cpus=4 passed when your start the crash.
> > > 
> > > 
> > > I used 4 here because i have 4 cores.
> > > 
> > > 
> > > 
> > > 
> > > 
> > > Thanks,
> > > 
> > > 
> > > Arun
> > > 
> > > 
> > > 
> > > 
> > > 
> > > On Wed, Oct 15, 2014 at 2:49 PM, Karlsson, Jan <
> > > Jan.Karlsson at sonymobile.com
> > > > wrote:
> > > 
> > > 
> > > Hi
> > > 
> > > 
> > > 
> > > Unfortunately I found another older example where my patch below did
> > > not work.
> > > 
> > > In that one only cpu 0 where online but 0,1,2,3 where active. So maybe:
> > > 
> > > 
> > > 
> > > return MAX(get_cpus_active(), get_highest_cpu_online()+1);
> > > 
> > > 
> > > 
> > > might work better. Someone with better knowledge about this than I
> > > have should look at the problem.
> > > 
> > > 
> > > 
> > > Jan
> > > 
> > > 
> > > 
> > > 
> > > Jan Karlsson
> > > 
> > > Senior Software Engineer
> > > 
> > > System Assurance
> > > 
> > > 
> > > 
> > > Sony Mobile Communications
> > > 
> > > Tel: +46 703 062 174
> > > 
> > > jan.karlsson at sonymobile.com
> > > 
> > > 
> > > 
> > > sonymobile.com
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > From: Karlsson, Jan
> > > Sent: den 15 oktober 2014 10:49
> > > To: Discussion list for crash utility usage, maintenance and
> > > development
> > > Subject:
> > > 
> > > 
> > > 
> > > 
> > > Hi
> > > 
> > > 
> > > 
> > > I have seen a problem when it comes to the number of cpus for ARM
> > > (32-bits).
> > > 
> > > 
> > > 
> > > static int
> > > 
> > > arm_get_smp_cpus(void)
> > > 
> > > {
> > > 
> > > return MAX(get_cpus_active(), get_cpus_online());
> > > 
> > > }
> > > 
> > > 
> > > 
> > > In one of my example, “help –k” gives me:
> > > 
> > > cpu_possible_map: 0 1 2 3
> > > 
> > > cpu_present_map: 0 1 2 3
> > > 
> > > cpu_online_map: 0 3
> > > 
> > > cpu_active_map: 3
> > > 
> > > 
> > > 
> > > So the number of cpus will become 2. However there are code in a
> > > number of places that will then only accept cpu 0 and 1 as cpus to
> > > handle.
> > > 
> > > 
> > > 
> > > When I changed to code to be the same as for ARM64 things worked as
> > > expected:
> > > 
> > > 
> > > 
> > > static int
> > > 
> > > arm_get_smp_cpus(void)
> > > 
> > > {
> > > 
> > > return MAX(get_cpus_online(), get_highest_cpu_online()+1);
> > > 
> > > }
> > > 
> > > 
> > > 
> > > Jan
> > > 
> > > 
> > > 
> > > Jan Karlsson
> > > 
> > > Senior Software Engineer
> > > 
> > > System Assurance
> > > 
> > > 
> > > 
> > > Sony Mobile Communications
> > > 
> > > Tel: +46 703 062 174
> > > 
> > > jan.karlsson at sonymobile.com
> > > 
> > > 
> > > 
> > > sonymobile.com
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > --
> > > Crash-utility mailing list
> > > Crash-utility at redhat.com
> > > https://www.redhat.com/mailman/listinfo/crash-utility
> > > 
> > > 
> > > 
> > > 
> > > --
> > > Crash-utility mailing list
> > > Crash-utility at redhat.com
> > > https://www.redhat.com/mailman/listinfo/crash-utility
> > 
> > --
> > Crash-utility mailing list
> > Crash-utility at redhat.com
> > https://www.redhat.com/mailman/listinfo/crash-utility
> 
> --
> Crash-utility mailing list
> Crash-utility at redhat.com
> https://www.redhat.com/mailman/listinfo/crash-utility
> 
> --
> Crash-utility mailing list
> Crash-utility at redhat.com
> https://www.redhat.com/mailman/listinfo/crash-utility




More information about the Crash-utility mailing list