Skip to content

Commit

Permalink
Allow automatic renicing.
Browse files Browse the repository at this point in the history
  • Loading branch information
ceri committed Jan 28, 2023
1 parent 9cd4dd2 commit 8c38dc5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/etc/poudriere.conf.sample
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,11 @@ DISTFILES_CACHE=/usr/ports/distfiles
# which holdup the rest of the queue to build more quickly.
#ALLOW_MAKE_JOBS_PACKAGES="pkg ccache py*"

# By default poudriere does not nice(3) itself. Set NICE to "yes"
# to increment scheduler priority by 10, or any other value to use that.
# Only root can set negative values.
#NICE=no

# Timestamp every line of build logs
# Default: no
#TIMESTAMP_LOGS=no
Expand Down
11 changes: 11 additions & 0 deletions src/share/poudriere/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8625,6 +8625,17 @@ esac

NCPU=$(sysctl -n hw.ncpu)

if [ "${NICE:=no}" = "no" ]; then
:
else
msg "renicing to NICE value '${NICE}'"
if [ "${NICE}" = "yes" ]; then
renice -n 10 -p $$
else
renice -n ${NICE} -p $$
fi
fi

# Determine if umount -n can be used.
if grep -q "#define[[:space:]]MNT_NONBUSY" /usr/include/sys/mount.h \
2>/dev/null; then
Expand Down

0 comments on commit 8c38dc5

Please sign in to comment.