Page MenuHomeFreeBSD

uma: reorganize flags
ClosedPublic

Authored by rlibby on Jan 3 2020, 1:27 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 18, 6:45 AM
Unknown Object (File)
Tue, Nov 12, 11:17 PM
Unknown Object (File)
Sep 21 2024, 4:37 AM
Unknown Object (File)
Sep 7 2024, 10:57 PM
Unknown Object (File)
Sep 7 2024, 11:47 AM
Unknown Object (File)
Sep 7 2024, 9:51 AM
Unknown Object (File)
Sep 3 2024, 3:44 PM
Unknown Object (File)
Sep 2 2024, 10:17 AM
Subscribers

Details

Reviewers
jeff
markj
Group Reviewers
manpages
Commits
rS356534: uma: reorganize flags
Summary
  • Garbage collect UMA_ZONE_PAGEABLE & UMA_ZONE_STATIC.
  • Move flag VTOSLAB from public to private.
  • Introduce public NOTPAGE flag and make HASH private.
  • Introduce public NOTOUCH flag and make OFFPAGE private.
  • Update man page.

The net effect of this should be to make the contract with clients more
clear. Clients should choose constraints, UMA will figure out how to
implement them. This also breaks the confusing double meaning of
OFFPAGE.

Please feel free to suggest better ways to spell NOTOUCH or NOTPAGE or
better wording for the comments and man page.

Test Plan

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

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

NOTOUCH seems like a good name to me. NOTPAGE is ok with me. NOTVM might be a bit clearer, but it also might be confused with the unrelated M_NOVM.

share/man/man9/zone.9
296 ↗(On Diff #66286)

"The UMA subsystem"?

sys/vm/uma_core.c
1884 ↗(On Diff #66286)

Should we KASSERT that NOTPAGE is not set?

1929 ↗(On Diff #66286)

I see that this assignment moved to keg_small_init(), but why?

This revision is now accepted and ready to land.Jan 3 2020, 4:54 PM
share/man/man9/zone.9
296 ↗(On Diff #66286)

Sure, will do.

sys/vm/uma_core.c
1884 ↗(On Diff #66286)

Yes... or just set HASH if NOTPAGE. It's a fair point. Would you mind if I deferred this comment to an upcoming patch where the three keg_..._init procedures are unified? Sneak peak, but more changes coming: https://github.com/rlibby/freebsd/commit/f4536d8207fc4135daf0d481f036495691614dc7

1929 ↗(On Diff #66286)

It's fine here, it didn't have to move. The reason I moved it is at line 1736, keg_small_init still needed to check either for OFFPAGE or for PCPU being set. It felt weird to me to check for NOTPAGE|OFFPAGE, especially as OFFPAGE really meant PCPU. Additionally I liked better having it so that only keg_..._init controlled the setting of OFFPAGE/HASH.

sys/vm/uma_core.c
1884 ↗(On Diff #66286)

Sure, that's fine. My comment is just nitpicking.

1929 ↗(On Diff #66286)

That seems reasonable to me.

I should have umaperf committed in a day or two.

sys/vm/uma_core.c
1163 ↗(On Diff #66286)

In another patch, we do not need a pointer here. Even if we return to a system with multiple slab zones we can select it via the keg size and flags so that we don't have to cache a pointer to a global.

1805 ↗(On Diff #66286)

I wonder whether it is faster to use vtoslab() or uk_pgoff to lookup the slab for direct mapped architectures with a single page. I guess it is a cache miss to the vm_page vs a cache miss to the keg structure so pgoff should still be faster. Still I could be wrong.

4026 ↗(On Diff #66286)

This is actually the most likely case. We may see a minor benefit from restructuring this whole block. It is also very similar to uma_dbg_getslab() which is weirdly not in uma_dbg.c.

This revision was automatically updated to reflect the committed changes.