Date: Sat, 20 Nov 2010 02:16:24 +0100 From: Ivan Voras <ivoras@freebsd.org> To: freebsd-current@freebsd.org Cc: freebsd-performance@freebsd.org, freebsd-stable@freebsd.org Subject: Re: TTY task group scheduling Message-ID: <ic77h9$39d$1@dough.gmane.org> In-Reply-To: <20101120004955.68c8af6a.taku@tackymt.homeip.net> References: <AANLkTinHSX1%2Bs3hrHyDeU2Vfp6zekTe04XkHhTc2jtLv@mail.gmail.com> <4CE50849.106@zedat.fu-berlin.de> <4CE52177.3020306@freebsd.org> <AANLkTimq=5KJb5AGA6H0yA7AWrp%2BHZMRhfH6pnh=_NqA@mail.gmail.com> <4CE58CD8.2000407@mail.zedat.fu-berlin.de> <20101120004955.68c8af6a.taku@tackymt.homeip.net>
next in thread | previous in thread | raw e-mail | index | archive | help
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); > } > > >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ic77h9$39d$1>