Date: Sat, 19 Feb 2005 01:55:26 +0900 From: Kazuaki Oda <kaakun@highway.ne.jp> To: Daniel Eischen <deischen@freebsd.org> Cc: threads@freebsd.org Subject: Re: thread accounting in libpthread Message-ID: <42161DFE.70701@highway.ne.jp> In-Reply-To: <Pine.GSO.4.43.0502181107190.15827-100000@sea.ntplx.net> References: <Pine.GSO.4.43.0502181107190.15827-100000@sea.ntplx.net>
next in thread | previous in thread | raw e-mail | index | archive | help
Daniel Eischen wrote: >On Fri, 18 Feb 2005, Kazuaki Oda wrote: > > > >>Hi, >> >>thr_accounting function (libpthread/thread/thr_kern.c) calculates >>thread->slice_usec, and it uses tm_uticks, tm_sticks and _clock_res_usec. >>I think that kernel counts up tm_uticks and tm_sticks at statclock interrupt >>time, and on -CURRENT _clock_res_usec is 1000 and on 5-STABLE it is 10000. >> >>Does thr_accounting calculate thread->slice_usec correctly? >> >> > >I just fixed this. It didn't really affect anything, though, since >it's all relative. You could have used any bogus number for the >resolution of a tick. > > > Thanks. And while looking at thr_kern.c, I've had one more question. In kse_switchout_thread, after calling thr_accounting thread is placed at the tail of run queue or at the head of it according to thread->slice_usec. But in kse_check_completed, thread is just placed at the tail of run queue. Is there any reason why thread is not placed at the head of run queue in case of thread->slice_usec != -1? -------------------- Kazuaki Oda
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?42161DFE.70701>