Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Apr 2013 15:31:19 -0400
From:      vasanth rao naik sabavat <vasanth.raonaik@gmail.com>
To:        John Baldwin <jhb@freebsd.org>
Cc:        freebsd-hackers@freebsd.org, Adrian Chadd <adrian@freebsd.org>
Subject:   Re: preemptive kernel
Message-ID:  <CAAuizBj8i_kJT6vhWQ2dw_9NV%2BRQd7hqKGpVkwePNhduHggiKA@mail.gmail.com>
In-Reply-To: <201304011433.23781.jhb@freebsd.org>
References:  <CAAuizBgsev6ZgNEuwvB0oZ4U_kJuL1ujMfGR5yy2A6HUAkqQ=g@mail.gmail.com> <CAJ-Vmombz4DC5Ggocy7N5gQxG7xzsKvzK_x=Hn%2BimDLe3460jQ@mail.gmail.com> <CAAuizBhhpkr28GUXVUCNb%2BTaRftW_BbErUMw-sFf=dePE944KA@mail.gmail.com> <201304011433.23781.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Thanks John,
That is helpful.

On Mon, Apr 1, 2013 at 2:33 PM, John Baldwin <jhb@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAAuizBj8i_kJT6vhWQ2dw_9NV%2BRQd7hqKGpVkwePNhduHggiKA>