Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Jan 2007 13:15:15 -0700
From:      "Coleman Kane" <zombyfork@gmail.com>
To:        "Anand H. Krishnan" <anandhkrishnan@gmail.com>
Cc:        hackers@freebsd.org
Subject:   Re: Doubts with scheduler code
Message-ID:  <346a80220701021215h91ea76dr5a32b6ebe5bb1362@mail.gmail.com>
In-Reply-To: <9bf098930701020242t232a1131r355c693618169441@mail.gmail.com>
References:  <9bf098930701020242t232a1131r355c693618169441@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 1/2/07, Anand H. Krishnan <anandhkrishnan@gmail.com> wrote:
>
> Hi,
>
> I had a couple of doubts when I was going through 6.1 freebsd code.
>
> * First one is in the  wakeup() code. After a series of calls wakeup()
> lands in maybe_preempt() and if preemption is enabled maybe_preempt()
> switches to a new thread (if a high priority thread has been made
> runnable).
> That means that an interrupt handler which calls wakeup() will not return
> immediately. (I'm looking @ ULE scheduler).
>
> So is there a problem when wakeup() is called from high priority (fast
> interr
> upt) handlers ?
>
> * Second one is in spinlock code. Can anyone say why critical_enter is
> called from spinlock_enter() ? The only thing that critical_enter seems to
> be doing is to increment td_critnest which probably helps in finding out
> whether a thread can be pre-empted or not. But spinlock_enter() disables
> interrupts and I fail to understand how can any thread become runnable
> and get scheduled in between.
>
> I've one more..
>
> * msleep() allows a thread to change it's priority when it gets woken up
> and
> in many places they gets woken up with very high priority indeed. Is there
> any convincing reason as to why it should be ?
>
> Thanks,
> Anand


Anand,

If I remember correctly a significant amount of the ULE scheduler code from
6.1 (and 7-CUR at that time) has been overhauled. In fact, the scheduler was
taken off the list of "working" due to a bunch of problems. You may want to
review the versions of the scheduler code from the latest -CURRENT or
6.2-RELEASE and then re-ask...

--
Coleman Kane



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?346a80220701021215h91ea76dr5a32b6ebe5bb1362>