vm-bhyve icon indicating copy to clipboard operation
vm-bhyve copied to clipboard

Add real/idle-time priority options.

Open eborisch opened this issue 5 years ago • 5 comments

Adds new high_ and low_priority options (enable with "yes") which use rtprio 31 and idprio 0 (lowest of the high, and highest of the low) to move the executing bhyve into the real or idle-time scheduling buckets. Options override preferring highest priority specified.

eborisch avatar Jul 10 '19 22:07 eborisch

I had a need to run one vm with rtprio and had a look at existing PRs before working on the source myself, so I found this one :) Is there a specific reason not to allow custom rt or id priorities here?

Zirias avatar Apr 19 '20 09:04 Zirias

I had a need to run one vm with rtprio and had a look at existing PRs before working on the source myself, so I found this one :) Is there a specific reason not to allow custom rt or id priorities here?

I second this. I think that we should allow custom rt/id priorities.

mateuszkwiatkowski avatar Feb 23 '22 12:02 mateuszkwiatkowski

My guess is that this would be splitting hairs; the current fixed values (the highest (0) of the idle, and lowest (31) of the real-time priorities) let you move the bhyve instance above/below "normal" nice ranges, so everything else you're competing with is likely from the kernel.

That said, there certainly is nothing technically preventing it (save the caveat in man rtprio).

eborisch avatar Feb 23 '22 14:02 eborisch

Real-life scenario where I need that: I have a routing/firewalling VM ("owning" all NICs with PCI passthrough), and on the same machine is a poudriere jail already running on idprio -- still it can cause a lot of load, probably also in (kernel) ZFS code. The only way my networking keeps responsive is setting the routing VM on rtprio.

Zirias avatar Feb 23 '22 15:02 Zirias

I'm not discounting the use case for idprio / rtprio (which is why I submitted the PR in the first place) ... I'm just wondering if there is a real need for fine-grained (within idprio or rtprio ranges) settings. Moving things into rtprio 31 (lowest rt) or idprio 0 places them above or below most tasks.

That said, feel free to modify this code to accept a level [0..31] rather than on/off for "high_priority" or "low_priority" and submit it as a PR; I'll close this one and point to that one.

eborisch avatar Feb 24 '22 03:02 eborisch