[Crash-utility] Running idle threads show wrong CPU numbers

Michael Holzheu holzheu at linux.vnet.ibm.com
Wed Feb 10 15:00:38 UTC 2010


Hi again,

On Wed, 2010-02-10 at 14:32 +0100, Michael Holzheu wrote:
> Hallo Dave,
> 
> On Fri, 2010-01-22 at 09:32 -0500, Dave Anderson wrote:
> > ----- "Michael Holzheu" <holzheu at linux.vnet.ibm.com> wrote:
> > 
> > > Hi Dave,
> > > 
> > > I have a problem with a dump where I have defined five CPUs and two of
> > > them are offline. In fact the logical CPUs are defined as follows:
> > > 
> > >   0 on
> > >   1 on
> > >   2 off
> > >   3 off
> > >   4 on
> > > 
> > > The CPU online map looks correct:
> > > 
> > > crash> print/x *cpu_online_mask
> > > $4 = {
> > >   bits = {0x13} ---> b10011
> > > }
> > > 
> > > When I issue "ps" I see that all running tasks are idle, but the CPU
> > > numbers are not correct (0,1,2 and not 0,1,4):
> > > 
> > >    PID    PPID  CPU       TASK        ST  %MEM     VSZ    RSS  COMM
> > > >     0      0   0       800ef0       RU   0.0       0      0  [swapper]
> > > >     0      0   1      18c24240      RU   0.0       0      0  [swapper]
> > > >     0      0   2      18c2c340      RU   0.0       0      0  [swapper]
> > > 
> > > I tried to debug the problem, but got stuck somewhere in "task.c". I
> > > think there is a problem with the idle threads initialization, where the
> > > online map is not considered.
> > > 
> > > Maybe you can see the bug immediately. Otherwise I will have spend more
> > > effort for debugging that problem. I hope not :-)
> > 
> > Does "sys" show 5 or 3 cpus?  I'm guessing it shows 3, but should show 5.
> 
> Yes it shows 3.
> 
> > It looks like the s390/s390x files need to use "get_highest_cpu_online()-1"
> > (like x86_64 and ppc64) in order to determine the number of cpus to account
> > for.  As it is now, they do this, and would therefore only account for the
> > first 3 cpus:
> > 
> > int
> > s390x_get_smp_cpus(void)
> > {
> >         return get_cpus_online();
> > }
> > 
> > int
> > s390_get_smp_cpus(void)
> > {
> >         return get_cpus_online();
> > }
> 
> Hmmm ok...
> 
> When I change get_smp_cpus() to return "get_highest_cpu_online() + 1" I
> see five swapper idle tasks when using "ps". The problem I now have is
> that I have to provide a backtrace for the offline cpus. But the offline
> CPUs do not have any stack on s390. Is there a way to tell crash that
> there is no backtrace available? Probably I overlooked something...

Ok, I think I got it now. In case of an offline CPU, I will use
"task_struct_thread_ksp" like I do it for non active tasks.

When I do that I get for the swapper tasks with the offline CPUs:

PID: 0      TASK: 18d38340          CPU: 2   COMMAND: "swapper"
 #0 [18d3feb8] ret_from_fork at 117e12

PID: 0      TASK: 18d40440          CPU: 3   COMMAND: "swapper"
 #0 [18d47eb8] ret_from_fork at 117e12


Michael




More information about the Crash-utility mailing list