aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/page-flags.h
diff options
context:
space:
mode:
authorChristoph Lameter <clameter@sgi.com>2007-05-06 17:49:39 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-07 15:12:53 -0400
commitd85f33855c303acfa87fa457157cef755b6087df (patch)
treef1184a1a24b432727b0399594ede37c7539db888 /include/linux/page-flags.h
parent30520864839dc796fd314812e7036e754880b47d (diff)
Make page->private usable in compound pages
If we add a new flag so that we can distinguish between the first page and the tail pages then we can avoid to use page->private in the first page. page->private == page for the first page, so there is no real information in there. Freeing up page->private makes the use of compound pages more transparent. They become more usable like real pages. Right now we have to be careful f.e. if we are going beyond PAGE_SIZE allocations in the slab on i386 because we can then no longer use the private field. This is one of the issues that cause us not to support debugging for page size slabs in SLAB. Having page->private available for SLUB would allow more meta information in the page struct. I can probably avoid the 16 bit ints that I have in there right now. Also if page->private is available then a compound page may be equipped with buffer heads. This may free up the way for filesystems to support larger blocks than page size. We add PageTail as an alias of PageReclaim. Compound pages cannot currently be reclaimed. Because of the alias one needs to check PageCompound first. The RFC for the this approach was discussed at http://marc.info/?t=117574302800001&r=1&w=2 [nacc@us.ibm.com: fix hugetlbfs] Signed-off-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/page-flags.h')
-rw-r--r--include/linux/page-flags.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 96326594e55d..a1e143634946 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -94,6 +94,12 @@
94/* PG_owner_priv_1 users should have descriptive aliases */ 94/* PG_owner_priv_1 users should have descriptive aliases */
95#define PG_checked PG_owner_priv_1 /* Used by some filesystems */ 95#define PG_checked PG_owner_priv_1 /* Used by some filesystems */
96 96
97/*
98 * Marks tail portion of a compound page. We currently do not reclaim
99 * compound pages so we can reuse a flag only used for reclaim here.
100 */
101#define PG_tail PG_reclaim
102
97#if (BITS_PER_LONG > 32) 103#if (BITS_PER_LONG > 32)
98/* 104/*
99 * 64-bit-only flags build down from bit 31 105 * 64-bit-only flags build down from bit 31
@@ -241,6 +247,14 @@ static inline void SetPageUptodate(struct page *page)
241#define __SetPageCompound(page) __set_bit(PG_compound, &(page)->flags) 247#define __SetPageCompound(page) __set_bit(PG_compound, &(page)->flags)
242#define __ClearPageCompound(page) __clear_bit(PG_compound, &(page)->flags) 248#define __ClearPageCompound(page) __clear_bit(PG_compound, &(page)->flags)
243 249
250/*
251 * Note: PG_tail is an alias of another page flag. The result of PageTail()
252 * is only valid if PageCompound(page) is true.
253 */
254#define PageTail(page) test_bit(PG_tail, &(page)->flags)
255#define __SetPageTail(page) __set_bit(PG_tail, &(page)->flags)
256#define __ClearPageTail(page) __clear_bit(PG_tail, &(page)->flags)
257
244#ifdef CONFIG_SWAP 258#ifdef CONFIG_SWAP
245#define PageSwapCache(page) test_bit(PG_swapcache, &(page)->flags) 259#define PageSwapCache(page) test_bit(PG_swapcache, &(page)->flags)
246#define SetPageSwapCache(page) set_bit(PG_swapcache, &(page)->flags) 260#define SetPageSwapCache(page) set_bit(PG_swapcache, &(page)->flags)