Message-ID: Date: Mon, 30 Jan 2006 13:37:07 +0200 From: Dmitry Adamushko Subject: Re: [Xenomai-core] [BUG] racy xnshadow_harden under CONFIG_PREEMPT In-Reply-To: <43D62B07.3030703@domain.hid> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1285_20778180.1138621027107" References: <43D21144.8040005@domain.hid> <43D62B07.3030703@domain.hid> List-Id: "Xenomai life and development \(bug reports, patches, discussions\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: xenomai@xenomai.org ------=_Part_1285_20778180.1138621027107 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline >> ... > I have not checked it yet but my presupposition that something as easy as > : > > > > preempt_disable() > > > > wake_up_interruptible_sync(); > > schedule(); > > > > preempt_enable(); > > It's a no-go: "scheduling while atomic". One of my first attempts to > solve it. My fault. I meant the way preempt_schedule() and preempt_irq_schedule() cal= l schedule() while being non-preemptible. To this end, ACTIVE_PREEMPT is set up. The use of preempt_enable/disable() here is wrong. The only way to enter schedule() without being preemptible is via > ACTIVE_PREEMPT. But the effect of that flag should be well-known now. > Kind of Gordian knot. :( Maybe I have missed something so just for my curiosity : what does prevent the use of PREEMPT_ACTIVE here? We don't have a "preempted while atomic" message here as it seems to be a legal way to call schedule() with that flag being set up. > > > > > could work... err.. and don't blame me if no, it's some one else who ha= s > > written that nonsense :o) > > > > -- > > Best regards, > > Dmitry Adamushko > > > > Jan > > > > -- Best regards, Dmitry Adamushko ------=_Part_1285_20778180.1138621027107 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
>> ...

> I h= ave not checked it yet but my presupposition that something as easy as : >
> preempt_disable()
>
> wake_up_interruptible_sync()= ;
> schedule();
>
> preempt_enable();

It's a no-go= : "scheduling while atomic". One of my first attempts to
solve= it.

My fault. I meant the way preempt_schedule() and preempt_irq_schedule() cal= l schedule() while being non-preemptible.
To this end, ACTIVE_PREEMPT is set up.
The use of preempt_enable/disable() here is wrong.
 

T= he only way to enter schedule() without being preemptible is via
ACTIVE_= PREEMPT. But the effect of that flag should be well-known now.
Kind of Gordian knot. :(

Maybe I have missed something so just for my curiosity : what does prevent = the use of PREEMPT_ACTIVE here?
We don't have a "preempted while atomic" message here as it seems= to be a legal way to call schedule() with that flag being set up.
 

&= gt;
>
> could work... err.. and don't blame me if no, it's some= one else who has
> written that nonsense :o)
>
> --
> Best regards,=
> Dmitry Adamushko
>

Jan






--
Best regards,
Dmitry Adamushko ------=_Part_1285_20778180.1138621027107--