linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: batch-free pcp list if possible
@ 2011-02-09 13:21 Namhyung Kim
  2011-02-09 14:41 ` Johannes Weiner
  2011-02-09 20:38 ` Andrew Morton
  0 siblings, 2 replies; 8+ messages in thread
From: Namhyung Kim @ 2011-02-09 13:21 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-mm, linux-kernel

free_pcppages_bulk() frees pages from pcp lists in a round-robin
fashion by keeping batch_free counter. But it doesn't need to spin
if there is only one non-empty list. This can be checked by
batch_free == MIGRATE_PCPTYPES.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
---
 mm/page_alloc.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index a873e61e312e..470fb42e303c 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -614,6 +614,10 @@ static void free_pcppages_bulk(struct zone *zone, int count,
 			list = &pcp->lists[migratetype];
 		} while (list_empty(list));
 
+		/* This is an only non-empty list. Free them all. */
+		if (batch_free == MIGRATE_PCPTYPES)
+			batch_free = to_free;
+
 		do {
 			page = list_entry(list->prev, struct page, lru);
 			/* must delete as __free_one_page list manipulates */
-- 
1.7.3.4.600.g982838b0

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

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

end of thread, other threads:[~2011-02-10 21:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-09 13:21 [PATCH] mm: batch-free pcp list if possible Namhyung Kim
2011-02-09 14:41 ` Johannes Weiner
2011-02-09 20:38 ` Andrew Morton
2011-02-09 21:33   ` Johannes Weiner
2011-02-09 21:47     ` Andrew Morton
2011-02-09 23:23       ` Minchan Kim
2011-02-10  9:35   ` Mel Gorman
2011-02-10 21:00     ` Andrew Morton

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