Page MenuHomeFreeBSD

kern: Introduce RLIMIT_VMM
AcceptedPublic

Authored by bnovkov on Thu, Nov 13, 11:13 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 16, 6:03 AM
Unknown Object (File)
Sun, Nov 16, 6:02 AM
Unknown Object (File)
Sun, Nov 16, 3:58 AM
Unknown Object (File)
Fri, Nov 14, 3:57 PM
Unknown Object (File)
Fri, Nov 14, 3:57 PM
Unknown Object (File)
Fri, Nov 14, 3:55 PM
Unknown Object (File)
Thu, Nov 13, 8:07 PM
Unknown Object (File)
Thu, Nov 13, 7:55 PM
Subscribers

Details

Reviewers
markj
olce
corvink
Group Reviewers
bhyve
Summary

This change introduces a new per-UID limit for controlling the
number of vmm instances, in anticipation of unprivileged bhyve.
This limit is designed to prevent a user from creating an unlimited
amount of vmm instances.

Sponsored by: The FreeBSD Foundation
Sponsored by: Klara, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

corvink added inline comments.
sys/dev/vmm/vmm_dev.c
991

Why changing this to thread?

1187

It would be great to explain in the commit message why we want to restrict the number of vmms and especially, why we're choosing this default value.

bnovkov edited the summary of this revision. (Show Details)

Address @corvink 's comments.

sys/dev/vmm/vmm_dev.c
991

Whoops, that was a leftover from an unrelated previous attempt, thanks for catching it!

1187

I've expanded the commit message, but the limit itself is fairly arbitrary. I'm open to suggestions if you think there's a more reasonable value.

corvink added inline comments.
sys/dev/vmm/vmm_dev.c
1187

I just prefer that we're adding a short reason why choosing this default limit. If it's just a random pick, it's fine but it's worth mentioning in the commit message that it's just a random pick. So, if someone ever wonders why we've chosen this limit he can check the commit message.

This revision is now accepted and ready to land.Tue, Nov 18, 6:53 AM

usr.bin/procstat/procstat_rlimit.c should be updated too.

sys/dev/vmm/vmm_dev.c
20

This sorts after queue.h.

1187

I agree, there should be a comment.

Thinking a bit more, having a max of 1024 is a bit silly, it's possibly too low on large count-count machines. Maybe let's just have it be 4*mp_ncpus or 8*mp_ncpus?

Also this needs to be overridable with a tunable, like hw.vmm.maxcpu above.

sys/kern/kern_resource.c
1776