----- "Michael Holzheu" <holzheu(a)linux.vnet.ibm.com> wrote:
> > It shows all swapper tasks (online and offline), but I get
errors for
> > the backtrace for the offline CPUs.
>
> What kind of errors?
The problem is that for the offline swapper tasks
s390x_get_stack_frame() is called. In that function I check with
s390x_has_cpu() if the task is currently running on a CPU. Because of
the missing CPU online check, s390x_has_cpu() returns TRUE. Therefore I
try to read the CPU registers from the lowcore of that CPU. The lowcore
pointer is zero, because the CPU is offline. Therefore the read stack
pointer (register 15) is wrong and the backtrace fails.
> >
> > The attached patch would solve the problem (and eliminate most of the
> > probably redundant s390(x)_has_cpu() function.
>
> I don't see what's being solved by the patch (not the s390x_get_smp_cpus
> parts) -- does the "old" s390x_has_cpu() fail?
The old s390x_has_cpu() returns TRUE for the offline swapper tasks. And
I think that this is wrong.
Hmmm... To me, it is TRUE, i.e., the existing-but-idle swapper task for
an offline cpu actually *does* own that cpu.
And that's why I was wondering about what error message gets shown.
The new implementation of s390x_has_cpu() should return TRUE if the task
is running on a online CPU and FALSE otherwise:
+ if (is_task_active(bt->task) && (kt->cpu_flags[cpu] & ONLINE))
+ return TRUE;
+ else
+ return FALSE;
This is probably OK, although I am slightly hesitant about throwing out all
of the old backwards-compatibility code in the s390[x]_has_cpu() functions.
I thought maybe it would be safer to leave well enough alone, and not
worry about any error messages from backtraces of offline cpus.
It might be even more useful that there are error messages to alert
the user that the cpu is not online?
Dave