Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 May 2013 05:00:13 +0000
From:      Orit Moskovich <oritm@mellanox.com>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>
Subject:   RE: preemptive kernel
Message-ID:  <981733489AB3BD4DB24B48340F53E0A55B0D56E0@MTLDAG01.mtl.com>
In-Reply-To: <20130526154752.GT3047@kib.kiev.ua>
References:  <981733489AB3BD4DB24B48340F53E0A55B0D5590@MTLDAG01.mtl.com> <20130526154752.GT3047@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
Just to be more specific - On x86, during a filter routine all interrupts a=
re disabled on the cpu currently handling a filter routine or only interrup=
ts on the IRQ that generated the interrupt?=20
Is it possible that on a different cpu an interrupt (filter or ithread) of =
the same IRQ will run? Should worry about locking data because an ithread c=
an preempt the same ithread or they'll run concurrently on different cpus?

-----Original Message-----
From: Konstantin Belousov [mailto:kostikbel@gmail.com]=20
Sent: Sunday, May 26, 2013 06:48 PM
To: Orit Moskovich
Cc: freebsd-hackers@freebsd.org
Subject: Re: preemptive kernel

On Sun, May 26, 2013 at 11:09:03AM +0000, Orit Moskovich wrote:
> Can a filter routine preempt another filter routine? And can an interrupt=
 thread (or a filter routine) preempt another ithread?

Filter handler borrows the context from the thread executed at the time of =
the interrupt.  At least on x86 (i.e. i386 and amd64) interrupt handlers ar=
e executed with the interrupts disabled.  So the filter cannot interrupt an=
other filter.

Interrupt threads are executed with the interrupts enabled. So if an interr=
upt is delivered to the CPU while the CPU executed the ithread, the filter =
'preempts' the ithread by executing in its context.  For the same reason, i=
f the interrupt delivered causes a higher-priority thread become ready to r=
un, then the new runnable thread could preempt the interrupt thread accordi=
ng to the priority, affinity and other factors considered by a scheduler.



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