lkml.org 
[lkml]   [2011]   [Sep]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH][RT] Fix warning about bounded threads migrating
From
Date
Clark can you add this patch. You can fold it into the first one if you
want.

The warning for the PF_THREAD_BOUND migrating was causing false reports
because a task that is created on one CPU and bound to another CPU with
kthread_bind() may migrate on wakeup triggering this message. There is
nothing wrong with the use of migrating a thread that was recently
created.

Instead, only warn if the weight of the task's cpus_allowed is greater
than one. That is a clear warning that someone is abusing the
PF_THREAD_BOUND flag.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>

Index: linux-mrg.git/kernel/sched.c
===================================================================
--- linux-mrg.git.orig/kernel/sched.c
+++ linux-mrg.git/kernel/sched.c
@@ -2246,9 +2246,11 @@ void set_task_cpu(struct task_struct *p,
if (task_cpu(p) != new_cpu) {
p->se.nr_migrations++;
perf_sw_event(PERF_COUNT_SW_CPU_MIGRATIONS, 1, 1, NULL, 0);
- if (WARN_ON(p->flags & PF_THREAD_BOUND))
- printk(KERN_WARNING "migrating bounded task %s:%d\n",
- p->comm, p->pid);
+ if (WARN(p->flags & PF_THREAD_BOUND &&
+ cpumask_weight(tsk_cpus_allowed(p)) > 1,
+ "migrating bounded task %s:%d\n",
+ p->comm, p->pid))
+ return;
}

__set_task_cpu(p, new_cpu);



\
 
 \ /
  Last update: 2011-09-29 16:59    [W:0.024 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site