From: Jesse Barnes <jbarnes@engr.sgi.com>
To: mita akinobu <amgta@yacht.ocn.ne.jp>
Cc: linux-kernel@vger.kernel.org, Andrew Morton <akpm@osdl.org>,
Matthew Dobson <colpatch@us.ibm.com>
Subject: Re: [PATCH] shows Active/Inactive on per-node meminfo
Date: Fri, 20 Aug 2004 15:01:31 -0400 [thread overview]
Message-ID: <200408201501.31542.jbarnes@engr.sgi.com> (raw)
In-Reply-To: <200408201448.22566.jbarnes@engr.sgi.com>
On Friday, August 20, 2004 2:48 pm, Jesse Barnes wrote:
> On Friday, August 20, 2004 2:02 pm, mita akinobu wrote:
> > + for (i = 0; i < MAX_NR_ZONES; i++) {
> > + *active += zones[i].nr_active;
> > + *inactive += zones[i].nr_inactive;
> > + *free += zones[i].free_pages;
> > + }
> > +}
> > +
> > - *free += zone->free_pages;
> > + for_each_pgdat(pgdat) {
> > + unsigned long l, m, n;
> > + __get_zone_counts(&l, &m, &n, pgdat);
> > + *active += l;
> > + *inactive += m;
> > + *free += n;
> > }
>
> Just FYI, loops like this are going to be very slow on a large machine.
> Iterating over every node in the system involves a TLB miss on every
> iteration along with an offnode reference and possibly cacheline demotion.
...but I see that you're just adding the info to the per-node meminfo files,
so it should be ok as long as people access a node's meminfo file from a
local cpu. /proc/meminfo will still hurt a lot though.
I bring this up because I ran into it once. I created a file
called /proc/discontig which printed out detailed per-node memory stats, one
node per line. On a large system it would literally take several seconds to
cat the file due to the overhead of looking at all the pages and zone
structures.
Jesse
next prev parent reply other threads:[~2004-08-20 19:07 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-20 18:02 mita akinobu
2004-08-20 18:48 ` Jesse Barnes
2004-08-20 19:01 ` Jesse Barnes [this message]
2004-08-20 22:25 ` Andrew Morton
2004-08-20 23:08 ` Matthew Dobson
2004-08-21 20:09 ` Jesse Barnes
2004-08-21 6:29 ` mita akinobu
2004-08-21 20:11 ` Jesse Barnes
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=200408201501.31542.jbarnes@engr.sgi.com \
--to=jbarnes@engr.sgi.com \
--cc=akpm@osdl.org \
--cc=amgta@yacht.ocn.ne.jp \
--cc=colpatch@us.ibm.com \
--cc=linux-kernel@vger.kernel.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 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®