From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Hou Pengyang <houpengyang@huawei.com>
Cc: mingo@redhat.com, namhyung@kernel.org, a.p.zijlstra@chello.nl,
wangnan0@huawei.com, linux-kernel@vger.kernel.org,
zhu.wen-jie@hp.com
Subject: Re: [RFC] perf tools: Add hugetlbfs memory recognition
Date: Fri, 3 Jul 2015 12:16:36 -0300 [thread overview]
Message-ID: <20150703151636.GA3976@kernel.org> (raw)
In-Reply-To: <5596623C.6060404@huawei.com>
Em Fri, Jul 03, 2015 at 06:21:48PM +0800, Hou Pengyang escreveu:
> On 2015/6/30 22:50, Arnaldo Carvalho de Melo wrote:
> >Well, we _can_ detect this automatically, its just a matter of parsing
> >/proc/PID/smaps, right?
<SNIP>
> >What I was discussing was a way only parse smaps when we know we need
> >to, i.e. when we, for instance, parsing /proc/PID/maps, find a map that
> >we think may be a hugetlb one, maybe some other way to tell us that
> >hugetlb maps are in place, looking at the hugetlbfs stats somehow?
<SNIP>
> from /proc/self/mounts, we can get mount point of hugetlbfs.
> in my system, it is "/mnt/huge". So that, when mmap2 event
> comes from userspace, we can compare prefix of filename with
> hugetlbfs mount point (e.g "/mnt/huge") to check if it is a
> file in hugetlbfs. if it is, set MAP_HUGELTB, otherwise, not set.
> There is no need to parse /proc/PID/smaps now, what's more,
> it is not difficult to parse "/proc/self/mounts".
A-ha! please take a look at using the find_mountpoint() function
in tools/lib/api/fs/, I guess that should be enough for you?
- Arnaldo
prev parent reply other threads:[~2015-07-03 15:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-27 8:49 [RFC] perf tools: Add hugetlbfs memory recognition Hou Pengyang
2015-06-27 9:08 ` Hou Pengyang
2015-06-29 13:23 ` Arnaldo Carvalho de Melo
2015-06-29 13:42 ` Arnaldo Carvalho de Melo
2015-06-30 9:33 ` Hou Pengyang
2015-06-30 14:50 ` Arnaldo Carvalho de Melo
2015-07-03 10:21 ` Hou Pengyang
2015-07-03 15:16 ` Arnaldo Carvalho de Melo [this message]
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=20150703151636.GA3976@kernel.org \
--to=acme@kernel.org \
--cc=a.p.zijlstra@chello.nl \
--cc=houpengyang@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=wangnan0@huawei.com \
--cc=zhu.wen-jie@hp.com \
/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.