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 <mpm@selenic.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Matt Mackall 2008-02-04 22:29:37 -08:00 коммит произвёл Linus Torvalds
Родитель 8bc3be2751
Коммит 679299b32d
1 изменённых файлов: 4 добавлений и 0 удалений

Просмотреть файл

@ -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 {