Skip to content

Commit

Permalink
slob: fix free block merging at head of subpage
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Matt Mackall authored and Linus Torvalds committed Feb 5, 2008
1 parent 8bc3be2 commit 679299b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mm/slob.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 679299b

Please sign in to comment.