lkml.org 
[lkml]   [2006]   [Jun]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] sched: CPU hotplug race vs. set_cpus_allowed()
Date
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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-06-23 12:56    [W:0.048 / U:0.688 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site