linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] mm/page_alloc : rename rmqueue_bulk to rmqueue_single
@ 2010-01-11  4:37 Huang Shijie
  2010-01-11  4:37 ` [PATCH 2/4] mm/page_alloc : relieve the zone->lock's pressure for allocation Huang Shijie
                   ` (3 more replies)
  0 siblings, 4 replies; 41+ messages in thread
From: Huang Shijie @ 2010-01-11  4:37 UTC (permalink / raw)
  To: akpm; +Cc: mel, kosaki.motohiro, linux-mm, Huang Shijie

There is only one place calls rmqueue_bulk to allocate the single
pages. So rename it to rmqueue_single, and remove an argument
order.

Signed-off-by: Huang Shijie <shijie8@gmail.com>
---
 mm/page_alloc.c |   18 ++++++++----------
 1 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 4e9f5cc..23df1ed 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -930,25 +930,24 @@ retry_reserve:
 }
 
 /* 
- * Obtain a specified number of elements from the buddy allocator, all under
+ * Obtain a specified number of single page from the buddy allocator, all under
  * a single hold of the lock, for efficiency.  Add them to the supplied list.
  * Returns the number of new pages which were placed at *list.
  */
-static int rmqueue_bulk(struct zone *zone, unsigned int order, 
-			unsigned long count, struct list_head *list,
-			int migratetype, int cold)
+static int rmqueue_single(struct zone *zone, unsigned long count,
+		       struct list_head *list, int migratetype, int cold)
 {
 	int i;
 	
 	spin_lock(&zone->lock);
 	for (i = 0; i < count; ++i) {
-		struct page *page = __rmqueue(zone, order, migratetype);
+		struct page *page = __rmqueue(zone, 0, migratetype);
 		if (unlikely(page == NULL))
 			break;
 
 		/*
 		 * Split buddy pages returned by expand() are received here
-		 * in physical page order. The page is added to the callers and
+		 * in order zero. The page is added to the callers and
 		 * list and the list head then moves forward. From the callers
 		 * perspective, the linked list is ordered by page number in
 		 * some conditions. This is useful for IO devices that can
@@ -962,7 +961,7 @@ static int rmqueue_bulk(struct zone *zone, unsigned int order,
 		set_page_private(page, migratetype);
 		list = &page->lru;
 	}
-	__mod_zone_page_state(zone, NR_FREE_PAGES, -(i << order));
+	__mod_zone_page_state(zone, NR_FREE_PAGES, -i);
 	spin_unlock(&zone->lock);
 	return i;
 }
@@ -1192,9 +1191,8 @@ again:
 		list = &pcp->lists[migratetype];
 		local_irq_save(flags);
 		if (list_empty(list)) {
-			pcp->count += rmqueue_bulk(zone, 0,
-					pcp->batch, list,
-					migratetype, cold);
+			pcp->count += rmqueue_single(zone, pcp->batch, list,
+							migratetype, cold);
 			if (unlikely(list_empty(list)))
 				goto failed;
 		}
-- 
1.6.5.2

--
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] 41+ messages in thread

end of thread, other threads:[~2010-01-19  1:50 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-11  4:37 [PATCH 1/4] mm/page_alloc : rename rmqueue_bulk to rmqueue_single Huang Shijie
2010-01-11  4:37 ` [PATCH 2/4] mm/page_alloc : relieve the zone->lock's pressure for allocation Huang Shijie
2010-01-11  4:37   ` [PATCH 3/4] mm/page_alloc : modify the return type of __free_one_page Huang Shijie
2010-01-11  4:37     ` [PATCH 4/4] mm/page_alloc : relieve zone->lock's pressure for memory free Huang Shijie
2010-01-11  5:20       ` Minchan Kim
2010-01-11  6:01         ` Huang Shijie
2010-01-11  6:27       ` Huang Shijie
2010-01-11  6:38         ` Minchan Kim
2010-01-11  6:59           ` Huang Shijie
2010-01-12  0:47           ` KAMEZAWA Hiroyuki
2010-01-12  2:02             ` Huang Shijie
2010-01-12  2:07               ` KAMEZAWA Hiroyuki
2010-01-12  2:32                 ` Huang Shijie
2010-01-12  2:27             ` Wu Fengguang
2010-01-12  2:56               ` KOSAKI Motohiro
2010-01-12  3:02                 ` Huang Shijie
2010-01-12  4:05               ` Minchan Kim
2010-01-12  4:21                 ` Wu Fengguang
2010-01-12  4:32                   ` KAMEZAWA Hiroyuki
2010-01-12  4:59                     ` Wu Fengguang
2010-01-12  5:09                       ` Wu Fengguang
2010-01-12  5:10                     ` KOSAKI Motohiro
2010-01-12  7:36                       ` David Rientjes
2010-01-12  8:56                         ` KOSAKI Motohiro
2010-01-12 21:39                           ` David Rientjes
2010-01-13  0:01                             ` KOSAKI Motohiro
2010-01-12  4:48                   ` Minchan Kim
2010-01-12  2:51       ` Huang Shijie
2010-01-12  3:03         ` Wu Fengguang
2010-01-12  3:05         ` KOSAKI Motohiro
2010-01-11  5:04     ` [PATCH 3/4] mm/page_alloc : modify the return type of __free_one_page Minchan Kim
2010-01-12  2:56     ` KOSAKI Motohiro
2010-01-18 11:25     ` Mel Gorman
2010-01-19  1:49       ` Huang Shijie
2010-01-11  5:02   ` [PATCH 2/4] mm/page_alloc : relieve the zone->lock's pressure for allocation Minchan Kim
2010-01-11  5:13     ` Huang Shijie
2010-01-12  2:54   ` KOSAKI Motohiro
2010-01-18 11:24   ` Mel Gorman
2010-01-11  5:00 ` [PATCH 1/4] mm/page_alloc : rename rmqueue_bulk to rmqueue_single Minchan Kim
2010-01-12  2:52 ` KOSAKI Motohiro
2010-01-18 11:21 ` Mel Gorman

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