Page MenuHomeFreeBSD

libuvmem: usermode port of vmem(9)
Needs ReviewPublic

Authored by kib on Sat, Nov 14, 10:13 PM.

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
Lint
Lint Skipped
Unit
Unit Tests Skipped
Build Status
Buildable 34916

Event Timeline

kib requested review of this revision.Sat, Nov 14, 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?

816

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.

1366

Why?

1460

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.

1593

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.Mon, Nov 16, 4:41 PM
sys/kern/subr_vmem.c
1460

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.Tue, Nov 17, 1:32 AM
kib added inline comments.
sys/kern/subr_vmem.c
1366

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

1593

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
52

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

sys/kern/subr_vmem.c
1366

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

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

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

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