From: Con Kolivas <kernel@kolivas.org>
To: Kirill Korotaev <dev@openvz.org>
Cc: Ingo Molnar <mingo@elte.hu>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@osdl.org>
Subject: Re: [PATCH] sched: CPU hotplug race vs. set_cpus_allowed()
Date: Fri, 23 Jun 2006 20:53:22 +1000 [thread overview]
Message-ID: <200606232053.23526.kernel@kolivas.org> (raw)
In-Reply-To: <449BA349.6040901@openvz.org>
On Friday 23 June 2006 18:16, Kirill Korotaev wrote:
> Looks like there is a race between set_cpus_allowed()
> and move_task_off_dead_cpu().
> __migrate_task() doesn't report any err code, so
> task can be left on its runqueue if its cpus_allowed mask
> changed so that dest_cpu is not longer a possible target.
> Also, chaning cpus_allowed mask requires rq->lock being held.
>
> Signed-Off-By: Kirill Korotaev <dev@openvz.org>
>
> Kirill
> P.S. against 2.6.17-mm1
Hi!
Since you've got
-static void __migrate_task(struct task_struct *p, int src_cpu, int dest_cpu)
+static int __migrate_task(struct task_struct *p, int src_cpu, int dest_cpu)
{
runqueue_t *rq_dest, *rq_src;
+ int res = 0;
if (unlikely(cpu_is_offline(dest_cpu)))
- return;
+ return 0;
why not return res here?
oh and ret is a more commonly used name than res (your choice of course).
and an addition to the comment such as "returns non-zero only when it fails to
migrate the task" would be nice.
thanks!
--
-ck
--
-ck
next prev parent reply other threads:[~2006-06-23 10:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-23 8:16 [PATCH] sched: CPU hotplug race vs. set_cpus_allowed() Kirill Korotaev
2006-06-23 8:18 ` Ingo Molnar
2006-06-23 10:53 ` Con Kolivas [this message]
2006-06-24 5:25 ` Andrew Morton
-- strict thread matches above, loose matches on Subject: below --
2006-06-26 7:58 Kirill Korotaev
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=200606232053.23526.kernel@kolivas.org \
--to=kernel@kolivas.org \
--cc=akpm@osdl.org \
--cc=dev@openvz.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.