From: Ethan Solomita <solo@google.com>
To: Christoph Lameter <clameter@sgi.com>
Cc: linux-mm@kvack.org
Subject: Re: meminfo returns inaccurate NR_FILE_PAGES
Date: Tue, 17 Apr 2007 23:13:37 -0700 [thread overview]
Message-ID: <4625B711.8060400@google.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0704172236140.4205@schroedinger.engr.sgi.com>
Christoph Lameter wrote:
> On Tue, 17 Apr 2007, Ethan Solomita wrote:
>
>
>> Anonymous pages have a value in mapping, but it's not a struct
>> address_space, it's a struct vm_area_struct (+1). The NR_FILE_PAGES count is
>>
>
> Wrong. Anonymous pages can be a part of swap space which is an
> address_space.
>
> from include/linux/mm.h
>
> extern struct address_space swapper_space;
> static inline struct address_space *page_mapping(struct page *page)
> {
> struct address_space *mapping = page->mapping;
>
> if (unlikely(PageSwapCache(page)))
> mapping = &swapper_space;
> else if (unlikely((unsigned long)mapping & PAGE_MAPPING_ANON))
> mapping = NULL;
> return mapping;
> }
>
While you're busy correcting me, look in swap_state.c at
__add_to_swap_cache(). Note how, when it inserts a page into
swapper_space.page_tree, it then does an
__inc_zone_page_state(NR_FILE_PAGES). Going back to my initial email
reporting the bug you'll see that I make it clear: whenever a page is
inserted into a mapping's page_tree we increment NR_FILE_PAGES.
My comment above was meant to refer to anonymous mappings ala
PAGE_MAPPING_ANON.
>> of lines in migrate_page_move_mapping() after modifying *radix_pointer to call
>> __dec on the old page and __inc on the new. You can check the zones first if
>> you'd like to save effort, although I'm not sure it's a big deal since the
>> __dec and __inc functions are only modifying per-cpu accumulation variables.
>>
>
> Ok. That is what the patch does. So please test the patch and get back
> to me.
>
I'll test it when it works, i.e. when you remove the check for
PAGE_ANON. There is a one-to-one correspondence -- except in migrate.c
-- of adding/removing a page from *ANY* page_tree and inc/dec'ing
NR_FILE_PAGES. There's no reason for migrate to make an exception and
check for PAGE_ANON.
-- Ethan
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2007-04-18 6:13 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-17 23:12 meminfo returns inaccurate NR_FILE_PAGES Ethan Solomita
2007-04-17 23:56 ` Christoph Lameter
2007-04-18 4:06 ` Ethan Solomita
2007-04-18 5:12 ` Christoph Lameter
2007-04-18 5:31 ` Ethan Solomita
2007-04-18 5:39 ` Christoph Lameter
2007-04-18 6:13 ` Ethan Solomita [this message]
2007-04-18 19:36 ` Christoph Lameter
2007-04-18 19:39 ` Ethan Solomita
2007-04-18 21:02 ` Christoph Lameter
2007-04-18 4:49 ` Ethan Solomita
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=4625B711.8060400@google.com \
--to=solo@google.com \
--cc=clameter@sgi.com \
--cc=linux-mm@kvack.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.