From: Mel Gorman <mel@csn.ul.ie>
To: linux-mm@kvack.org
Cc: Mel Gorman <mel@csn.ul.ie>, linux-kernel@vger.kernel.org
Subject: [PATCH 11/11] Use pageblock flags for anti-fragmentation
Date: Wed, 1 Nov 2006 11:20:01 +0000 (GMT) [thread overview]
Message-ID: <20061101112001.18798.61301.sendpatchset@skynet.skynet.ie> (raw)
In-Reply-To: <20061101111620.18798.34778.sendpatchset@skynet.skynet.ie>
This patch alters anti-fragmentation to use the pageblock bits for tracking
the reclaimability of a block of pages.
Signed-off-by: Mel Gorman <mel@csn.ul.ie>
---
include/linux/pageblock-flags.h | 4 ++++
mm/page_alloc.c | 22 ++++++++++++++++++----
2 files changed, 22 insertions(+), 4 deletions(-)
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.19-rc4-mm1-102_remove_antifrag_pageflags/include/linux/pageblock-flags.h linux-2.6.19-rc4-mm1-103_antifrag_pageblock_bits/include/linux/pageblock-flags.h
--- linux-2.6.19-rc4-mm1-102_remove_antifrag_pageflags/include/linux/pageblock-flags.h 2006-10-31 17:42:25.000000000 +0000
+++ linux-2.6.19-rc4-mm1-103_antifrag_pageblock_bits/include/linux/pageblock-flags.h 2006-10-31 18:25:54.000000000 +0000
@@ -27,6 +27,10 @@
/* Bit indices that affect a whole block of pages */
enum pageblock_bits {
+#ifdef CONFIG_PAGEALLOC_ANTIFRAG
+ PB_rclmtype,
+ PB_rclmtype_end = (PB_rclmtype + 2) - 1, /* 2 bits for rclm types */
+#endif
NR_PAGEBLOCK_BITS
};
diff -rup -X /usr/src/patchset-0.6/bin//dontdiff linux-2.6.19-rc4-mm1-102_remove_antifrag_pageflags/mm/page_alloc.c linux-2.6.19-rc4-mm1-103_antifrag_pageblock_bits/mm/page_alloc.c
--- linux-2.6.19-rc4-mm1-102_remove_antifrag_pageflags/mm/page_alloc.c 2006-10-31 17:44:48.000000000 +0000
+++ linux-2.6.19-rc4-mm1-103_antifrag_pageblock_bits/mm/page_alloc.c 2006-10-31 18:24:48.000000000 +0000
@@ -140,8 +140,15 @@ static unsigned long __initdata dma_rese
#endif /* CONFIG_ARCH_POPULATES_NODE_MAP */
#ifdef CONFIG_PAGEALLOC_ANTIFRAG
-static inline int get_page_rclmtype(struct page *page)
+static inline int get_pageblock_rclmtype(struct page *page)
{
+ return get_pageblock_flags_group(page, PB_rclmtype, PB_rclmtype_end);
+}
+
+static void set_pageblock_rclmtype(struct page *page, int rclmtype)
+{
+ set_pageblock_flags_group(page, (unsigned long)rclmtype,
+ PB_rclmtype, PB_rclmtype_end);
}
static inline int gfpflags_to_rclmtype(gfp_t gfp_flags)
@@ -153,11 +161,13 @@ static inline int gfpflags_to_rclmtype(g
((gfp_flags & __GFP_KERNRCLM) != 0);
}
#else
-static inline int get_page_rclmtype(struct page *page)
+static inline int get_pageblock_rclmtype(struct page *page)
{
return RCLM_NORCLM;
}
+static inline void set_pageblock_rclmtype(struct page *page, int rclmtype) {}
+
static inline int gfpflags_to_rclmtype(gfp_t gfp_flags)
{
return RCLM_NORCLM;
@@ -433,7 +443,7 @@ static inline void __free_one_page(struc
{
unsigned long page_idx;
int order_size = 1 << order;
- int rclmtype = get_page_rclmtype(page);
+ int rclmtype = get_pageblock_rclmtype(page);
if (unlikely(PageCompound(page)))
destroy_compound_page(page, order);
@@ -713,6 +723,7 @@ int move_freepages_block(struct zone *zo
if (page_zone(page) != page_zone(end_page))
return 0;
+ set_pageblock_rclmtype(start_page, rclmtype);
return move_freepages(zone, start_page, end_page, rclmtype);
}
@@ -825,6 +836,10 @@ static struct page *__rmqueue(struct zon
split_count[rclmtype]++;
expand(zone, page, order, current_order, area, rclmtype);
+
+ if (current_order == MAX_ORDER - 1)
+ set_pageblock_rclmtype(page, rclmtype);
+
goto got_page;
}
@@ -1003,7 +1018,7 @@ void drain_all_local_pages(void) {}
static void fastcall free_hot_cold_page(struct page *page, int cold)
{
struct zone *zone = page_zone(page);
- int pindex = get_page_rclmtype(page);
+ int pindex = get_pageblock_rclmtype(page);
struct per_cpu_pages *pcp;
unsigned long flags;
--
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>
next prev parent reply other threads:[~2006-11-01 11:20 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-01 11:16 [PATCH 0/11] Avoiding fragmentation with subzone groupings v26 Mel Gorman
2006-11-01 11:16 ` [PATCH 1/11] Add __GFP_EASYRCLM flag and update callers Mel Gorman
2006-11-01 11:17 ` [PATCH 2/11] Split the free lists into kernel and user parts Mel Gorman
2006-11-01 11:17 ` [PATCH 3/11] Split the per-cpu lists into RCLM_TYPES lists Mel Gorman
2006-11-01 11:17 ` [PATCH 4/11] Add a configure option for anti-fragmentation Mel Gorman
2006-11-01 11:18 ` [PATCH 5/11] Drain per-cpu lists when high-order allocations fail Mel Gorman
2006-11-01 11:18 ` [PATCH 6/11] Move free pages between lists on steal Mel Gorman
2006-11-01 11:18 ` [PATCH 7/11] Introduce the RCLM_KERN allocation type Mel Gorman
2006-11-01 11:19 ` [PATCH 8/11] [DEBUG] Add statistics Mel Gorman
2006-11-01 11:19 ` [PATCH 9/11] Add a bitmap that is used to track flags affecting a block of pages Mel Gorman
2006-11-01 11:19 ` [PATCH 10/11] Remove dependency on page->flag bits Mel Gorman
2006-11-01 11:20 ` Mel Gorman [this message]
[not found] ` <p734ptilcie.fsf@verdi.suse.de>
2006-11-02 11:21 ` [PATCH 0/11] Avoiding fragmentation with subzone groupings v26 Mel Gorman
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=20061101112001.18798.61301.sendpatchset@skynet.skynet.ie \
--to=mel@csn.ul.ie \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/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