use of PREEMPT_ACTIVE ?
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,
Signature · 1 line
Julien
Quoted 10 lines · On Thu, 2004-03-18 at 14:51, [email protected] wrote:
the
PREEMPT_ACTIVEflag set bypreempt_schedule()or during return of interrupt / exception / syscall. And it's tested inschedule()to avoid some operations likedeactivate_task().Our purpose is to force deactivation of the task. So we planned to set task state to
TASK_INTERRUPTIBLEvalue and then to callschedule(). However thePREEMPT_ACTIVEflag can prevent it.So what is the significance of the
PREEMPT_ACTIVEflag and the test inschedule()?
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