All of lore.kernel.org
 help / color / mirror / Atom feed
* [RESEND][PATCH V1] mm/vsmcan: check shrink_active_list() sc->isolate_pages() return value.
@ 2009-09-02 23:49 Vincent Li
  2009-09-03 21:06 ` Andrew Morton
  2009-09-22 21:02 ` Andrew Morton
  0 siblings, 2 replies; 28+ messages in thread
From: Vincent Li @ 2009-09-02 23:49 UTC (permalink / raw)
  To: Andrew Morton
  Cc: KOSAKI Motohiro, Rik van Riel, Minchan Kim, Wu Fengguang,
	linux-mm, Vincent Li

If we can't isolate pages from LRU list, we don't have to account page movement, either.
Already, in commit 5343daceec, KOSAKI did it about shrink_inactive_list.

This patch removes unnecessary overhead of page accounting
and locking in shrink_active_list as follow-up work of commit 5343daceec.

Signed-off-by: Vincent Li <macli@brc.ubc.ca>
Reviewed-by: Minchan Kim <minchan.kim@gmail.com>
Reviewed-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Reviewed-by: Wu Fengguang <fengguang.wu@intel.com>
Acked-by: Rik van Riel <riel@redhat.com>

---
 mm/vmscan.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index 460a6f7..2d1c846 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1319,9 +1319,12 @@ static void shrink_active_list(unsigned long nr_pages, struct zone *zone,
 	if (scanning_global_lru(sc)) {
 		zone->pages_scanned += pgscanned;
 	}
-	reclaim_stat->recent_scanned[file] += nr_taken;
-
 	__count_zone_vm_events(PGREFILL, zone, pgscanned);
+
+	if (nr_taken == 0)
+		goto done;
+
+	reclaim_stat->recent_scanned[file] += nr_taken;
 	if (file)
 		__mod_zone_page_state(zone, NR_ACTIVE_FILE, -nr_taken);
 	else
@@ -1383,6 +1386,8 @@ static void shrink_active_list(unsigned long nr_pages, struct zone *zone,
 	__mod_zone_page_state(zone, NR_ISOLATED_ANON + file, -nr_taken);
 	__mod_zone_page_state(zone, LRU_ACTIVE + file * LRU_FILE, nr_rotated);
 	__mod_zone_page_state(zone, LRU_BASE + file * LRU_FILE, nr_deactivated);
+
+done:
 	spin_unlock_irq(&zone->lru_lock);
 }
 
-- 
1.6.0.4

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

^ permalink raw reply related	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2009-11-26  4:57 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-02 23:49 [RESEND][PATCH V1] mm/vsmcan: check shrink_active_list() sc->isolate_pages() return value Vincent Li
2009-09-03 21:06 ` Andrew Morton
2009-09-03 22:02   ` Vincent Li
2009-09-03 22:47     ` Andrew Morton
2009-09-04 21:39       ` Vincent Li
2009-09-04 23:53         ` Andrew Morton
2009-09-08 13:21           ` Mel Gorman
2009-09-08 22:39             ` Vincent Li
2009-09-08 23:27               ` Minchan Kim
2009-10-15 22:47                 ` Vincent Li
2009-10-15 23:13                   ` Vincent Li
2009-10-16  2:10                   ` Minchan Kim
2009-10-16  2:20                     ` Wu Fengguang
2009-10-16  3:05                       ` KOSAKI Motohiro
2009-10-16  3:26                         ` Vincent Li
2009-11-26  4:56                         ` KOSAKI Motohiro
2009-09-09  9:59               ` Mel Gorman
2009-09-04  1:37   ` Minchan Kim
2009-09-04  2:01     ` Andrew Morton
2009-09-04  5:01       ` Vincent Li
2009-09-04 16:05         ` Vincent Li
2009-09-06 23:38           ` KOSAKI Motohiro
2009-09-08 18:32             ` Vincent Li
2009-09-08 23:47               ` KOSAKI Motohiro
2009-09-09 12:04               ` Johannes Weiner
2009-09-09 13:22                 ` Minchan Kim
2009-09-22 21:02 ` Andrew Morton
2009-09-22 23:01   ` Vincent Li

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.