From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: kosaki.motohiro@jp.fujitsu.com, linux-mm <linux-mm@kvack.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH 5/5] move PGDEACTIVATE modification to shrink_active_list()
Date: Thu, 16 Jul 2009 17:40:53 +0900 (JST) [thread overview]
Message-ID: <20090716174018.9D57.A69D9226@jp.fujitsu.com> (raw)
In-Reply-To: <20090716173449.9D4B.A69D9226@jp.fujitsu.com>
Subject: move PGDEACTIVATE modification to shrink_active_list()
Pgmoved accounting in move_active_pages_to_lru() doesn't make any sense.
it can be calculated in irq enabled area.
This patch move #-of-deactivating-pages calcution to shrink_active_list().
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
---
mm/vmscan.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
Index: b/mm/vmscan.c
===================================================================
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1217,7 +1217,6 @@ static void move_active_pages_to_lru(str
struct list_head *list,
enum lru_list lru)
{
- unsigned long pgmoved = 0;
struct pagevec pvec;
struct page *page;
@@ -1231,7 +1230,6 @@ static void move_active_pages_to_lru(str
SetPageLRU(page);
add_page_to_lru_list(zone, page, lru);
- pgmoved++;
if (!pagevec_add(&pvec, page) || list_empty(list)) {
spin_unlock_irq(&zone->lru_lock);
@@ -1241,8 +1239,6 @@ static void move_active_pages_to_lru(str
spin_lock_irq(&zone->lru_lock);
}
}
- if (!is_active_lru(lru))
- __count_vm_events(PGDEACTIVATE, pgmoved);
}
static void shrink_active_list(unsigned long nr_pages, struct zone *zone,
@@ -1257,6 +1253,7 @@ static void shrink_active_list(unsigned
struct page *page;
struct zone_reclaim_stat *reclaim_stat = get_reclaim_stat(zone, sc);
unsigned long nr_rotated = 0;
+ unsigned long nr_deactivate = 0;
lru_add_drain();
spin_lock_irq(&zone->lru_lock);
@@ -1311,6 +1308,7 @@ static void shrink_active_list(unsigned
ClearPageActive(page); /* we are de-activating */
list_add(&page->lru, &l_inactive);
+ nr_deactivate++;
}
/*
@@ -1324,6 +1322,7 @@ static void shrink_active_list(unsigned
* get_scan_ratio.
*/
reclaim_stat->recent_rotated[!!file] += nr_rotated;
+ __count_vm_events(PGDEACTIVATE, nr_deactivate);
move_active_pages_to_lru(zone, &l_active,
LRU_ACTIVE + file * LRU_FILE);
--
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:[~2009-07-16 8:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-16 8:37 [PATCH 1/5] move ClearPageActive from move_active_pages() " KOSAKI Motohiro
2009-07-16 8:38 ` [PATCH 2/5] Kill unnecessary page flag test KOSAKI Motohiro
2009-07-16 8:39 ` [PATCH 3/5] Kill unnecessary prefetch KOSAKI Motohiro
2009-07-16 8:40 ` [PATCH 4/5] Use add_page_to_lru_list() helper function KOSAKI Motohiro
2009-07-17 12:18 ` Peter Zijlstra
2009-07-20 5:37 ` KOSAKI Motohiro
2009-07-20 7:28 ` Peter Zijlstra
2009-07-20 14:30 ` KOSAKI Motohiro
2009-07-16 8:40 ` KOSAKI Motohiro [this message]
2009-07-16 17:14 ` [PATCH 1/5] move ClearPageActive from move_active_pages() to shrink_active_list() Johannes Weiner
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=20090716174018.9D57.A69D9226@jp.fujitsu.com \
--to=kosaki.motohiro@jp.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox