crash-utility-bounces@redhat.com wrote on 03/09/2006 02:01:40 PM:

> Haren Myneni wrote:

>  
> crash-utility-bounces@redhat.com wrote on 03/09/2006 12:24:26 PM:
> > Dave Anderson wrote:
> >
> > > Sorry -- I see that NR_CPUS is 128 for ppc64 in crash...
> > >
> > > But the question remains, do you want to absolutely depend
> > > upon that always being the case in the kernel?
> > >
> > > Dave
> >
> > Actually, looking again at the paca code, it doesn't seem that
> > it is dependent upon the kernel NR_CPUS value.

> Dave,
> Since, we are iterating on nr_paca, though that it may not be an
> issue even if the kernel changed NR_CPUS to < 128. The only issue is
> we are reading NR_CPUS/8 for cpu_online_map - not using the remaining part.

> Probably, it will be more clear if you the cpu_online_map size is
> based on nr_paca.

> Like moving the following line  after calculated nr_paca:
> +        readmem(symbol_value("cpu_online_map"), KVADDR, &cpu_online_map[0],
> +                nr_paca/8, "cpu_online_map", FAULT_ON_ERROR);
> +

> Can I go ahead and change it? - drawback of this approach is if the
> NR_CPUS in the kernel is greater than 128.
>  

> Well, if NR_CPUS goes above 128 in the kernel, then
> crash will fail in kernel_init() with:
>  
>        if (kt->cpus > NR_CPUS) {
>                error(WARNING,
>        "calculated number of cpus (%d) greater than compiled-in
> NR_CPUS (%d)\n",
>                        kt->cpus, NR_CPUS);
>                error(FATAL, "recompile crash with larger NR_CPUS\n");
>        }

> so that's not really a problem.

Dave,

The above error messages will not be printed anyway since the ppc64_paca_init will be executed later. At this point, kt->cpus will be 1.

Hence, made minor changes to the previously posted patch.

Thanks
Haren





>  
> or do you prefer actual allocating the online_map based on nr_paca?
> I will make changes based on your suggestions.
>  

> I don't care either way -- I just want you guys to be happy.  ;-)
> So just tell me how you want it, i.e., either keep the patch as is,
> or send an updated one.

> Dave
>  
>  --
> Crash-utility mailing list
> Crash-utility@redhat.com
> https://www.redhat.com/mailman/listinfo/crash-utility