9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Kyohei Kadota <lufia@lufia.org>
To: 9fans <9fans@9fans.net>
Subject: Re: [9fans] Re: /proc/n/status's memory field
Date: Mon, 17 Aug 2020 20:37:51 +0900	[thread overview]
Message-ID: <CAFMepcmipukYGRKz5qfctdPeCZQUBnxnC4PXXB2_E2H6ykJgqA@mail.gmail.com> (raw)
In-Reply-To: <20200815045057.GA585648@alice>

Thanks.

I've misread Labs kernel's initial index to zero until now.

2020年8月15日(土) 13:51 Anthony Martin <ality@pbrane.org>:
>
> Kyohei Kadota <lufia@lufia.org> once said:
> > I'm reading proc(3). It describes the status file:
> >
> > > the amount of memory used by the process, except its stack, in units of 1024 bytes
> >
> > In /sys/src/9/pc/port/proc.c, it seems to me that procread sums all
> > segment's size for that.
> > Is the above statement correct?
>
> The Labs kernel loops over [1,NSEG) to sum the segment sizes.
> The index of the stack segment, SSEG, is zero so it is skipped.
> This measurement is the total virtual address space in use by
> the process minus the stack.
>
> The 9front kernel loops over [0,NSEG) to scan the virtual page
> table of each segment for used pages, summing as it goes. This
> measurement is the total amount of memory in use by the process.
>
> Cheers,
>   Anthony
>
> ------------------------------------------
> 9fans: 9fans
> Permalink: https://9fans.topicbox.com/groups/9fans/Tc2c9fe27a3a2dd4c-M9bf220c6eb9f6bf0e10d813e
> Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

      reply	other threads:[~2020-08-17 11:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-14 17:54 Kyohei Kadota
2020-08-15  4:50 ` Anthony Martin
2020-08-17 11:37   ` Kyohei Kadota [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=CAFMepcmipukYGRKz5qfctdPeCZQUBnxnC4PXXB2_E2H6ykJgqA@mail.gmail.com \
    --to=lufia@lufia.org \
    --cc=9fans@9fans.net \
    /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;
as well as URLs for NNTP newsgroup(s).