linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Lee Schermerhorn <Lee.Schermerhorn@hp.com>,
	linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>,
	Rik van Riel <riel@redhat.com>
Cc: kosaki.motohiro@jp.fujitsu.com
Subject: [mmotm][PATCH 9/9] restore patch failure of vmstat-unevictable-and-mlocked-pages-vm-events.patch
Date: Tue, 15 Jul 2008 04:27:48 +0900	[thread overview]
Message-ID: <20080715042620.F70A.KOSAKI.MOTOHIRO@jp.fujitsu.com> (raw)
In-Reply-To: <20080715040402.F6EF.KOSAKI.MOTOHIRO@jp.fujitsu.com>

Patch title:  vmstat-unevictable-and-mlocked-pages-vm-events-restore-patch-failure-hunk.patch
Against: mmotm Jul 14
Applies after: vmstat-unevictable-and-mlocked-pages-vm-events.patch

unevictable-lru-infrastructure-putback_lru_page-rework.patch makes following patch failure hunk.

	---------------------------------------------------------
	@@ -486,6 +486,7 @@ int putback_lru_page(struct page *page)
	 {
	 	int lru;
	 	int ret = 1;
	+	int was_unevictable;
	 
	 	VM_BUG_ON(!PageLocked(page));
	 	VM_BUG_ON(PageLRU(page));
	
	 	lru = !!TestClearPageActive(page);
	-	ClearPageUnevictable(page);	/* for page_evictable() */
	+	was_unevictable = TestClearPageUnevictable(page); /* for page_evictable() */
	 
	 	if (unlikely(!page->mapping)) {
	 		/*
	@@ -511,6 +512,10 @@ int putback_lru_page(struct page *page)
	 		lru += page_is_file_cache(page);
	 		lru_cache_add_lru(page, lru);
	 		mem_cgroup_move_lists(page, lru);
	+#ifdef CONFIG_UNEVICTABLE_LRU
	+		if (was_unevictable)
	+			count_vm_event(NORECL_PGRESCUED);
	+#endif
	 	} else {
	 		/*
	 		 * Put unevictable pages directly on zone's unevictable
	@@ -518,7 +523,10 @@ int putback_lru_page(struct page *page)
 			 */
 			add_page_to_unevictable_list(page);
	 		mem_cgroup_move_lists(page, LRU_UNEVICTABLE);
	+#ifdef CONFIG_UNEVICTABLE_LRU
	+		if (!was_unevictable)
	+			count_vm_event(NORECL_PGCULLED);
	+#endif
	 	}
	 
	 	put_page(page);		/* drop ref from isolate */
	---------------------------------------------------------

This patch restore it properly.


Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>

---
 mm/vmscan.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Index: b/mm/vmscan.c
===================================================================
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -483,7 +483,7 @@ int remove_mapping(struct address_space 
 void putback_lru_page(struct page *page)
 {
 	int lru;
-	int ret = 1;
+	int was_unevictable = PageUnevictable(page);
 
 	VM_BUG_ON(PageLRU(page));
 
@@ -526,6 +526,11 @@ redo:
 		 */
 	}
 
+	if (was_unevictable && lru != LRU_UNEVICTABLE)
+		count_vm_event(NORECL_PGRESCUED);
+	else if (!was_unevictable && lru == LRU_UNEVICTABLE)
+		count_vm_event(NORECL_PGCULLED);
+
 	put_page(page);		/* drop ref from isolate */
 }
 


--
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>

      parent reply	other threads:[~2008-07-14 19:27 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-14 19:06 [mmotm][PATCH 0/9] putback_lru_page() rework v5 KOSAKI Motohiro
2008-07-14 19:09 ` [mmotm][PATCH 1/9] putback_lru_page()/unevictable page handling rework KOSAKI Motohiro
2008-07-14 19:10 ` [mmotm][PATCH 2/9] kill unnecessary lock_page() in vmscan.c KOSAKI Motohiro
2008-07-14 19:12 ` [mmotm][PATCH 3/9] revert migration change of unevictable lru infrastructure KOSAKI Motohiro
2008-07-14 19:13 ` [mmotm][PATCH 4/9] revert shm change of shm_locked pages are unevictable patch KOSAKI Motohiro
2008-07-14 19:19 ` [mmotm][PATCH 5/9] mlock-mlocked-pages-are-unevictable.patch KOSAKI Motohiro
2008-07-23  9:07   ` Andrew Morton
2008-07-23 11:55     ` KOSAKI Motohiro
2008-07-24  5:45       ` KOSAKI Motohiro
2008-07-14 19:21 ` [mmotm][PATCH 6/9] restore patch failure hunk of mlock-mlocked-pages-are-unevictable.patch KOSAKI Motohiro
2008-07-14 19:24 ` [mmotm][PATCH 7/9] fix truncate race and sevaral comments KOSAKI Motohiro
2008-07-14 19:26 ` [mmotm][PATCH 8/9] vmstat-unevictable-and-mlocked-pages-vm-events.patch KOSAKI Motohiro
2008-07-14 19:27 ` KOSAKI Motohiro [this message]

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=20080715042620.F70A.KOSAKI.MOTOHIRO@jp.fujitsu.com \
    --to=kosaki.motohiro@jp.fujitsu.com \
    --cc=Lee.Schermerhorn@hp.com \
    --cc=akpm@linux-foundation.org \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-mm@kvack.org \
    --cc=riel@redhat.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