From: Xishi Qiu <qiuxishi@huawei.com>
To: Linux MM <linux-mm@kvack.org>, LKML <linux-kernel@vger.kernel.org>
Subject: [RFC] mm: why cat /proc/pid/smaps | grep Rss is different from cat /proc/pid/statm?
Date: Tue, 22 Mar 2016 21:55:58 +0800 [thread overview]
Message-ID: <56F14EEE.7060308@huawei.com> (raw)
[root@localhost c_test]# cat /proc/3948/smaps | grep Rss
Rss: 4 kB
Rss: 4 kB
Rss: 4 kB
Rss: 796 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: 12 kB
Rss: 0 kB
Rss: 4 kB
Rss: 0 kB
[root@localhost c_test]# cat /proc/3948/statm
1042 173 154 1 0 48 0
173 means Rss is 173*4kb=692kb, right?
so why it is different from the sum(1020kb) of "cat /proc/pid/smaps | grep Rss"?
my test code is
...
int main()
{
sleep(1000);
return 0;
}
the kernel version is v4.1
Thanks,
Xishi Qiu
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
WARNING: multiple messages have this Message-ID (diff)
From: Xishi Qiu <qiuxishi@huawei.com>
To: Linux MM <linux-mm@kvack.org>, LKML <linux-kernel@vger.kernel.org>
Subject: [RFC] mm: why cat /proc/pid/smaps | grep Rss is different from cat /proc/pid/statm?
Date: Tue, 22 Mar 2016 21:55:58 +0800 [thread overview]
Message-ID: <56F14EEE.7060308@huawei.com> (raw)
[root@localhost c_test]# cat /proc/3948/smaps | grep Rss
Rss: 4 kB
Rss: 4 kB
Rss: 4 kB
Rss: 796 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: 12 kB
Rss: 0 kB
Rss: 4 kB
Rss: 0 kB
[root@localhost c_test]# cat /proc/3948/statm
1042 173 154 1 0 48 0
173 means Rss is 173*4kb=692kb, right?
so why it is different from the sum(1020kb) of "cat /proc/pid/smaps | grep Rss"?
my test code is
...
int main()
{
sleep(1000);
return 0;
}
the kernel version is v4.1
Thanks,
Xishi Qiu
next reply other threads:[~2016-03-22 13:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-22 13:55 Xishi Qiu [this message]
2016-03-22 13:55 ` [RFC] mm: why cat /proc/pid/smaps | grep Rss is different from cat /proc/pid/statm? Xishi Qiu
2016-03-22 14:47 ` Shakeel Butt
2016-03-30 7:16 ` Xishi Qiu
2016-03-30 7:16 ` Xishi Qiu
2016-03-30 9:39 ` Xishi Qiu
2016-03-30 9:39 ` Xishi Qiu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56F14EEE.7060308@huawei.com \
--to=qiuxishi@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.