From: clameter@sgi.com
To: linux-mm@kvack.org
Cc: Mel Gorman <mel@skynet.ie>,
William Lee Irwin III <wli@holomorphy.com>,
Adam Litke <aglitke@gmail.com>, David Chinner <dgc@sgi.com>,
Jens Axboe <jens.axboe@oracle.com>, Avi Kivity <avi@argo.co.il>,
Dave Hansen <hansendc@us.ibm.com>,
Badari Pulavarty <pbadari@gmail.com>,
Maxim Levitsky <maximlevitsky@gmail.com>
Subject: [RFC 02/16] vmstat.c: Support accounting for compound pages
Date: Sun, 22 Apr 2007 23:21:09 -0700 [thread overview]
Message-ID: <20070423062129.317055444@sgi.com> (raw)
In-Reply-To: <20070423062107.843307112@sgi.com>
[-- Attachment #1: var_pc_vmstat --]
[-- Type: text/plain, Size: 3231 bytes --]
Compound pages must increment the counters in terms of base pages.
If we detect a compound page then add the number of base pages that
a compound page has to the counter.
This will avoid numerous changes in the VM to fix up page accounting
as we add more support for compound pages.
Also fix up the accounting for active / inactive pages.
Signed-off-by: Christoph Lameter <clameter@sgi.com>
---
include/linux/mm_inline.h | 12 ++++++------
mm/vmstat.c | 8 +++-----
2 files changed, 9 insertions(+), 11 deletions(-)
Index: linux-2.6.21-rc7/mm/vmstat.c
===================================================================
--- linux-2.6.21-rc7.orig/mm/vmstat.c 2007-04-21 23:35:49.000000000 -0700
+++ linux-2.6.21-rc7/mm/vmstat.c 2007-04-21 23:35:59.000000000 -0700
@@ -223,7 +223,7 @@ void __inc_zone_state(struct zone *zone,
void __inc_zone_page_state(struct page *page, enum zone_stat_item item)
{
- __inc_zone_state(page_zone(page), item);
+ __mod_zone_page_state(page_zone(page), item, base_pages(page));
}
EXPORT_SYMBOL(__inc_zone_page_state);
@@ -244,7 +244,7 @@ void __dec_zone_state(struct zone *zone,
void __dec_zone_page_state(struct page *page, enum zone_stat_item item)
{
- __dec_zone_state(page_zone(page), item);
+ __mod_zone_page_state(page_zone(page), item, -base_pages(page));
}
EXPORT_SYMBOL(__dec_zone_page_state);
@@ -260,11 +260,9 @@ void inc_zone_state(struct zone *zone, e
void inc_zone_page_state(struct page *page, enum zone_stat_item item)
{
unsigned long flags;
- struct zone *zone;
- zone = page_zone(page);
local_irq_save(flags);
- __inc_zone_state(zone, item);
+ __inc_zone_page_state(page, item);
local_irq_restore(flags);
}
EXPORT_SYMBOL(inc_zone_page_state);
Index: linux-2.6.21-rc7/include/linux/mm_inline.h
===================================================================
--- linux-2.6.21-rc7.orig/include/linux/mm_inline.h 2007-04-22 00:20:15.000000000 -0700
+++ linux-2.6.21-rc7/include/linux/mm_inline.h 2007-04-22 00:21:12.000000000 -0700
@@ -2,28 +2,28 @@ static inline void
add_page_to_active_list(struct zone *zone, struct page *page)
{
list_add(&page->lru, &zone->active_list);
- __inc_zone_state(zone, NR_ACTIVE);
+ __inc_zone_page_state(page, NR_ACTIVE);
}
static inline void
add_page_to_inactive_list(struct zone *zone, struct page *page)
{
list_add(&page->lru, &zone->inactive_list);
- __inc_zone_state(zone, NR_INACTIVE);
+ __inc_zone_page_state(page, NR_INACTIVE);
}
static inline void
del_page_from_active_list(struct zone *zone, struct page *page)
{
list_del(&page->lru);
- __dec_zone_state(zone, NR_ACTIVE);
+ __dec_zone_page_state(page, NR_ACTIVE);
}
static inline void
del_page_from_inactive_list(struct zone *zone, struct page *page)
{
list_del(&page->lru);
- __dec_zone_state(zone, NR_INACTIVE);
+ __dec_zone_page_state(page, NR_INACTIVE);
}
static inline void
@@ -32,9 +32,9 @@ del_page_from_lru(struct zone *zone, str
list_del(&page->lru);
if (PageActive(page)) {
__ClearPageActive(page);
- __dec_zone_state(zone, NR_ACTIVE);
+ __dec_zone_page_state(page, NR_ACTIVE);
} else {
- __dec_zone_state(zone, NR_INACTIVE);
+ __dec_zone_page_state(page, NR_INACTIVE);
}
}
--
next prev parent reply other threads:[~2007-04-23 6:21 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-23 6:21 [RFC 00/16] Variable Order Page Cache Patchset V2 clameter
2007-04-23 6:21 ` [RFC 01/16] Free up page->private for compound pages clameter
2007-04-23 6:21 ` clameter [this message]
2007-04-23 6:21 ` [RFC 03/16] Variable Order Page Cache: Add order field in mapping clameter
2007-04-23 6:21 ` [RFC 04/16] Variable Order Page Cache: Add basic allocation functions clameter
2007-04-23 6:21 ` [RFC 05/16] Variable Order Page Cache: Add functions to establish sizes clameter
2007-04-23 6:21 ` [RFC 06/16] Variable Page Cache: Add VM_BUG_ONs to check for correct page order clameter
2007-04-23 6:21 ` [RFC 07/16] Variable Order Page Cache: Add clearing and flushing function clameter
2007-04-23 6:21 ` [RFC 08/16] Variable Order Page Cache: Fixup fallback functions clameter
2007-04-23 6:21 ` [RFC 09/16] Variable Order Page Cache: Fix up mm/filemap.c clameter
2007-04-23 6:21 ` [RFC 10/16] Variable Order Page Cache: Readahead fixups clameter
2007-04-23 6:21 ` [RFC 11/16] Variable Page Cache Size: Fix up reclaim counters clameter
2007-04-23 6:21 ` [RFC 12/16] Variable Order Page Cache: Fix up the writeback logic clameter
2007-04-23 6:21 ` [RFC 13/16] Variable Order Page Cache: Fixed to block layer clameter
2007-04-23 6:21 ` [RFC 14/16] Variable Order Page Cache: Add support to ramfs clameter
2007-04-23 6:21 ` [RFC 15/16] ext2: Add variable page size support clameter
2007-04-23 6:21 ` [RFC 16/16] Variable Order Page Cache: Alternate implementation of page cache macros clameter
2007-04-23 6:48 [RFC 00/16] Variable Order Page Cache Patchset V2 Christoph Lameter
2007-04-23 6:48 ` [RFC 02/16] vmstat.c: Support accounting for compound pages Christoph Lameter
2007-04-25 10:59 ` Mel Gorman
2007-04-25 15:43 ` Christoph Lameter
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=20070423062129.317055444@sgi.com \
--to=clameter@sgi.com \
--cc=aglitke@gmail.com \
--cc=avi@argo.co.il \
--cc=dgc@sgi.com \
--cc=hansendc@us.ibm.com \
--cc=jens.axboe@oracle.com \
--cc=linux-mm@kvack.org \
--cc=maximlevitsky@gmail.com \
--cc=mel@skynet.ie \
--cc=pbadari@gmail.com \
--cc=wli@holomorphy.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