aboutsummaryrefslogtreecommitdiffstats
path: root/mm/slab.c
diff options
context:
space:
mode:
authorNick Piggin <npiggin@suse.de>2006-03-22 03:08:34 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-22 10:54:01 -0500
commit84097518d1ecd2330f9488e4c2d09953a3340e74 (patch)
tree50981fe0584c456a1a86e6d7f611eec223b5f536 /mm/slab.c
parent0f8053a509ceba4a077a50ea7b77039b5559b428 (diff)
[PATCH] mm: nommu use compound pages
Now that compound page handling is properly fixed in the VM, move nommu over to using compound pages rather than rolling their own refcounting. nommu vm page refcounting is broken anyway, but there is no need to have divergent code in the core VM now, nor when it gets fixed. Signed-off-by: Nick Piggin <npiggin@suse.de> Cc: David Howells <dhowells@redhat.com> (Needs testing, please). Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm/slab.c')
-rw-r--r--mm/slab.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/mm/slab.c b/mm/slab.c
index f477acfb732f..ff0ab772f49d 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -590,6 +590,8 @@ static inline void page_set_cache(struct page *page, struct kmem_cache *cache)
590 590
591static inline struct kmem_cache *page_get_cache(struct page *page) 591static inline struct kmem_cache *page_get_cache(struct page *page)
592{ 592{
593 if (unlikely(PageCompound(page)))
594 page = (struct page *)page_private(page);
593 return (struct kmem_cache *)page->lru.next; 595 return (struct kmem_cache *)page->lru.next;
594} 596}
595 597
@@ -600,6 +602,8 @@ static inline void page_set_slab(struct page *page, struct slab *slab)
600 602
601static inline struct slab *page_get_slab(struct page *page) 603static inline struct slab *page_get_slab(struct page *page)
602{ 604{
605 if (unlikely(PageCompound(page)))
606 page = (struct page *)page_private(page);
603 return (struct slab *)page->lru.prev; 607 return (struct slab *)page->lru.prev;
604} 608}
605 609
@@ -2412,8 +2416,11 @@ static void set_slab_attr(struct kmem_cache *cachep, struct slab *slabp,
2412 struct page *page; 2416 struct page *page;
2413 2417
2414 /* Nasty!!!!!! I hope this is OK. */ 2418 /* Nasty!!!!!! I hope this is OK. */
2415 i = 1 << cachep->gfporder;
2416 page = virt_to_page(objp); 2419 page = virt_to_page(objp);
2420
2421 i = 1;
2422 if (likely(!PageCompound(page)))
2423 i <<= cachep->gfporder;
2417 do { 2424 do {
2418 page_set_cache(page, cachep); 2425 page_set_cache(page, cachep);
2419 page_set_slab(page, slabp); 2426 page_set_slab(page, slabp);