From: Joel Schopp <jschopp@austin.ibm.com>
To: Andrew Morton <akpm@osdl.org>
Cc: Joel Schopp <jschopp@austin.ibm.com>,
lhms <lhms-devel@lists.sourceforge.net>,
Linux Memory Management List <linux-mm@kvack.org>,
linux-kernel@vger.kernel.org, Mel Gorman <mel@csn.ul.ie>,
Mike Kravetz <kravetz@us.ibm.com>
Subject: [PATCH 5/9] propagate defrag alloc types
Date: Mon, 26 Sep 2005 15:11:49 -0500 [thread overview]
Message-ID: <43385605.7050406@austin.ibm.com> (raw)
In-Reply-To: <4338537E.8070603@austin.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 210 bytes --]
Now that we have this new information of alloctype, this patch propagates it to
functions where it will be useful.
Signed-off-by: Mel Gorman <mel@csn.ul.ie>
Signed-off-by: Joel Schopp <jschopp@austin.ibm.com>
[-- Attachment #2: 5_propogate_defrag_types --]
[-- Type: text/plain, Size: 3677 bytes --]
Index: 2.6.13-joel2/mm/page_alloc.c
===================================================================
--- 2.6.13-joel2.orig/mm/page_alloc.c 2005-09-20 14:16:35.%N -0500
+++ 2.6.13-joel2/mm/page_alloc.c 2005-09-20 15:08:05.%N -0500
@@ -559,7 +559,8 @@ static inline struct page* steal_largepa
* Do the hard work of removing an element from the buddy allocator.
* Call me with the zone->lock already held.
*/
-static struct page *__rmqueue(struct zone *zone, unsigned int order)
+static struct page *__rmqueue(struct zone *zone, unsigned int order,
+ int alloctype)
{
struct free_area * area;
unsigned int current_order;
@@ -587,7 +588,8 @@ static struct page *__rmqueue(struct zon
* 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)
+ unsigned long count, struct list_head *list,
+ int alloctype)
{
unsigned long flags;
int i;
@@ -596,7 +598,7 @@ static int rmqueue_bulk(struct zone *zon
spin_lock_irqsave(&zone->lock, flags);
for (i = 0; i < count; ++i) {
- page = __rmqueue(zone, order);
+ page = __rmqueue(zone, order, alloctype);
if (page == NULL)
break;
allocated++;
@@ -775,7 +777,8 @@ static inline void prep_zero_page(struct
* or two.
*/
static struct page *
-buffered_rmqueue(struct zone *zone, int order, unsigned int __nocast gfp_flags)
+buffered_rmqueue(struct zone *zone, int order, unsigned int __nocast gfp_flags,
+ int alloctype)
{
unsigned long flags;
struct page *page = NULL;
@@ -787,8 +790,8 @@ buffered_rmqueue(struct zone *zone, int
pcp = &zone_pcp(zone, get_cpu())->pcp[cold];
local_irq_save(flags);
if (pcp->count <= pcp->low)
- pcp->count += rmqueue_bulk(zone, 0,
- pcp->batch, &pcp->list);
+ pcp->count += rmqueue_bulk(zone, 0, pcp->batch,
+ &pcp->list, alloctype);
if (pcp->count) {
page = list_entry(pcp->list.next, struct page, lru);
list_del(&page->lru);
@@ -800,7 +803,7 @@ buffered_rmqueue(struct zone *zone, int
if (page == NULL) {
spin_lock_irqsave(&zone->lock, flags);
- page = __rmqueue(zone, order);
+ page = __rmqueue(zone, order, alloctype);
spin_unlock_irqrestore(&zone->lock, flags);
}
@@ -876,7 +879,9 @@ __alloc_pages(unsigned int __nocast gfp_
int do_retry;
int can_try_harder;
int did_some_progress;
-
+ int alloctype;
+
+ alloctype = (gfp_mask & __GFP_RCLM_BITS);
might_sleep_if(wait);
/*
@@ -921,7 +926,7 @@ zone_reclaim_retry:
}
}
- page = buffered_rmqueue(z, order, gfp_mask);
+ page = buffered_rmqueue(z, order, gfp_mask, alloctype);
if (page)
goto got_pg;
}
@@ -945,7 +950,7 @@ zone_reclaim_retry:
if (wait && !cpuset_zone_allowed(z))
continue;
- page = buffered_rmqueue(z, order, gfp_mask);
+ page = buffered_rmqueue(z, order, gfp_mask, alloctype);
if (page)
goto got_pg;
}
@@ -959,7 +964,8 @@ zone_reclaim_retry:
for (i = 0; (z = zones[i]) != NULL; i++) {
if (!cpuset_zone_allowed(z))
continue;
- page = buffered_rmqueue(z, order, gfp_mask);
+ page = buffered_rmqueue(z, order, gfp_mask,
+ alloctype);
if (page)
goto got_pg;
}
@@ -996,7 +1002,7 @@ rebalance:
if (!cpuset_zone_allowed(z))
continue;
- page = buffered_rmqueue(z, order, gfp_mask);
+ page = buffered_rmqueue(z, order, gfp_mask, alloctype);
if (page)
goto got_pg;
}
@@ -1015,7 +1021,7 @@ rebalance:
if (!cpuset_zone_allowed(z))
continue;
- page = buffered_rmqueue(z, order, gfp_mask);
+ page = buffered_rmqueue(z, order, gfp_mask, alloctype);
if (page)
goto got_pg;
}
next prev parent reply other threads:[~2005-09-26 20:11 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-26 20:01 [PATCH 0/9] fragmentation avoidance Joel Schopp
2005-09-26 20:03 ` [PATCH 1/9] add defrag flags Joel Schopp
2005-09-27 0:16 ` Kyle Moffett
2005-09-27 0:24 ` Dave Hansen
2005-09-27 0:43 ` Kyle Moffett
2005-09-27 5:44 ` Paul Jackson
2005-09-27 13:34 ` Mel Gorman
2005-09-27 16:26 ` [Lhms-devel] " Paul Jackson
2005-09-27 18:38 ` Joel Schopp
2005-09-27 19:30 ` Paul Jackson
2005-09-27 21:00 ` [Lhms-devel] " Joel Schopp
2005-09-27 21:23 ` Paul Jackson
2005-09-27 22:03 ` Joel Schopp
2005-09-27 22:45 ` Paul Jackson
2005-09-26 20:05 ` [PATCH 2/9] declare defrag structs Joel Schopp
2005-09-26 20:06 ` [PATCH 3/9] initialize defrag Joel Schopp
2005-09-26 20:09 ` [PATCH 4/9] defrag helper functions Joel Schopp
2005-09-26 22:29 ` Alex Bligh - linux-kernel
2005-09-27 16:08 ` Joel Schopp
2005-09-26 20:11 ` Joel Schopp [this message]
2005-09-26 20:13 ` [PATCH 6/9] fragmentation avoidance core Joel Schopp
2005-09-26 20:14 ` [PATCH 7/9] try harder on large allocations Joel Schopp
2005-09-27 7:21 ` Coywolf Qi Hunt
2005-09-27 16:17 ` Joel Schopp
2005-09-26 20:16 ` [PATCH 8/9] defrag fallback Joel Schopp
2005-09-26 20:17 ` [PATCH 9/9] free memory is user reclaimable Joel Schopp
2005-09-26 20:19 ` [PATCH 10/9] percpu splitout Joel Schopp
2005-09-26 21:49 ` [Lhms-devel] [PATCH 0/9] fragmentation avoidance Joel Schopp
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=43385605.7050406@austin.ibm.com \
--to=jschopp@austin.ibm.com \
--cc=akpm@osdl.org \
--cc=kravetz@us.ibm.com \
--cc=lhms-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mel@csn.ul.ie \
/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