From: Matt Mackall Date: Tue, 5 Feb 2008 06:29:37 +0000 (-0800) Subject: slob: fix free block merging at head of subpage X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=679299b32dbf9bac4bdaedc850fb95d0f81b4963;p=linux-beck.git slob: fix free block merging at head of subpage We weren't merging freed blocks at the beginning of the free list. Fixing this showed a 2.5% efficiency improvement in a userspace test harness. Signed-off-by: Matt Mackall Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/slob.c b/mm/slob.c index 773a7aa80ab5..c56c5e57c192 100644 --- a/mm/slob.c +++ b/mm/slob.c @@ -398,6 +398,10 @@ static void slob_free(void *block, int size) sp->units += units; if (b < sp->free) { + if (b + units == sp->free) { + units += slob_units(sp->free); + sp->free = slob_next(sp->free); + } set_slob(b, units, sp->free); sp->free = b; } else {