mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] mm: shrink_inactive_lis() nr_scan accounting fix
@ 2006-03-07  1:47 Wu Fengguang
  0 siblings, 0 replies; only message in thread
From: Wu Fengguang @ 2006-03-07  1:47 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

In shrink_inactive_lis(), nr_scan is not accounted when nr_taken is 0.
But 0 pages taken does not mean 0 pages scanned.

Move the goto statement below the accounting code to fix it.

Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn>
---

--- linux-2.6.16-rc5-mm2.orig/mm/vmscan.c
+++ linux-2.6.16-rc5-mm2/mm/vmscan.c
@@ -1132,9 +1132,6 @@ static unsigned long shrink_inactive_lis
 		zone->pages_scanned += nr_scan;
 		spin_unlock_irq(&zone->lru_lock);
 
-		if (nr_taken == 0)
-			goto done;
-
 		nr_scanned += nr_scan;
 		nr_freed = shrink_page_list(&page_list, sc);
 		nr_reclaimed += nr_freed;
@@ -1146,6 +1143,11 @@ static unsigned long shrink_inactive_lis
 			__mod_page_state_zone(zone, pgscan_direct, nr_scan);
 		__mod_page_state_zone(zone, pgsteal, nr_freed);
 
+		if (nr_taken == 0) {
+			local_irq_enable();
+			goto done;
+		}
+
 		spin_lock(&zone->lru_lock);
 		/*
 		 * Put back any unfreeable pages.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-03-07  1:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-07  1:47 [PATCH] mm: shrink_inactive_lis() nr_scan accounting fix Wu Fengguang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®