Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for additional priority types. #529

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion lib/vm-rctl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,15 @@ rctl::set(){
[ -z "${_pid}" ] && return 1

# check for a priority
[ -n "${_pri}" ] && renice ${_pri} ${_pid} >/dev/null 2>&1
if [ -n "${_pri}" ]; then
if [ "${_pri%%[0-9]*}" = "i" ]; then
idprio ${_pri#i} -${_pid} >/dev/null 2>&1
elif [ "${_pri%%[0-9]*}" = "r" ]; then
rtprio ${_pri#r} -${_pid} >/dev/null 2>&1
else
renice ${_pri} ${_pid} >/dev/null 2>&1
fi
fi

# return if there are no limits
[ -z "${_pcpu}${_rbps}${_wbps}${_riops}${_wiops}" ] && return 1
Expand Down
9 changes: 6 additions & 3 deletions vm.8
Original file line number Diff line number Diff line change
Expand Up @@ -1546,10 +1546,13 @@ Note that although the guest is technically stopped when this process runs, call
will still consider the guest locked.
.It priority
Allows a priority to be set for a guest by using the
.Xr nice 8
facility. The default value is 0, and has a range from -20, which is the highest
.Xr nice 1
or
.Xr rtprio 1
facilities. The default value is 0, and has a range from -20, which is the highest
priority, to 20. A priority of 20 will cause the guest to only run when the host
system is idle.
system is idle. Priority values prefixed with "r" or "i" will set realtime or idletime
priorities, respectively.
.It limit_pcpu
Limit the bhyve process to the specified cpu percentage.
.Pp
Expand Down