preemptive kernel

vasanth rao naik sabavat vasanth.raonaik at gmail.com
Tue Apr 2 19:31:27 UTC 2013


Thanks John,
That is helpful.

On Mon, Apr 1, 2013 at 2:33 PM, John Baldwin <jhb at freebsd.org> wrote:

> On Friday, March 22, 2013 4:10:16 pm vasanth rao naik sabavat wrote:
> > Hi Adrian,
> >
> > Just to clarify, is the kernel pre-emption involuntary?
> >
> > Let say I have a kernel thread processing a huge list of entries, would
> > this thread get involuntarily context switched out because of kernel
> > preemption?
> >
> > What is the time slice after which a kernel thread can involuntarily
> > context switched out?
> >
> > Could you please point to the file in the source code which handles the
> > kernel pre-emption.
>
> In-kernel preemption is driven by interrupts, not time slices.  If an
> interrupt arrives that awakens a higher priority thread (e.g. an interrupt
> thread), or if your thread awakens a thread that has higher priority (e.g.
> due
> to wakeup() or cv_signal()), then your thread will be preempted.
>
> In general time-based preemptions are only done for user threads.
>
> --
> John Baldwin
>



-- 
Thanks,
Vasanth


More information about the freebsd-hackers mailing list