From: Hugh Dickins <hughd@google.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org
Subject: [PATCH] mm: move buffer_heads_over_limit check up
Date: Fri, 17 Feb 2012 16:00:14 -0800 (PST) [thread overview]
Message-ID: <alpine.LSU.2.00.1202171557040.1286@eggly.anvils> (raw)
Not a functional change, just a minor internal cleanup: move the
buffer_heads_over_limit processing up from move_active_pages_to_lru()
(where it has to drop lock and reloop) to its caller shrink_active_list().
Signed-off-by: Hugh Dickins <hughd@google.com>
---
mm/vmscan.c | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)
--- mmotm.orig/mm/vmscan.c 2012-02-07 16:59:13.000000000 -0800
+++ mmotm/mm/vmscan.c 2012-02-07 17:07:23.800524771 -0800
@@ -1641,18 +1641,6 @@ static void move_active_pages_to_lru(str
unsigned long pgmoved = 0;
struct page *page;
- if (buffer_heads_over_limit) {
- spin_unlock_irq(&zone->lru_lock);
- list_for_each_entry(page, list, lru) {
- if (page_has_private(page) && trylock_page(page)) {
- if (page_has_private(page))
- try_to_release_page(page, 0);
- unlock_page(page);
- }
- }
- spin_lock_irq(&zone->lru_lock);
- }
-
while (!list_empty(list)) {
struct lruvec *lruvec;
@@ -1734,6 +1722,13 @@ static void shrink_active_list(unsigned
continue;
}
+ if (buffer_heads_over_limit &&
+ page_has_private(page) && trylock_page(page)) {
+ if (page_has_private(page))
+ try_to_release_page(page, 0);
+ unlock_page(page);
+ }
+
if (page_referenced(page, 0, mz->mem_cgroup, &vm_flags)) {
nr_rotated += hpage_nr_pages(page);
/*
--
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 reply other threads:[~2012-02-18 0:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-18 0:00 Hugh Dickins [this message]
2012-02-18 0:11 ` Andrew Morton
2012-02-18 2:41 ` Hugh Dickins
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=alpine.LSU.2.00.1202171557040.1286@eggly.anvils \
--to=hughd@google.com \
--cc=akpm@linux-foundation.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