Page MenuHomeFreeBSD

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

Authored by jeff on Nov 27 2019, 10:27 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Oct 14, 7:45 AM
Unknown Object (File)
Thu, Sep 25, 10:30 AM
Unknown Object (File)
Sat, Sep 20, 10:10 PM
Unknown Object (File)
Sep 16 2025, 9:52 PM
Unknown Object (File)
Aug 29 2025, 9:48 AM
Unknown Object (File)
Aug 28 2025, 5:22 AM
Unknown Object (File)
Aug 22 2025, 8:57 PM
Unknown Object (File)
Aug 20 2025, 7:53 PM
Subscribers

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 - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jeff added reviewers: markj, rlibby.
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 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.Dec 2 2019, 6:48 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.