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)
Oct 30 2024, 12:32 PM
Unknown Object (File)
Oct 4 2024, 10:17 PM
Unknown Object (File)
Oct 1 2024, 3:41 AM
Unknown Object (File)
Sep 27 2024, 8:13 PM
Unknown Object (File)
Sep 8 2024, 3:45 PM
Unknown Object (File)
Sep 8 2024, 11:19 AM
Unknown Object (File)
Sep 8 2024, 9:04 AM
Unknown Object (File)
Sep 7 2024, 11:47 PM
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.