Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1176650

Re: [RFC] perf tools: Add hugetlbfs memory recognition

From Arnaldo Carvalho de Melo <acme@kernel.org>
Newsgroups linux.kernel
Subject Re: [RFC] perf tools: Add hugetlbfs memory recognition
Date 2015-07-03 17:20 +0200
Message-ID <pIaUV-1GA-1@gated-at.bofh.it> (permalink)
References (2 earlier) <pGHii-4ed-5@gated-at.bofh.it> <pGHBD-4B0-1@gated-at.bofh.it> <pH0bh-6il-37@gated-at.bofh.it> <pH5aX-54y-53@gated-at.bofh.it> <pI6oh-7jr-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[RFC] perf tools: Add hugetlbfs memory recognition Hou Pengyang <houpengyang@huawei.com> - 2015-06-27 11:00 +0200
  Re: [RFC] perf tools: Add hugetlbfs memory recognition Hou Pengyang <houpengyang@huawei.com> - 2015-06-27 11:10 +0200
    Re: [RFC] perf tools: Add hugetlbfs memory recognition Hou Pengyang <houpengyang@huawei.com> - 2015-06-30 11:40 +0200
      Re: [RFC] perf tools: Add hugetlbfs memory recognition Hou Pengyang <houpengyang@huawei.com> - 2015-07-03 12:30 +0200
        Re: [RFC] perf tools: Add hugetlbfs memory recognition Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-07-03 17:20 +0200

csiph-web