From: Konstantin Khlebnikov <khlebnikov@openvz.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: [PATCH 03/12] mm/vmscan: push lruvec pointer into isolate_lru_pages()
Date: Thu, 26 Apr 2012 11:53:59 +0400 [thread overview]
Message-ID: <20120426075359.18961.96466.stgit@zurg> (raw)
In-Reply-To: <20120426074632.18961.17803.stgit@zurg>
This patch moves mem_cgroup_zone_lruvec() call from isolate_lru_pages() into
shrink_[in]active_list(), further patches pushes it to shrink_zone() step by step.
Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
---
mm/vmscan.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/mm/vmscan.c b/mm/vmscan.c
index d81750c..49e79d5 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1027,7 +1027,7 @@ int __isolate_lru_page(struct page *page, isolate_mode_t mode)
* Appropriate locks must be held before calling this function.
*
* @nr_to_scan: The number of pages to look through on the list.
- * @mz: The mem_cgroup_zone to pull pages from.
+ * @lruvec: The LRU vector to pull pages from.
* @dst: The temp list to put pages on to.
* @nr_scanned: The number of pages that were scanned.
* @sc: The scan_control struct for this reclaim session
@@ -1037,17 +1037,15 @@ int __isolate_lru_page(struct page *page, isolate_mode_t mode)
* returns how many pages were moved onto *@dst.
*/
static unsigned long isolate_lru_pages(unsigned long nr_to_scan,
- struct mem_cgroup_zone *mz, struct list_head *dst,
+ struct lruvec *lruvec, struct list_head *dst,
unsigned long *nr_scanned, struct scan_control *sc,
isolate_mode_t mode, enum lru_list lru)
{
- struct lruvec *lruvec;
struct list_head *src;
unsigned long nr_taken = 0;
unsigned long scan;
int file = is_file_lru(lru);
- lruvec = mem_cgroup_zone_lruvec(mz->zone, mz->mem_cgroup);
src = &lruvec->lists[lru];
for (scan = 0; scan < nr_to_scan && !list_empty(src); scan++) {
@@ -1274,6 +1272,7 @@ shrink_inactive_list(unsigned long nr_to_scan, struct mem_cgroup_zone *mz,
int file = is_file_lru(lru);
struct zone *zone = mz->zone;
struct zone_reclaim_stat *reclaim_stat = get_reclaim_stat(mz);
+ struct lruvec *lruvec = mem_cgroup_zone_lruvec(zone, mz->mem_cgroup);
while (unlikely(too_many_isolated(zone, file, sc))) {
congestion_wait(BLK_RW_ASYNC, HZ/10);
@@ -1292,8 +1291,8 @@ shrink_inactive_list(unsigned long nr_to_scan, struct mem_cgroup_zone *mz,
spin_lock_irq(&zone->lru_lock);
- nr_taken = isolate_lru_pages(nr_to_scan, mz, &page_list, &nr_scanned,
- sc, isolate_mode, lru);
+ nr_taken = isolate_lru_pages(nr_to_scan, lruvec, &page_list,
+ &nr_scanned, sc, isolate_mode, lru);
if (global_reclaim(sc)) {
zone->pages_scanned += nr_scanned;
if (current_is_kswapd())
@@ -1439,6 +1438,7 @@ static void shrink_active_list(unsigned long nr_to_scan,
isolate_mode_t isolate_mode = 0;
int file = is_file_lru(lru);
struct zone *zone = mz->zone;
+ struct lruvec *lruvec = mem_cgroup_zone_lruvec(zone, mz->mem_cgroup);
lru_add_drain();
@@ -1449,8 +1449,8 @@ static void shrink_active_list(unsigned long nr_to_scan,
spin_lock_irq(&zone->lru_lock);
- nr_taken = isolate_lru_pages(nr_to_scan, mz, &l_hold, &nr_scanned, sc,
- isolate_mode, lru);
+ nr_taken = isolate_lru_pages(nr_to_scan, lruvec, &l_hold,
+ &nr_scanned, sc, isolate_mode, lru);
if (global_reclaim(sc))
zone->pages_scanned += nr_scanned;
--
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>
next prev parent reply other threads:[~2012-04-26 7:54 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-26 7:53 [PATCH next 00/12] mm: replace struct mem_cgroup_zone with struct lruvec Konstantin Khlebnikov
2012-04-26 7:53 ` [PATCH 01/12] mm/vmscan: store "priority" in struct scan_control Konstantin Khlebnikov
2012-04-26 7:53 ` [PATCH 02/12] mm: add link from struct lruvec to struct zone Konstantin Khlebnikov
2012-05-02 5:52 ` [PATCH v2 " Konstantin Khlebnikov
2012-04-26 7:53 ` Konstantin Khlebnikov [this message]
2012-04-26 7:54 ` [PATCH 04/12] mm/vmscan: push zone pointer into shrink_page_list() Konstantin Khlebnikov
2012-04-26 7:54 ` [PATCH 05/12] mm/vmscan: push zone pointer into update_isolated_counts() Konstantin Khlebnikov
2012-04-26 13:17 ` [PATCH v2 05/12] mm/vmscan: remove update_isolated_counts() Konstantin Khlebnikov
2012-04-27 10:28 ` Mel Gorman
2012-04-26 7:54 ` [PATCH 06/12] mm/vmscan: push lruvec pointer into putback_inactive_pages() Konstantin Khlebnikov
2012-04-26 7:54 ` [PATCH 07/12] mm/vmscan: replace zone_nr_lru_pages() with get_lruvec_size() Konstantin Khlebnikov
2012-04-26 7:54 ` [PATCH 08/12] mm/vmscan: push lruvec pointer into inactive_list_is_low() Konstantin Khlebnikov
2012-04-26 7:54 ` [PATCH 09/12] mm/vmscan: push lruvec pointer into shrink_list() Konstantin Khlebnikov
2012-04-26 7:54 ` [PATCH 10/12] mm/vmscan: push lruvec pointer into get_scan_count() Konstantin Khlebnikov
2012-04-26 7:54 ` [PATCH 11/12] mm/vmscan: push lruvec pointer into should_continue_reclaim() Konstantin Khlebnikov
2012-04-26 7:54 ` [PATCH 12/12] mm/vmscan: kill struct mem_cgroup_zone Konstantin Khlebnikov
2012-04-26 23:25 ` [PATCH next 00/12] mm: replace struct mem_cgroup_zone with struct lruvec Andrew Morton
2012-04-27 7:45 ` Konstantin Khlebnikov
2012-05-02 4:09 ` Hugh Dickins
2012-05-02 6:13 ` Konstantin Khlebnikov
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=20120426075359.18961.96466.stgit@zurg \
--to=khlebnikov@openvz.org \
--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;
as well as URLs for NNTP newsgroup(s).