Index: linux-2.6.18-rc4-mm3/mm/slabifier.c =================================================================== --- linux-2.6.18-rc4-mm3.orig/mm/slabifier.c 2006-08-31 10:55:31.910227301 -0700 +++ linux-2.6.18-rc4-mm3/mm/slabifier.c 2006-08-31 11:07:26.244518879 -0700 @@ -298,11 +298,28 @@ page->offset = s->offset; + atomic_long_inc(&s->nr_slabs); + page->slab = (struct slab_cache *)s; __SetPageSlab(page); - atomic_long_inc(&s->nr_slabs); - if (s->objects == 1) + page->freelist = page_address(page); + page->inuse = 0; + + if (s->objects > 1) { + void *end = page->freelist + s->objects * s->size; + void **last = page->freelist; + void *p = page->freelist + s->size; + + while (p < end) { + last[s->offset] = p; + last = p; + p += s->size; + } + last[s->offset] = NULL; + } else __SetPageSlabsingle(page); + + check_free_chain(s, page); return page; } @@ -490,8 +507,6 @@ static struct page *reload(struct slab *s, unsigned long cpu, gfp_t flags, int node) { - void *p, *start, *end; - void **last; struct page *page; redo: @@ -515,19 +530,7 @@ if (!page) return NULL; - start = page_address(page); - page->freelist = start; - - end = start + s->objects * s->size; - last = start; - for (p = start + s->size; p < end; p += s->size) { - last[s->offset] = p; - last = p; - } - last[s->offset] = NULL; - page->inuse = 0; slab_lock(page); - check_free_chain(s, page); gotpage: /*