public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Preeti Murthy <preeti.lkml@gmail.com>
Cc: Ben Segall <bsegall@google.com>, Ingo Molnar <mingo@redhat.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Preeti U Murthy <preeti@linux.vnet.ibm.com>
Subject: Re: [PATCH] sched: fix exec_start/task_hot on migrated tasks
Date: Fri, 16 May 2014 16:17:45 +0200	[thread overview]
Message-ID: <20140516141745.GU11096@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <CAM4v1pPNfpB+DumFHhi2UZS97zgfBFHEwQYsmQ5E1c2gZFbBww@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1320 bytes --]

On Fri, May 16, 2014 at 07:27:32PM +0530, Preeti Murthy wrote:
> > 0 isn't strictly the right thing to do here, since the clock can wrap,
> > but being wrong every ~585 years isn't too big an issue for this.
> 
> I don't understand this. Will setting it to 0 not indicate beginning
> of ticking? 

In modular spaces there is no beginnings nor endings.

> So when you find out for how long the task has run, the
> difference would be larger than what would have been had you
> let exec_start be at its previous value of the old cpu's clock_task right?

Nope, see the modular space thing, once every ~585 years we'll wrap the
clock and 0 is within range of recently ran.

> Will not setting exec_start to the clock_task of the destination rq
> during migration be better? This would be the closest we could
> come to estimating the amount of time the task has run on this new
> cpu while deciding task_hot or not no?

Setting it to the exact clock_task of the destination rq would make it
hot on that rq, even though it hasn't yet ran there, so you'd have to do
something like: rq_clock_task(dst_rq) - sysctl_sched_migration_cost.

But seeing as how that is far more work, and all this is heuristics
anyhow and an extra fail term of 1/585 years is far below the current
fail rate, all is well.

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2014-05-16 14:17 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 [this message]
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:sched/core] sched: Fix " tip-bot for Ben Segall
2014-05-22 12:26 ` 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=20140516141745.GU11096@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=bsegall@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=preeti.lkml@gmail.com \
    --cc=preeti@linux.vnet.ibm.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox