Re: [Question]How to restrict some kind of task?

From: Con Kolivas
Date: Thu Nov 17 2005 - 04:59:07 EST

On Thu, 17 Nov 2005 17:20, liyu wrote:
> I fixed it. we should insert code start of enqueue_task():
> static void enqueue_task(struct task_struct *p, prio_array_t *array)
> {
> unsigned long flags;
> spin_lock_irqsave(&(task_rq(p)->keep_lock), flags);
> if (p->flags & PF_KEEPOVER) {
> list_del(&p->run_list);
> p->state = TASK_RUNNING;
> p->flags &= ~PF_KEEPOVER;
> }
> spin_unlock_irqrestore(&(task_rq(p)->keep_lock), flags);
> ....
> }
> However, this patch still have problem, it may lock entire system.
> I am trying to catch this bug~.

The obvious bug is that there are places that expect a task to be added to the
run list after it has called enqueue_task and you've broken that expectation.
The locking in the rest of your patch did not look too robust, but I don't
have time to review it sorry.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at