All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sched: fix tracepoint in scheduler.
@ 2014-04-03 12:12 Dongsheng Yang
  2014-04-03 14:18 ` Rik van Riel
  2014-04-04 12:52 ` Peter Zijlstra
  0 siblings, 2 replies; 5+ messages in thread
From: Dongsheng Yang @ 2014-04-03 12:12 UTC (permalink / raw)
  To: mingo, peterz; +Cc: linux-kernel, Dongsheng Yang

In function set_task_cpu(), if cpu == new_cpu,
there is no migration happen. But current trace point
will raise a migration trace event.

This patch change trace point to right place,
only when migration really happen, an event will
be threw out.

Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
---
 kernel/sched/core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 9cae286..6708aff 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -998,9 +998,8 @@ void set_task_cpu(struct task_struct *p, unsigned int new_cpu)
 #endif
 #endif
 
-	trace_sched_migrate_task(p, new_cpu);
-
 	if (task_cpu(p) != new_cpu) {
+		trace_sched_migrate_task(p, new_cpu);
 		if (p->sched_class->migrate_task_rq)
 			p->sched_class->migrate_task_rq(p, new_cpu);
 		p->se.nr_migrations++;
-- 
1.8.2.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] sched: fix tracepoint in scheduler.
  2014-04-03 12:12 [PATCH] sched: fix tracepoint in scheduler Dongsheng Yang
@ 2014-04-03 14:18 ` Rik van Riel
  2014-04-04 12:52 ` Peter Zijlstra
  1 sibling, 0 replies; 5+ messages in thread
From: Rik van Riel @ 2014-04-03 14:18 UTC (permalink / raw)
  To: Dongsheng Yang, mingo, peterz; +Cc: linux-kernel

On 04/03/2014 08:12 AM, Dongsheng Yang wrote:
> In function set_task_cpu(), if cpu == new_cpu,
> there is no migration happen. But current trace point
> will raise a migration trace event.
> 
> This patch change trace point to right place,
> only when migration really happen, an event will
> be threw out.
> 
> Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>

I don't see any obvious place where set_task_cpu is called
with cpu == new_cpu, but there might be an un-obvious place,
because that if looks like it's there for a reason :)

Acked-by: Rik van Riel <riel@redhat.com>

-- 
All rights reversed

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] sched: fix tracepoint in scheduler.
  2014-04-03 12:12 [PATCH] sched: fix tracepoint in scheduler Dongsheng Yang
  2014-04-03 14:18 ` Rik van Riel
@ 2014-04-04 12:52 ` Peter Zijlstra
  2014-05-21 10:03   ` Dongsheng Yang
  1 sibling, 1 reply; 5+ messages in thread
From: Peter Zijlstra @ 2014-04-04 12:52 UTC (permalink / raw)
  To: Dongsheng Yang; +Cc: mingo, linux-kernel

On Thu, Apr 03, 2014 at 08:12:48PM +0800, Dongsheng Yang wrote:
> In function set_task_cpu(), if cpu == new_cpu,
> there is no migration happen. But current trace point
> will raise a migration trace event.
> 
> This patch change trace point to right place,
> only when migration really happen, an event will
> be threw out.

Yeah its there so we can see pointless 'migrations'.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] sched: fix tracepoint in scheduler.
  2014-04-04 12:52 ` Peter Zijlstra
@ 2014-05-21 10:03   ` Dongsheng Yang
  2014-05-21 10:47     ` Peter Zijlstra
  0 siblings, 1 reply; 5+ messages in thread
From: Dongsheng Yang @ 2014-05-21 10:03 UTC (permalink / raw)
  To: Peter Zijlstra; +Cc: Dongsheng Yang, mingo, linux-kernel

Hi Peter, did you forget to take this patch? :-)

On Fri, Apr 4, 2014 at 8:52 PM, Peter Zijlstra <peterz@infradead.org> wrote:
> On Thu, Apr 03, 2014 at 08:12:48PM +0800, Dongsheng Yang wrote:
>> In function set_task_cpu(), if cpu == new_cpu,
>> there is no migration happen. But current trace point
>> will raise a migration trace event.
>>
>> This patch change trace point to right place,
>> only when migration really happen, an event will
>> be threw out.
>
> Yeah its there so we can see pointless 'migrations'.
> --
> 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/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] sched: fix tracepoint in scheduler.
  2014-05-21 10:03   ` Dongsheng Yang
@ 2014-05-21 10:47     ` Peter Zijlstra
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Zijlstra @ 2014-05-21 10:47 UTC (permalink / raw)
  To: Dongsheng Yang; +Cc: Dongsheng Yang, mingo, linux-kernel

On Wed, May 21, 2014 at 06:03:53PM +0800, Dongsheng Yang wrote:
> Hi Peter, did you forget to take this patch? :-)

No, I skipped it on purpose, its useful to be able to see if code tries
to do superfluous migrations.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-05-21 10:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-03 12:12 [PATCH] sched: fix tracepoint in scheduler Dongsheng Yang
2014-04-03 14:18 ` Rik van Riel
2014-04-04 12:52 ` Peter Zijlstra
2014-05-21 10:03   ` Dongsheng Yang
2014-05-21 10:47     ` Peter Zijlstra

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.