All of lore.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Ben Segall <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, mingo@redhat.com,
	bsegall@google.com, hpa@zytor.com, mingo@kernel.org,
	peterz@infradead.org, tglx@linutronix.de
Subject: [tip:sched/core] sched: Fix exec_start/task_hot on migrated tasks
Date: Mon, 19 May 2014 06:07:54 -0700	[thread overview]
Message-ID: <tip-763e54552ad8eebb213db1fc591724067d83d95d@git.kernel.org> (raw)
In-Reply-To: <20140515225920.7179.13924.stgit@sword-of-the-dawn.mtv.corp.google.com>

Commit-ID:  763e54552ad8eebb213db1fc591724067d83d95d
Gitweb:     http://git.kernel.org/tip/763e54552ad8eebb213db1fc591724067d83d95d
Author:     Ben Segall <bsegall@google.com>
AuthorDate: Thu, 15 May 2014 15:59:20 -0700
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Mon, 19 May 2014 22:02:39 +0900

sched: Fix exec_start/task_hot on migrated tasks

task_hot checks exec_start on any runnable task, but if it has been
migrated since the it last ran, then exec_start is a clock_task from
another cpu. If the old cpu's clock_task was sufficiently far ahead of
this cpu's then the task will not be considered for another migration
until it has run. Instead reset exec_start whenever a task is migrated,
since it is presumably no longer hot anyway.

Cc: Ingo Molnar <mingo@redhat.com>
Signed-off-by: Ben Segall <bsegall@google.com>
[peterz: made it compile]
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20140515225920.7179.13924.stgit@sword-of-the-dawn.mtv.corp.google.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 kernel/sched/fair.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 28ccf50..dd3fa14 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4544,6 +4544,9 @@ migrate_task_rq_fair(struct task_struct *p, int next_cpu)
 		atomic_long_add(se->avg.load_avg_contrib,
 						&cfs_rq->removed_load);
 	}
+
+	/* We have migrated, no longer consider this task hot */
+	se->exec_start = 0;
 }
 #endif /* CONFIG_SMP */
 

  parent reply	other threads:[~2014-05-19 13:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-15 22:59 [PATCH] sched: fix exec_start/task_hot on migrated tasks Ben Segall
2014-05-16  8:04 ` Peter Zijlstra
2014-05-16 13:57   ` Preeti Murthy
2014-05-16 14:17     ` Peter Zijlstra
2014-05-19  8:13       ` Preeti U Murthy
2014-05-16 10:20 ` Peter Zijlstra
2014-05-16 16:57   ` bsegall
2014-05-19 13:07 ` tip-bot for Ben Segall [this message]
2014-05-22 12:26 ` [tip:sched/core] sched: Fix " tip-bot for Ben Segall

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=tip-763e54552ad8eebb213db1fc591724067d83d95d@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=bsegall@google.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /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.