kernel - usched_dfly revamp (8), add reschedule hints
* Add reschedule hints when issuing a read() on a pipe or socket, or
issuing a blocking kevent() call.
* usched_dfly will force a reschedule after the round-robin count has
passed the half-way point if it detects a scheduling hint. This is
an attempt to avoid rescheduling in the middle of some critical user
operation (e.g. postgres server holding internal locks).
* Add kern.usched_dfly.fast_resched which allows the scheduler to avoid
interrupting a less desireable process with a more desireable process
as long as the priority difference is not too great.
However, default the value to 0, because setting the value has
consequences for interactive responsiveness.
* When running pgbench we recommend leaving fast_resched disabled and
instead running the pgbench at idprio 15 to work around issues where
the postgres server process(es) get interrupted by the pgbench processes
which causes the postgres server process(es) to hit internal lock conflicts
more quickly and enter a semaphore wait more often (when both pgbench and
the postgres servers are running on the same machine).
This is really an issue with postgres server scaling. Because the pgbench's
use so much less cpu than the postgres server processes they are given a
more desireable priority and thus can interrupt the postgres server
processes. We can't really 'fix' this in the scheduler without really
messing up normal interactive responsiveness for the system.
Example:
idprio pgbench -j 80 -c 80 -T 60 -S bench