Page MenuHomeFreeBSD

Use only as many free bits as is necessary for the slab size.
ClosedPublic

Authored by jeff on Wed, Nov 27, 10:27 PM.

Details

Summary

This saves space. I need to re-run a/b tests but we were allocating 32bytes of space in each slab for bits. For awkward large sizes this can waste a whole items worth of memory.

I will post some a/b tests of keg layout later to show how much of an impact it makes. It is simple enough that it should go in regardless.

The boot page allocation size changed because we no longer have any hash zones for boot zones.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

jeff created this revision.Wed, Nov 27, 10:27 PM
jeff edited the summary of this revision. (Show Details)Wed, Nov 27, 10:39 PM
jeff added reviewers: markj, rlibby.
markj added inline comments.Mon, Dec 2, 5:57 PM
sys/vm/uma_core.c
1812 ↗(On Diff #64980)

I think you can combine these lines now.

This assertion also doesn't really make sense anymore, you can even change <= to ==.

sys/vm/uma_int.h
311 ↗(On Diff #64980)

It would be nice if we could assert that the keg is not offpage when this function is being used.

rlibby accepted this revision.Mon, Dec 2, 6:48 PM
rlibby added inline comments.
sys/vm/uma_core.c
1541–1542 ↗(On Diff #64980)

Could simplify to rsize = roundup2(rsize, keg->uk_align + 1);

2314–2324 ↗(On Diff #64980)

I.e., because we know the specific sizes of our buckets and of the slabzone and hashzone? Maybe we should leave a comment behind about this? Anyway I see we will panic in startup_alloc if we are wrong here, so this seems fine.

sys/vm/uma_int.h
274–275 ↗(On Diff #64980)

Just curious, why did this move?

This revision is now accepted and ready to land.Mon, Dec 2, 6:48 PM
jeff added inline comments.Mon, Dec 2, 8:19 PM
sys/vm/uma_int.h
274–275 ↗(On Diff #64980)

Too much merge fuckery with too many patchsets. It goes away in my next commit but I can move it back.

311 ↗(On Diff #64980)

Unfortunately we mostly use them before we even have a keg setup.