Page MenuHomeFreeBSD

uma: split slabzone into two sizes
ClosedPublic

Authored by rlibby on Jan 13 2020, 8:53 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 18, 12:58 PM
Unknown Object (File)
Tue, Apr 16, 9:00 AM
Unknown Object (File)
Dec 23 2023, 3:47 AM
Unknown Object (File)
Dec 8 2023, 3:25 PM
Unknown Object (File)
Nov 8 2023, 3:16 PM
Unknown Object (File)
Sep 6 2023, 8:38 AM
Unknown Object (File)
Sep 6 2023, 8:38 AM
Unknown Object (File)
Sep 6 2023, 8:37 AM
Subscribers

Details

Summary

By allowing more items per slab, we can improve memory efficiency for
small allocs. If we were just to increase the bitmap size of the
slabzone, we would then waste slabzone memory. So, split slabzone into
two zones, one especially for 8-byte allocs (512 per slab). The
practical effect should be reduced memory usage for counter(9).

Test Plan

kyua test -k /usr/tests/sys/Kyuafile

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 28641
Build 26670: arc lint + arc unit

Event Timeline

sys/kern/kern_prot.c
2057

This and the same in subr_bus.c are actually not necessary with a smallest alloc size of 8 bytes, but I needed to fix them when testing with a smallest alloc size of 4 bytes.

jeff added inline comments.
sys/vm/uma_core.c
120

Now that virtually nothing uses a hash zone we should only be using offpage slabs for relatively large allocations. Given that I suspect we could dramatically shrink slabzone0 and save a lot of memory until we can embed slabs in pages. 64bit would be more than enough for any case that uses offpage due to fragmentation.

sys/vm/uma_int.h
428

At this point it feels something like a historical accident to call them hash slabs.

This revision is now accepted and ready to land.Jan 13 2020, 9:05 AM
markj added inline comments.
sys/vm/uma_core.c
363

Missing parens.

sys/vm/uma_int.h
428

uma_offpage_slab_t?

441

Missing parens.

rlibby marked 2 inline comments as done.

markj feedback: style(9)

This revision now requires review to proceed.Jan 13 2020, 5:13 PM
sys/vm/uma_core.c
120

Yes... As-is, we could probably tune slabzone0's size down. But with page-embedded slabs, we might then want to tune it back up, or at least to a different value. Perhaps we wait until we get page-embedded slabs in before we tune?

sys/vm/uma_int.h
428

I agree, it puts the emphasis in the wrong place. I'd like to leave it alone for this commit at least though.

markj added inline comments.
sys/kern/kern_prot.c
2057

I'd suggest committing them separately if you weren't already going to.

This revision is now accepted and ready to land.Jan 13 2020, 6:21 PM
sys/kern/kern_prot.c
2057

Okay, I'll split them out.

I am happy to tweak parameters and possibly function names in a follow up patch.

Go ahead with this

This revision was automatically updated to reflect the committed changes.