[Crash-utility] [PATCH] Add -m option to kmem

yanfei zhang zhangyanfei.linux at gmail.com
Wed Mar 27 16:53:14 UTC 2013


在 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<javascript:;>
> )
> >     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, 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.




>
> 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.


>
> Dave
>
>
> --
> Crash-utility mailing list
> Crash-utility at redhat.com <javascript:;>
> https://www.redhat.com/mailman/listinfo/crash-utility
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/crash-utility/attachments/20130328/da622427/attachment.htm>


More information about the Crash-utility mailing list