* use of PREEMPT_ACTIVE ?
@ 2004-03-18 19:51 Julien.Soula
2004-03-18 20:06 ` Robert Love
0 siblings, 1 reply; 2+ messages in thread
From: Julien.Soula @ 2004-03-18 19:51 UTC (permalink / raw)
To: linux-kernel; +Cc: rml
[-- Attachment #1: Type: text/plain, Size: 522 bytes --]
hello,
the PREEMPT_ACTIVE flag set by preempt_schedule() or during return of
interrupt / exception / syscall. And it's tested in schedule() to
avoid some operations like deactivate_task().
Our purpose is to force deactivation of the task. So we planned to set
task state to TASK_INTERRUPTIBLE value and then to call
schedule(). However the PREEMPT_ACTIVE flag can prevent it.
So what is the significance of the PREEMPT_ACTIVE flag and the test in
schedule() ?
Sincerly, thanks in advance,
--
Julien
[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 2656 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: use of PREEMPT_ACTIVE ?
2004-03-18 19:51 use of PREEMPT_ACTIVE ? Julien.Soula
@ 2004-03-18 20:06 ` Robert Love
0 siblings, 0 replies; 2+ messages in thread
From: Robert Love @ 2004-03-18 20:06 UTC (permalink / raw)
To: Julien.Soula; +Cc: linux-kernel
On Thu, 2004-03-18 at 14:51, Julien.Soula@lifl.fr wrote:
> the PREEMPT_ACTIVE flag set by preempt_schedule() or during return of
> interrupt / exception / syscall. And it's tested in schedule() to
> avoid some operations like deactivate_task().
>
> Our purpose is to force deactivation of the task. So we planned to set
> task state to TASK_INTERRUPTIBLE value and then to call
> schedule(). However the PREEMPT_ACTIVE flag can prevent it.
>
> So what is the significance of the PREEMPT_ACTIVE flag and the test in
> schedule() ?
It lets a task be preempted when state != TASK_RUNNING. By preventing
the task from being deactivated, it can be rescheduled correctly.
Otherwise, a task that was, say, TASK_INTERRUPTIBLE could be preempted
before it put itself on a wait queue.
Marking the task that is preempted is a simple solution to the race.
If you want to force the deactivation of the task, there is really no
difference. Set it to TASK_INTERRUPTIBLE, do whatever you need to do,
and call schedule().
PREEMPT_ACTIVE is unrelated to what you want to do.
Robert Love
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-03-18 20:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-18 19:51 use of PREEMPT_ACTIVE ? Julien.Soula
2004-03-18 20:06 ` Robert Love
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox