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