These handy scripts to make use of the BFS patches' extra scheduling policies (soft realtime for music production, emulation gaming, video calling, etc. and forced idle-only to keep long-term and high-load tasks out of the way)
Execute a command or enhance a running process with isosynchronous scheduling, the highest priority and the most favorable IO policy (almost realtime):
if [[ $1 == -p ]]; then shift schedtool -I -n -20 "$@" ionice -c 2 -n 0 -p "$@" else schedtool -I -n -20 -e ionice -c 2 -n 0 "$@" fi
Execute a command or limit a running process with idle priority scheduling, the lowest priority and the least favorable IO policy (buried alive):
if [[ $1 == -p ]]; then shift schedtool -D -n 20 "$@" ionice -c 3 -p "$@" else schedtool -D -n 20 -e ionice -c 3 "$@" fi
For example, make X near-realtime:
sudo isosched -p `pidof X`
Then start PCSX2 at near-realtime
This should give you the maximum frame rate and best AV synchronization possible. Also works well for WINE programs.
Last edited by quequotion (2014-08-01 20:57:26)
Ordinary users are not allowed to increase priority by default (the policy seems designed for multi-user systems).
If you have administrative rights, replace "$USER" with your username and append the following line to control your own destiny:
$USER - nice -20
Last edited by quequotion (2014-08-01 20:59:01)