Commit 679299b3 authored by Matt Mackall's avatar Matt Mackall Committed by Linus Torvalds

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: default avatarMatt Mackall <mpm@selenic.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 8bc3be27
...@@ -398,6 +398,10 @@ static void slob_free(void *block, int size) ...@@ -398,6 +398,10 @@ static void slob_free(void *block, int size)
sp->units += units; sp->units += units;
if (b < sp->free) { 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); set_slob(b, units, sp->free);
sp->free = b; sp->free = b;
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment