lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <56FB7D37.5070503@huawei.com>
Date:	Wed, 30 Mar 2016 15:16:07 +0800
From:	Xishi Qiu <qiuxishi@...wei.com>
To:	Shakeel Butt <shakeelb@...gle.com>
CC:	Linux MM <linux-mm@...ck.org>, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [RFC] mm: why cat /proc/pid/smaps | grep Rss is different from
 cat /proc/pid/statm?

On 2016/3/22 22:47, Shakeel Butt wrote:

> 
> On Tue, Mar 22, 2016 at 6:55 AM, Xishi Qiu <qiuxishi@...wei.com <mailto:qiuxishi@...wei.com>> wrote:
> 
>     [root@...alhost c_test]# cat /proc/3948/smaps | grep Rss
> 
> The /proc/[pid]/smaps read triggers the traversal of all of process's vmas and then page tables and accumulate RSS on each present page table entry.
> 
>     [root@...alhost c_test]# cat /proc/3948/statm
>     1042 173 154 1 0 48 0
> 
> The files /proc/[pid]/statm and /proc/[pid]/status uses the counters (MM_ANONPAGES & MM_FILEPAGES) in mm_struct to report RSS of a process. These counters are modified on page table modifications. However the kernel implements an optimization where each thread keeps a local copy of these counters in its task_struct. These local counter are accumulated in the shared counter of mm_struct after some number of page faults (I think 32) faced by the thread and thus there will be mismatch with smaps file.
> 
> Shakeel

Hi Shakeel,

I malloc and memset 10M, then sleep. It seems that the problem is still exist,
the kernel version is v4.1

[root@...alhost c_test]# cat /proc/13746/statm
3603 2767 250 1 0 2609 0
[root@...alhost c_test]# cat /proc/13746/smaps | grep Rss
Rss:                   4 kB
Rss:                   4 kB
Rss:                   4 kB
Rss:               10244 kB
Rss:                 924 kB
Rss:                   0 kB
Rss:                  16 kB
Rss:                   8 kB
Rss:                  12 kB
Rss:                 132 kB
Rss:                  12 kB
Rss:                   4 kB
Rss:                   4 kB
Rss:                   4 kB
Rss:                   4 kB
Rss:                   8 kB
Rss:                   0 kB
Rss:                   4 kB
Rss:                   0 kB

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ