brian.lu
2006-May-02 08:13 UTC
[dtrace-discuss] A question about sched:::sleep and sched::wakeup
Hi, experts, I use dtrace to monitor a thread. I find it first sleeps on an object ( the thread uses select() to sleep 5ms) and then it is enqueued into runnable queue. I use a script to catch sched:::sleep, sched:::on-cpu sched:::off-cpu and sched:::wakeup According to the dtrace manual, after sched:::sleep is fired, sched:::wakeup should also be fired when the thread is waken up. But sched:::wakeup is not fired and sched:::enqueue is fired instead? I don''t use any condition in "sched:::wakeup". Does anyone know why? Thanks Brian
Jonathan Adams
2006-May-02 16:17 UTC
[dtrace-discuss] A question about sched:::sleep and sched::wakeup
On Tue, May 02, 2006 at 04:13:30PM +0800, brian.lu wrote:> Hi, experts, > > I use dtrace to monitor a thread. I find it first sleeps on an object ( > the thread uses select() to sleep 5ms) > and then it is enqueued into runnable queue. > > I use a script to catch sched:::sleep, sched:::on-cpu sched:::off-cpu > and sched:::wakeup According to the dtrace manual, after sched:::sleep > is fired, sched:::wakeup should also be fired when the thread is waken > up. > > But sched:::wakeup is not fired and sched:::enqueue is fired instead? > I don''t use any condition in "sched:::wakeup". > > Does anyone know why?This looks like a bug; cv_timedwait_sig() (which is what the select() turns into) sets up a timer to call setrun() on the thread when the timeout expires. That turns into a cv_unsleep() call, which removes it from the queue and sets it running, but never fires the sched:::wakeup call. File a bug. Cheers, - jonathan -- Jonathan Adams, Solaris Kernel Development