----- Original Message -----
于 2013年03月02日 05:20, Dave Anderson 写道:
>
>
> ----- Original Message -----
>> kmem -m is used for displaying information of all ksm pages or
>> some ksm pages for specified ksm stable tree node addresses
>> The information includes:
>> - physical address of ksm page,
>> - pid of tasks using this ksm page,
>> - counts of ksm page references for each task
>>
>> for example:
>> crash> kmem -m ffff8803573964c0
>> PID: 15864 16781
>> 793005000: 8713 5584
>>
>> ffff8803573964c0 is the address of ksm stable tree node.
>> task 15864 has 8713 virtual pages mapping the page with address 793005000.
>> task 16781 has 5584 virtual pages mapping the page with address 793005000.
>>
>> P.S.
>> This patch is based on the patch from
>> Qiao(qiaonuohan(a)cn.fujitsu.com)
>> 0001-make-rbtree-manipulation-functions-global.patch
>> Because this patch also uses rb_tree operations.
>
> I'll get to this patch after I get Qiao's patch straightened out and
> checked in.
>
> But a couple quick questions...
>
> What does "kmem -m" alone look like? Your help page example only
> shows the command passing a "ksm stable tree node address".
'kmem -m' will display all the ksm pages.
I meant could you show an example of "kmem -m"...
> How would a user know what one of those addresses would be?
From the structure "rmap_item" ? it has a member "head" that points
to a ksm stable tree node.
So does "kmem -m" show a list of those addresses?
>
> And for "kmem -m <address>", what if there are dozens of PIDs that
> are mapping the same physical address? Regardless of the size of
> the display window, eventually it would get messy if it extends to
> more than one line. I try to avoid having commands extend beyond
> 80 columns if at all possible.
>
Hmm. If there are quite many PIDs, can the output be like below?
PID: 15864 16781 16782 16783
793005000: 8713 5584 23 23
12222 13333 14444 15555
232 232 334 456
...
Well, that's not much clearer -- it's difficult to tell whether the
numbers are PIDs or counts.
Dave