From: Konstantin Khlebnikov <khlebnikov@openvz.org>
To: linux-mm@kvack.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH RFC 09/15] mm: handle book relocks on lumpy reclaim
Date: Thu, 16 Feb 2012 02:57:40 +0400 [thread overview]
Message-ID: <20120215225740.22050.35218.stgit@zurg> (raw)
In-Reply-To: <20120215224221.22050.80605.stgit@zurg>
Prepare for lock splitting in move_active_pages_to_lru() and putback_inactive_pages()
on lumpy reclaim they can put pages into different books.
Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
---
mm/vmscan.c | 26 ++++++++++++++++++--------
1 files changed, 18 insertions(+), 8 deletions(-)
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 0b973ff..9a3fb72 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1335,7 +1335,10 @@ static int too_many_isolated(struct zone *zone, int file,
return isolated > inactive;
}
-static noinline_for_stack void
+/*
+ * Returns currently locked book
+ */
+static noinline_for_stack struct book *
putback_inactive_pages(struct book *book,
struct list_head *page_list)
{
@@ -1386,6 +1389,8 @@ putback_inactive_pages(struct book *book,
* To save our caller's stack, now use input list for pages to free.
*/
list_splice(&pages_to_free, page_list);
+
+ return book;
}
static noinline_for_stack void
@@ -1555,7 +1560,7 @@ shrink_inactive_list(unsigned long nr_to_scan, struct book *book,
__count_vm_events(KSWAPD_STEAL, nr_reclaimed);
__count_zone_vm_events(PGSTEAL, zone, nr_reclaimed);
- putback_inactive_pages(book, &page_list);
+ book = putback_inactive_pages(book, &page_list);
__mod_zone_page_state(zone, NR_ISOLATED_ANON, -nr_anon);
__mod_zone_page_state(zone, NR_ISOLATED_FILE, -nr_file);
@@ -1614,12 +1619,15 @@ shrink_inactive_list(unsigned long nr_to_scan, struct book *book,
*
* The downside is that we have to touch page->_count against each page.
* But we had to alter page->flags anyway.
+ *
+ * Returns currently locked book
*/
-static void move_active_pages_to_lru(struct book *book,
- struct list_head *list,
- struct list_head *pages_to_free,
- enum lru_list lru)
+static struct book *
+move_active_pages_to_lru(struct book *book,
+ struct list_head *list,
+ struct list_head *pages_to_free,
+ enum lru_list lru)
{
unsigned long pgmoved = 0;
struct page *page;
@@ -1667,6 +1675,8 @@ static void move_active_pages_to_lru(struct book *book,
__mod_zone_page_state(book_zone(book), NR_LRU_BASE + lru, pgmoved);
if (!is_active_lru(lru))
__count_vm_events(PGDEACTIVATE, pgmoved);
+
+ return book;
}
static void shrink_active_list(unsigned long nr_to_scan,
@@ -1755,9 +1765,9 @@ static void shrink_active_list(unsigned long nr_to_scan,
*/
reclaim_stat->recent_rotated[file] += nr_rotated;
- move_active_pages_to_lru(book, &l_active, &l_hold,
+ book = move_active_pages_to_lru(book, &l_active, &l_hold,
LRU_ACTIVE + file * LRU_FILE);
- move_active_pages_to_lru(book, &l_inactive, &l_hold,
+ book = move_active_pages_to_lru(book, &l_inactive, &l_hold,
LRU_BASE + file * LRU_FILE);
__mod_zone_page_state(zone, NR_ISOLATED_ANON + file, -nr_taken);
unlock_book_irq(book);
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
WARNING: multiple messages have this Message-ID (diff)
From: Konstantin Khlebnikov <khlebnikov@openvz.org>
To: linux-mm@kvack.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH RFC 09/15] mm: handle book relocks on lumpy reclaim
Date: Thu, 16 Feb 2012 02:57:40 +0400 [thread overview]
Message-ID: <20120215225740.22050.35218.stgit@zurg> (raw)
In-Reply-To: <20120215224221.22050.80605.stgit@zurg>
Prepare for lock splitting in move_active_pages_to_lru() and putback_inactive_pages()
on lumpy reclaim they can put pages into different books.
Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
---
mm/vmscan.c | 26 ++++++++++++++++++--------
1 files changed, 18 insertions(+), 8 deletions(-)
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 0b973ff..9a3fb72 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1335,7 +1335,10 @@ static int too_many_isolated(struct zone *zone, int file,
return isolated > inactive;
}
-static noinline_for_stack void
+/*
+ * Returns currently locked book
+ */
+static noinline_for_stack struct book *
putback_inactive_pages(struct book *book,
struct list_head *page_list)
{
@@ -1386,6 +1389,8 @@ putback_inactive_pages(struct book *book,
* To save our caller's stack, now use input list for pages to free.
*/
list_splice(&pages_to_free, page_list);
+
+ return book;
}
static noinline_for_stack void
@@ -1555,7 +1560,7 @@ shrink_inactive_list(unsigned long nr_to_scan, struct book *book,
__count_vm_events(KSWAPD_STEAL, nr_reclaimed);
__count_zone_vm_events(PGSTEAL, zone, nr_reclaimed);
- putback_inactive_pages(book, &page_list);
+ book = putback_inactive_pages(book, &page_list);
__mod_zone_page_state(zone, NR_ISOLATED_ANON, -nr_anon);
__mod_zone_page_state(zone, NR_ISOLATED_FILE, -nr_file);
@@ -1614,12 +1619,15 @@ shrink_inactive_list(unsigned long nr_to_scan, struct book *book,
*
* The downside is that we have to touch page->_count against each page.
* But we had to alter page->flags anyway.
+ *
+ * Returns currently locked book
*/
-static void move_active_pages_to_lru(struct book *book,
- struct list_head *list,
- struct list_head *pages_to_free,
- enum lru_list lru)
+static struct book *
+move_active_pages_to_lru(struct book *book,
+ struct list_head *list,
+ struct list_head *pages_to_free,
+ enum lru_list lru)
{
unsigned long pgmoved = 0;
struct page *page;
@@ -1667,6 +1675,8 @@ static void move_active_pages_to_lru(struct book *book,
__mod_zone_page_state(book_zone(book), NR_LRU_BASE + lru, pgmoved);
if (!is_active_lru(lru))
__count_vm_events(PGDEACTIVATE, pgmoved);
+
+ return book;
}
static void shrink_active_list(unsigned long nr_to_scan,
@@ -1755,9 +1765,9 @@ static void shrink_active_list(unsigned long nr_to_scan,
*/
reclaim_stat->recent_rotated[file] += nr_rotated;
- move_active_pages_to_lru(book, &l_active, &l_hold,
+ book = move_active_pages_to_lru(book, &l_active, &l_hold,
LRU_ACTIVE + file * LRU_FILE);
- move_active_pages_to_lru(book, &l_inactive, &l_hold,
+ book = move_active_pages_to_lru(book, &l_inactive, &l_hold,
LRU_BASE + file * LRU_FILE);
__mod_zone_page_state(zone, NR_ISOLATED_ANON + file, -nr_taken);
unlock_book_irq(book);
next prev parent reply other threads:[~2012-02-15 22:57 UTC|newest]
Thread overview: 62+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-15 22:57 [PATCH RFC 00/15] mm: memory book keeping and lru_lock splitting Konstantin Khlebnikov
2012-02-15 22:57 ` Konstantin Khlebnikov
2012-02-15 22:57 ` [PATCH RFC 01/15] mm: rename struct lruvec into struct book Konstantin Khlebnikov
2012-02-15 22:57 ` Konstantin Khlebnikov
2012-02-15 22:57 ` [PATCH RFC 02/15] mm: memory bookkeeping core Konstantin Khlebnikov
2012-02-15 22:57 ` Konstantin Khlebnikov
2012-02-15 22:57 ` [PATCH RFC 03/15] mm: add book->pages_count Konstantin Khlebnikov
2012-02-15 22:57 ` Konstantin Khlebnikov
2012-02-15 22:57 ` [PATCH RFC 04/15] mm: unify inactive_list_is_low() Konstantin Khlebnikov
2012-02-15 22:57 ` Konstantin Khlebnikov
2012-02-15 22:57 ` [PATCH RFC 05/15] mm: add book->reclaim_stat Konstantin Khlebnikov
2012-02-15 22:57 ` Konstantin Khlebnikov
2012-02-15 22:57 ` [PATCH RFC 06/15] mm: kill struct mem_cgroup_zone Konstantin Khlebnikov
2012-02-15 22:57 ` Konstantin Khlebnikov
2012-02-15 22:57 ` [PATCH RFC 07/15] mm: move page-to-book translation upper Konstantin Khlebnikov
2012-02-15 22:57 ` Konstantin Khlebnikov
2012-02-15 22:57 ` [PATCH RFC 08/15] mm: introduce book locking primitives Konstantin Khlebnikov
2012-02-15 22:57 ` Konstantin Khlebnikov
2012-02-15 22:57 ` Konstantin Khlebnikov [this message]
2012-02-15 22:57 ` [PATCH RFC 09/15] mm: handle book relocks on lumpy reclaim Konstantin Khlebnikov
2012-02-15 22:57 ` [PATCH RFC 10/15] mm: handle book relocks in compaction Konstantin Khlebnikov
2012-02-15 22:57 ` Konstantin Khlebnikov
2012-02-15 22:57 ` [PATCH RFC 11/15] mm: handle book relock in memory controller Konstantin Khlebnikov
2012-02-15 22:57 ` Konstantin Khlebnikov
2012-02-15 22:57 ` [PATCH RFC 12/15] mm: optimize books in update_page_reclaim_stat() Konstantin Khlebnikov
2012-02-15 22:57 ` Konstantin Khlebnikov
2012-02-15 22:57 ` [PATCH RFC 13/15] mm: optimize books in pagevec_lru_move_fn() Konstantin Khlebnikov
2012-02-15 22:57 ` Konstantin Khlebnikov
2012-02-15 22:57 ` [PATCH RFC 14/15] mm: optimize putback for 0-order reclaim Konstantin Khlebnikov
2012-02-15 22:57 ` Konstantin Khlebnikov
2012-02-15 22:58 ` [PATCH RFC 15/15] mm: split zone->lru_lock Konstantin Khlebnikov
2012-02-15 22:58 ` Konstantin Khlebnikov
2012-02-16 2:04 ` [PATCH RFC 00/15] mm: memory book keeping and lru_lock splitting KAMEZAWA Hiroyuki
2012-02-16 2:04 ` KAMEZAWA Hiroyuki
2012-02-16 5:43 ` Konstantin Khlebnikov
2012-02-16 5:43 ` Konstantin Khlebnikov
2012-02-16 8:24 ` KAMEZAWA Hiroyuki
2012-02-16 8:24 ` KAMEZAWA Hiroyuki
2012-02-16 11:02 ` Konstantin Khlebnikov
2012-02-16 11:02 ` Konstantin Khlebnikov
2012-02-16 15:54 ` Konstantin Khlebnikov
2012-02-16 15:54 ` Konstantin Khlebnikov
2012-02-16 23:54 ` KAMEZAWA Hiroyuki
2012-02-16 23:54 ` KAMEZAWA Hiroyuki
2012-02-18 9:09 ` Konstantin Khlebnikov
2012-02-18 9:09 ` Konstantin Khlebnikov
2012-02-16 2:37 ` Hugh Dickins
2012-02-16 2:37 ` Hugh Dickins
2012-02-16 4:51 ` Konstantin Khlebnikov
2012-02-16 4:51 ` Konstantin Khlebnikov
2012-02-16 21:37 ` Hugh Dickins
2012-02-16 21:37 ` Hugh Dickins
2012-02-17 19:56 ` Konstantin Khlebnikov
2012-02-17 19:56 ` Konstantin Khlebnikov
2012-02-18 2:13 ` Hugh Dickins
2012-02-18 2:13 ` Hugh Dickins
2012-02-18 6:35 ` Konstantin Khlebnikov
2012-02-18 6:35 ` Konstantin Khlebnikov
2012-02-18 7:14 ` Hugh Dickins
2012-02-18 7:14 ` Hugh Dickins
2012-02-20 0:32 ` KAMEZAWA Hiroyuki
2012-02-20 0:32 ` KAMEZAWA Hiroyuki
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=20120215225740.22050.35218.stgit@zurg \
--to=khlebnikov@openvz.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 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.