TTY task group scheduling
Ivan Voras
ivoras at freebsd.org
Sat Nov 20 01:16:41 UTC 2010
On 11/19/10 16:49, Taku YAMAMOTO wrote:
> I have a dumb local hack to grant ts_slice proportional to the duration
> the waking thread slept rather than unconditionally reset to sched_slice.
>
>
> --- sys/kern/sched_ule.c.orig
> +++ sys/kern/sched_ule.c
> @@ -1928,12 +1928,16 @@ sched_wakeup(struct thread *td)
> u_int hzticks;
>
> hzticks = (ticks - slptick)<< SCHED_TICK_SHIFT;
> + if (hzticks> SCHED_SLP_RUN_MAX)
> + hzticks = SCHED_SLP_RUN_MAX;
> ts->ts_slptime += hzticks;
> + /* Grant additional slices after we sleep. */
> + ts->ts_slice += hzticks / tickincr;
> + if (ts->ts_slice > sched_slice)
> + ts->ts_slice = sched_slice;
If I read it correctly, now instead of the slice given to the thread
being always sched_slice, now it is reduced to a value smaller than
sched_slice based on how long did the thread sleep?
How does that help?
> sched_interact_update(td);
> sched_pctcpu_update(ts);
> }
> - /* Reset the slice value after we sleep. */
> - ts->ts_slice = sched_slice;
> sched_add(td, SRQ_BORING);
> }
>
>
>
More information about the freebsd-current
mailing list