Index: linux-2.6.18-rc4-mm3/include/linux/page-flags.h =================================================================== --- linux-2.6.18-rc4-mm3.orig/include/linux/page-flags.h 2006-08-31 09:46:58.388464734 -0700 +++ linux-2.6.18-rc4-mm3/include/linux/page-flags.h 2006-08-31 09:47:44.372201891 -0700 @@ -92,7 +92,7 @@ #define PG_buddy 19 /* Page is free, on buddy lists */ #define PG_readahead 20 /* Reminder to do readahead */ - +#define PG_slabsingle 21 /* Slab with a single object */ #if (BITS_PER_LONG > 32) /* @@ -254,6 +254,10 @@ #define SetPageReadahead(page) set_bit(PG_readahead, &(page)->flags) #define TestClearPageReadahead(page) test_and_clear_bit(PG_readahead, &(page)->flags) +#define PageSlabsingle(page) test_bit(PG_slabsingle, &(page)->flags) +#define __SetPageSlabsingle(page) __set_bit(PG_slabsingle, &(page)->flags) +#define __ClearPageSlabsingle(page) __clear_bit(PG_slabsingle, &(page)->flags) + struct page; /* forward declaration */ int test_clear_page_dirty(struct page *page); Index: linux-2.6.18-rc4-mm3/mm/slabifier.c =================================================================== --- linux-2.6.18-rc4-mm3.orig/mm/slabifier.c 2006-08-31 09:46:58.368464850 -0700 +++ linux-2.6.18-rc4-mm3/mm/slabifier.c 2006-08-31 09:48:47.667831767 -0700 @@ -229,7 +229,7 @@ void **object = page->freelist; void *origin = &page->lru; - if (s->objects == 1) + if (PageSlabsingle(page)) return 0; check_slab(page); @@ -278,6 +278,7 @@ page->mapping = NULL; reset_page_mapcount(page); __ClearPageSlab(page); + __ClearPageSlabsingle(page); s->sc.page_alloc->free(s->sc.page_alloc, page, s->sc.order); } @@ -298,6 +299,8 @@ page->slab = (struct slab_cache *)s; __SetPageSlab(page); atomic_long_inc(&s->nr_slabs); + if (s->objects == 1) + __SetPageSlabsingle(page); return page; } @@ -649,7 +652,7 @@ if (unlikely(sc != page->slab)) goto slab_mismatch; redo: - if (unlikely(s->objects == 1)) + if (unlikely(PageSlabsingle(page))) goto single_object_slab; if (unlikely(!check_valid_pointer(s, page, object, NULL)))