Page MenuHomeFreeBSD

libuvmem: usermode port of vmem(9)
Needs ReviewPublic

Authored by kib on Nov 14 2020, 10:13 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Apr 14, 11:27 PM
Unknown Object (File)
Sun, Apr 14, 9:29 PM
Unknown Object (File)
Sun, Apr 14, 9:04 PM
Unknown Object (File)
Sun, Mar 31, 1:00 AM
Unknown Object (File)
Sun, Mar 31, 1:00 AM
Unknown Object (File)
Sun, Mar 31, 1:00 AM
Unknown Object (File)
Sun, Mar 31, 1:00 AM
Unknown Object (File)
Sun, Mar 31, 1:00 AM

Details

Summary

The quantum cache is disabled, there is no uma.

Intent is to use this for resource allocation in bhyve(8), for start. Addition of -luvmem to bhyve linking was done to test changes to share/mk.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 34916

Event Timeline

kib requested review of this revision.Nov 14 2020, 10:13 PM
grehan added a subscriber: grehan.

No objection from bhyve's PoV.

Seems ok to me, just nitpicking.

sys/kern/subr_vmem.c
609

Commit separately?

817

I would delete the rehash comment and merge the two blocks. All of the functions below can arguably be called "vmem internal functions".

823

This can be a separate commit.

853–854

This can be a separate commit.

1367

Why?

1461

I really dislike conditionally defined top-level local variables, so I'd prefer to move the definition into the if block below. I don't insist on it though.

1594

You could eliminate some inline ifdefs with #define panic(...) assert(0).

1602–1603

Same comment as above wrt local variables.

1618

This can be a separate commit.

1714

This block should probably be formally protected with ifdef _KERNEL as well.

This revision is now accepted and ready to land.Nov 16 2020, 4:41 PM
sys/kern/subr_vmem.c
1461

I agree in general, and if this were some special case (e.g. INVARIANTS) instead of the usual case I'd argue strongly for markj's take.

kib marked 7 inline comments as done.Nov 17 2020, 1:32 AM
kib added inline comments.
sys/kern/subr_vmem.c
1367

To not add __unused declaration, I think it is logically wrong.

1594

There were only two of them so I did not bothered.

This revision was automatically updated to reflect the committed changes.
kib marked 2 inline comments as done.
kib updated this revision to Diff 79634.

Rebase after commit of warning fixes.
Handle Mark notes.

markj added inline comments.
sys/contrib/openzfs/include/sys/zfs_context.h
53

Is this just a reminder to upstream the change? Or is there another problem?

sys/kern/subr_vmem.c
1367

I think (void)qcache_max; is more common for this scenario.

This revision is now accepted and ready to land.Nov 17 2020, 2:38 PM

Add M_*FIT bits to sys/vmem.h for userspace.

This revision now requires review to proceed.Nov 19 2020, 5:37 PM