<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Haren Myneni wrote:
<blockquote TYPE=CITE> 
<p><tt><font size=-1>crash-utility-bounces@redhat.com wrote on 03/09/2006
12:24:26 PM:</font></tt>
<p><tt><font size=-1>> Dave Anderson wrote:</font></tt>
<br><tt><font size=-1>></font></tt>
<br><tt><font size=-1>> > Sorry -- I see that NR_CPUS is 128 for ppc64
in crash...</font></tt>
<br><tt><font size=-1>> ></font></tt>
<br><tt><font size=-1>> > But the question remains, do you want to absolutely
depend</font></tt>
<br><tt><font size=-1>> > upon that always being the case in the kernel?</font></tt>
<br><tt><font size=-1>> ></font></tt>
<br><tt><font size=-1>> > Dave</font></tt>
<br><tt><font size=-1>></font></tt>
<br><tt><font size=-1>> Actually, looking again at the paca code, it doesn't
seem that</font></tt>
<br><tt><font size=-1>> it is dependent upon the kernel NR_CPUS value.</font></tt>
<p><tt><font size=-1>Dave,</font></tt>
<p><tt><font size=-1>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.</font></tt>
<p><tt><font size=-1>Probably, it will be more clear if you the cpu_online_map
size is based on nr_paca.</font></tt>
<p><tt><font size=-1>Like moving the following line  after calculated
nr_paca:</font></tt>
<p><font face="sans-serif"><font size=-1>+       
readmem(symbol_value("cpu_online_map"), KVADDR, &cpu_online_map[0],</font></font>
<br><font face="sans-serif"><font size=-1>+               
nr_paca/8, "cpu_online_map", FAULT_ON_ERROR);</font></font>
<br><font face="sans-serif"><font size=-1>+</font></font>
<p><tt><font size=-1>Can I go ahead and change it? - drawback of this approach
is if the NR_CPUS in the kernel is greater than 128.</font></tt>
<br> </blockquote>
<tt>Well, if NR_CPUS goes above 128 in the kernel, then</tt>
<br><tt>crash will fail in kernel_init() with:</tt>
<br><tt> </tt>
<br><tt>       if (kt->cpus > NR_CPUS) {</tt>
<br><tt>              
error(WARNING,</tt>
<br><tt>       "calculated number of cpus
(%d) greater than compiled-in NR_CPUS (%d)\n",</tt>
<br><tt>                      
kt->cpus, NR_CPUS);</tt>
<br><tt>              
error(FATAL, "recompile crash with larger NR_CPUS\n");</tt>
<br><tt>       }</tt><tt></tt>
<p><tt>so that's not really a problem.</tt>
<blockquote TYPE=CITE> 
<br><tt><font size=-1>or do you prefer actual allocating the online_map
based on nr_paca? I will make changes based on your suggestions.</font></tt>
<br> </blockquote>
<tt>I don't care either way -- I just want you guys to be happy. 
;-)</tt><tt></tt>
<p><tt>So just tell me how you want it, i.e., either keep the patch as
is,</tt>
<br><tt>or send an updated one.</tt><tt></tt>
<p><tt>Dave</tt>
<br><tt></tt> 
<br> </html>