mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steve Chiang <windtracekimo@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: Question about page count
Date: Thu, 16 Jun 2011 00:34:39 +0000 (UTC)	[thread overview]
Message-ID: <loom.20110616T022434-391@post.gmane.org> (raw)

Hi, 
i am currently analyzing the memory pages footprint in 2.6.18.8 kernel (1GB ram,
32-bit, Flat model, no NUMA), and got a question. Does page_count(page)==0
really means the page is free because the source code says so?

If I just traverse mem_map for all memory descriptor, and count how many of them
has page_count 0, then the number of free page will exceed the MemFree number
reported from /proc/meminfo (actually from the zone list).

After some investigation, I figure out that page->flags actually encode the zone
information (DMA, NORMAL, HIGHMEM), and some of the page descriptors do not have
correct zone number. But filtering them out doesn't help.

In my case, HIGHMEM has 61 free pages reported by /proc/meminfo, but when I
traverse the page descriptors array from (896MB - 1024MB), I count the pages with
(1) flags stating its zone == ZONE_HIGHMEM
(2) page_count(page)==0
My result is 186 but not 61.

Could anyone help on explaining this?

Thanks,
Steve


                 reply	other threads:[~2011-06-16  0:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=loom.20110616T022434-391@post.gmane.org \
    --to=windtracekimo@gmail.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®