在 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@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, 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.

 

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@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility