<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
 <tt></tt>
<p><tt>Sharyathi Nagesh wrote:</tt><tt></tt>
<p><tt>  Dave</tt>
<br><tt>      You were right it should be buffer_size
instead of objectsize.(As obj_size is the size of debugging information).</tt>
<br><tt>  I modified function vm_init() and do_slab_chain_percpu_v2()
to make it work with current dumps. This is just a code</tt>
<br><tt>  part to show how to fix the problem but it is not a patch
as such...</tt>
<br><tt>     Please go through and let me know would
it be good idea to write a new function (as you have suggested earlier)
or</tt>
<br><tt>  is it possible to accommodate by calling do_slab_chain_percpu_v2()
iteratively with different nodes by passing them as</tt>
<br><tt>  parameter.</tt><tt></tt>
<p><tt>  Changes to vm_init()</tt><tt></tt>
<p><tt>                         
if(MEMBER_EXISTS("kmem_cache","objsize"))</tt>
<br><tt>                                 
MEMBER_OFFSET_INIT(kmem_cache_s_objsize,  "kmem_cache",</tt>
<br><tt>                                 
"objsize");</tt>
<br><tt>                         
else if(MEMBER_EXISTS("kmem_cache","buffer_size"))</tt>
<br><tt>                                 
MEMBER_OFFSET_INIT(kmem_cache_s_objsize,  "kmem_cache",</tt>
<br><tt>                                 
"buffer_size")</tt><tt></tt>
<p><tt>  Changes to do_slab_chain_percpu_v2()</tt><tt></tt>
<p><tt>          ulong start_address[MAX_NUMNODES];</tt><tt></tt>
<p><tt>          if (!readmem(si->cache+OFFSET(kmem_cache_s_lists),</tt>
<br><tt>                     
KVADDR, &start_address[0],</tt>
<br><tt>                     
sizeof(ulong) * MAX_NUMNODES,</tt>
<br><tt>                     
"array nodelist array", RETURN_ON_ERROR))</tt>
<br><tt>                         
{printf("\n Error encountered with readmem  \n");exit(0);}</tt><tt></tt>
<p><tt>           for
(i =  0; i < MAX_NUMNODES ; i++) {</tt>
<br><tt>                 
slab_chains[0] = start_address[i] + OFFSET(kmem_list3_slabs_partial);</tt>
<br><tt>                 
slab_chains[1] = start_address[i] + OFFSET(kmem_list3_slabs_full);</tt>
<br><tt>                 
slab_chains[2] = start_address[i] + OFFSET(kmem_list3_slabs_free);</tt>
<br><tt> </tt><tt></tt>
<p><tt> </tt><tt></tt>
<p><tt>The vm_init() change is fine, but it would also need:</tt><tt></tt>
<p><tt>(1) the same kind of offset initializer to handle the kmem_cache</tt>
<br><tt>    structure's "lists"-to-"nodelist" name change.</tt>
<br><tt>(2) A new flag in vt->flags to signal this node-enhanced version</tt>
<br><tt>    of the kmem_cache struct.</tt>
<br><tt>(3) a check of the dimension of some processor-neutral, always-there,</tt>
<br><tt>    kernel array indexed by MAX_NUMNODES, so that
you can determine</tt>
<br><tt>    what MAX_NUMNODES is equal to, and then store
that value in a</tt>
<br><tt>    new vm_table entry.</tt><tt></tt>
<p><tt>With respect to do_slab_chain_percpu_v2(), I would prefer that</tt>
<br><tt>it be left as is, and either</tt><tt></tt>
<p><tt>(1) at the top of the function, check for your new "node-enhanced"</tt>
<br><tt>    flag, and call a new do_slab_chain_percpu_v2_nodes()
function, or</tt>
<br><tt>(2) alternatively, the two locations where do_slab_chain_percpu_v2()</tt>
<br><tt>    gets called could be qualified based upon the
new flag, and the</tt>
<br><tt>    appropriate function called.</tt><tt></tt>
<p><tt>In that new function, the usage of a static start_address[] array</tt>
<br><tt>as you indicate above would have to be replaced with dynamically</tt>
<br><tt>allocated and freed with GETBUF() and FREEBUF(), based upon</tt>
<br><tt>the predetermined size of MAX_NUMNODES.</tt><tt></tt>
<p><tt>Doing it that way leaves the current functionality untouched, makes</tt>
<br><tt>me a lot less nervous, and should make your task a bit easier.</tt><tt></tt>
<p><tt>Make sense?</tt><tt></tt>
<p><tt>Dave</tt></html>