From: "Richard F. Rebel" <rrebel@whenu.com>
To: Mauricio Lin <mauriciolin@gmail.com>
Cc: Hugh Dickins <hugh@veritas.com>,
linux-kernel@vger.kernel.org,
Marcelo Tosatti <marcelo.tosatti@cyclades.com>
Subject: Re: /proc/*/statm, exactly what does "shared" mean?
Date: Wed, 16 Feb 2005 10:17:01 -0500 [thread overview]
Message-ID: <1108567021.32711.529.camel@rebel.corp.whenu.com> (raw)
In-Reply-To: <3f250c7105021607022362013c@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2156 bytes --]
Hello,
I have heard that this particular information, while very important to
userland developers like me, is probably too expensive to keep track of
for most users.
Perhaps a way to enable it for developers, whom are willing to spend the
cpu cycles, and disable it for regular use would be a solution.
Would it be possible develop a solution allowing us to enable/disable
this tracking via a sysctl call?
Richard F. Rebel
On Wed, 2005-02-16 at 11:02 -0400, Mauricio Lin wrote:
> Hi Hugh,
>
> Thanks by your suggestion. I did not know that kernel 2.4.29 has
> changed the statm implementation. As I can see the statm
> implementation is different between 2.4 and 2.6.
>
> Let me see if I can use the 2.4.29 statm idea to improve the smaps for
> kernel 2.6.11-rc.
>
> BR,
>
> Mauricio Lin.
>
> On Wed, 16 Feb 2005 12:00:55 +0000 (GMT), Hugh Dickins <hugh@veritas.com> wrote:
> > On Wed, 16 Feb 2005, Mauricio Lin wrote:
> > > Well, for each vma it is checked how many pages are mapped to rss. So
> > > I have to check per page if it is allocated in physical memory. I know
> > > that this is a heavy function, but do you have any suggestion to
> > > improve this? What do you mean "needs refactoring into pgd_range,
> > > pud_range, pmd_range, pte_range levels like 2.4's statm"? Could you
> > > give more details, please?
> >
> > Just look at, say, linux-2.4.29/fs/proc/array.c proc_pid_statm:
> > which calls statm_pgd_range which calls statm_pmd_range which
> > calls statm_pte_range which scans along the array of ptes doing
> > the pte examination you're doing. There are plenty of examples
> > in 2.6.11-rc mm/memory.c of how to do it with pud level too.
> >
> > Whereas your way starts at the top and descends the tree each time
> > for every leaf, repeatedly mapping and unmapping the page table if
> > that pagetable is in highmem. You took follow_page as your starting
> > point, which is good for a single pte, but inefficient for many.
> >
> > Your function(s) will still be heavyweight, but somewhat faster.
> >
> > Hugh
> >
--
Richard F. Rebel
cat /dev/null > `tty`
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2005-02-16 15:17 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-11 22:32 Richard F. Rebel
2005-02-12 13:06 ` Hugh Dickins
2005-02-12 14:39 ` Richard F. Rebel
2005-02-12 15:42 ` Hugh Dickins
2005-02-16 10:41 ` Mauricio Lin
2005-02-16 12:00 ` Hugh Dickins
2005-02-16 15:02 ` Mauricio Lin
2005-02-16 15:17 ` Richard F. Rebel [this message]
2005-02-16 16:10 ` Hugh Dickins
2005-02-17 16:33 ` Richard F. Rebel
2005-02-16 15:58 ` Hugh Dickins
2005-02-16 14:52 ` Benjamin LaHaise
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=1108567021.32711.529.camel@rebel.corp.whenu.com \
--to=rrebel@whenu.com \
--cc=hugh@veritas.com \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo.tosatti@cyclades.com \
--cc=mauriciolin@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®