[Crash-utility] [PATCH] Add -m option to kmem
Dave Anderson
anderson at redhat.com
Wed Mar 27 17:54:05 UTC 2013
----- Original Message -----
>
>
>
> 在 2013年3月27日星期三,Dave Anderson 写道:
>
>
>
>
> ----- Original Message -----
> > kmem -m|-M is used for displaying information of all ksm pages or
> > some ksm pages for specified ksm stable tree node addresses
> >
> > for example:
> > crash> kmem -m
> > STABLE_NODE : ffff88083fc927e0
> > PAGE : ffffea000e667998
> > PHYSICAL ADDRESS: 41d475000
> >
> > PID: 2967 MAPPING: 3
> >
> > STABLE_NODE : ffff88083fc84a10
> > PAGE : ffffea000e3dd5d8
> > PHYSICAL ADDRESS: 411aad000
> >
> > PID: 2967 MAPPING: 7
> >
> > STABLE_NODE : ffff88041980dda8
> > PAGE : ffffea000e335568
> > PHYSICAL ADDRESS: 40eaab000
> >
> > PID: 2967 MAPPING: 8
> > ...
> >
> > STABLE_NODE : ffff880841ea43f8
> > PAGE : ffffea000f62de38
> > PHYSICAL ADDRESS: 465641000
> >
> > PID: 2967 MAPPING: 729
> > PID: 3017 MAPPING: 499
> >
> > P.S.
> > This patch is based on the patch from Qiao(qiaonuohan at cn.fujitsu.com )
> > 0001-make-rbtree-manipulation-functions-global.patch
> > Because this patch also uses rb_tree operations.
>
> I cannot test this because all of my sample dumps either return:
>
> crash> kmem -m
> kmem: -m option not supported or applicable on this architecture or
> kernel
> crash>
>
> this is the kernel that doesn't support ksm
>
> or:
>
> crash> kmem -m
> ksm may not be enabled
> crash>
>
> This is because ksm is disabled or there is no ksm page in your
> system.
Which one? Can't you determine that?
>
> which, by the way, is not a very helpful error message.
>
> Do you have a reasonably-sized vmcore that I can download and test?
>
> I have no vmcore on hand now. You could follow the below steps to
> make ksm work in your system.
>
> * Ensure you are using kernel >= 2.6.31-0.94.rc4.fc12 and qemu-kvm >=0.10.92-4.fc12
> * Run two or more similar virtual machines
> * service ksm start
> * service ksmtuned start
> * Wait a while
> * Check whether pages were merged using /sys/kernel/mm/ksm/pages_shared
> * If value in /sys/kernel/mm/ksm/pages_shared is not zero, you
> could run crash kmem -m to see the output.
OK look, if I get the time, I'll try to set this up...
But just the fact that I have to go to all this trouble, and the fact
that you don't even have a sample vmcore available again begs the question
as to how useful -- or better put -- how often, this command would ever
be utilized.
On the other hand, if you were to create a "ksm" extension module, then
I would be more than happy to post it with all of the others on the
extensions web page.
> Also, I have a question about the help message:
>
> crash> help kmem
>
> NAME
> kmem - kernel memory
>
> SYNOPSIS
> kmem [-f|-F|-p|-c|-C|-i|-s|-S|-v|-V|-n|-z|-o|-m|-M] [slab] [[-P]
> address]
> [-g [flags]
>
> DESCRIPTION
> ... [ cut ] ...
> -m displays information of ksm pages.
> -M same as -m, but also dumps virtual addresses that mapping the
> ksm pages.
> ... [ cut ] ...
> address when used with -m or -M, the address can be either a ksm stable
> tree node address, a page's physical address, or a page pointer,
> the information of the ksm page (if it is) is displayed.
> ... [ cut ] ...
>
> Display information of ksm pages:
>
> crash> kmem -m ffff88086f22eec0 ffff8803573964c0
> STABLE_NODE : ffff88083fc927e0
> PAGE : ffffea000e667998
> PHYSICAL ADDRESS: 41d475000
>
> PID: 2967 MAPPING: 3
>
> STABLE_NODE : ffff88083fc84a10
> PAGE : ffffea000e3dd5d8
> PHYSICAL ADDRESS: 411aad000
>
> PID: 2967 MAPPING: 7
>
> STABLE_NODE : ffff88041980dda8
> PAGE : ffffea000e335568
> PHYSICAL ADDRESS: 40eaab000
>
> PID: 2967 MAPPING: 8
>
> ......
>
> STABLE_NODE : ffff880841ea43f8
> PAGE : ffffea000f62de38
> PHYSICAL ADDRESS: 465641000
>
> PID: 2967 MAPPING: 729
> PID: 3017 MAPPING: 499
>
> crash>
>
> Please tell me how the two address arguments ffff88086f22eec0 and
> ffff8803573964c0 have any relationship to the subsequent display?
>
>
> Sorry this is a mistake. The two addresses in the example are
> redundant.
Well, they aren't "redundant", they just don't make any sense at all.
I'm presuming that they don't belong there at all, and that you're
just showing the output of "kmem -m" alone, correct?
Dave
More information about the Crash-utility
mailing list