From: Con Kolivas <kernel@kolivas.org>
To: liyu@ccoss.com.cn
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: [Question]How to restrict some kind of task?
Date: Thu, 17 Nov 2005 20:57:32 +1100 [thread overview]
Message-ID: <200511172057.33131.kernel@kolivas.org> (raw)
In-Reply-To: <437C2133.2030103@ccoss.com.cn>
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.
Cheers,
Con
next prev parent reply other threads:[~2005-11-17 9:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-15 10:18 [Question]How to restrict some kind of task? liyu
2005-11-15 10:21 ` Con Kolivas
2005-11-16 1:16 ` liyu
2005-11-17 6:20 ` liyu
2005-11-17 9:57 ` Con Kolivas [this message]
2005-11-18 8:37 ` [Question] spin_lock in interrupt handler liyu
2005-11-18 22:44 ` Steven Rostedt
2005-11-21 1:13 ` liyu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200511172057.33131.kernel@kolivas.org \
--to=kernel@kolivas.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liyu@ccoss.com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox