diff options
author | Christoph Lameter <clameter@sgi.com> | 2007-05-06 17:49:39 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-07 15:12:53 -0400 |
commit | d85f33855c303acfa87fa457157cef755b6087df (patch) | |
tree | f1184a1a24b432727b0399594ede37c7539db888 /mm/slab.c | |
parent | 30520864839dc796fd314812e7036e754880b47d (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 'mm/slab.c')
-rw-r--r-- | mm/slab.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -602,8 +602,7 @@ static inline void page_set_cache(struct page *page, struct kmem_cache *cache) | |||
602 | 602 | ||
603 | static inline struct kmem_cache *page_get_cache(struct page *page) | 603 | static inline struct kmem_cache *page_get_cache(struct page *page) |
604 | { | 604 | { |
605 | if (unlikely(PageCompound(page))) | 605 | page = compound_head(page); |
606 | page = (struct page *)page_private(page); | ||
607 | BUG_ON(!PageSlab(page)); | 606 | BUG_ON(!PageSlab(page)); |
608 | return (struct kmem_cache *)page->lru.next; | 607 | return (struct kmem_cache *)page->lru.next; |
609 | } | 608 | } |
@@ -615,8 +614,7 @@ static inline void page_set_slab(struct page *page, struct slab *slab) | |||
615 | 614 | ||
616 | static inline struct slab *page_get_slab(struct page *page) | 615 | static inline struct slab *page_get_slab(struct page *page) |
617 | { | 616 | { |
618 | if (unlikely(PageCompound(page))) | 617 | page = compound_head(page); |
619 | page = (struct page *)page_private(page); | ||
620 | BUG_ON(!PageSlab(page)); | 618 | BUG_ON(!PageSlab(page)); |
621 | return (struct slab *)page->lru.prev; | 619 | return (struct slab *)page->lru.prev; |
622 | } | 620 | } |