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)
Thu, Mar 28, 7:03 PM
Unknown Object (File)
Dec 20 2023, 5:57 AM
Unknown Object (File)
Nov 15 2023, 9:16 AM
Unknown Object (File)
Nov 10 2023, 6:59 PM
Unknown Object (File)
Oct 14 2023, 8:18 AM
Unknown Object (File)
Oct 9 2023, 5:54 PM
Unknown Object (File)
Sep 1 2023, 8:22 AM
Unknown Object (File)
Sep 1 2023, 8:22 AM
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.