From: Peter Zijlstra <peterz@infradead.org>
To: Olav Haugan <ohaugan@codeaurora.org>
Cc: mingo@redhat.com, linux-kernel@vger.kernel.org,
linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH] sched: Update task->on_rq when tasks are moving between runqueues
Date: Thu, 29 Oct 2015 02:58:52 +0100 [thread overview]
Message-ID: <20151029015852.GF11242@worktop.amr.corp.intel.com> (raw)
In-Reply-To: <20151029005710.GA11285@codeaurora.org>
On Wed, Oct 28, 2015 at 05:57:10PM -0700, Olav Haugan wrote:
> On 15-10-25 11:09:24, Peter Zijlstra wrote:
> > On Sat, Oct 24, 2015 at 11:01:02AM -0700, Olav Haugan wrote:
> > > Task->on_rq has three states:
> > > 0 - Task is not on runqueue (rq)
> > > 1 (TASK_ON_RQ_QUEUED) - Task is on rq
> > > 2 (TASK_ON_RQ_MIGRATING) - Task is on rq but in the process of being
> > > migrated to another rq
> > >
> > > When a task is moving between rqs task->on_rq state should be
> > > TASK_ON_RQ_MIGRATING
> >
> > Only when not holding both rq locks..
>
> IMHO I think we should keep the state of p->on_rq updated with the correct state
> all the time unless I am incorrect in what p->on_rq represent. The task
> is moving between rq's and is on the rq so the state should be
> TASK_ON_RQ_MIGRATING right? I do realize that the code is currently not
> broken. However, in the future someone might come along and change
> set_task_cpu() and the code change might rely on an accurate p->on_rq value. It
> would be good design to keep this value correct.
At the same time; we should also provide lean and fast code. Is it
better to add assertions about required state than to add superfluous
code for just in case scenarios.
next prev parent reply other threads:[~2015-10-31 18:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-24 18:01 [PATCH] sched: Update task->on_rq when tasks are moving between runqueues Olav Haugan
2015-10-25 10:09 ` Peter Zijlstra
2015-10-29 0:57 ` Olav Haugan
2015-10-29 1:58 ` Peter Zijlstra [this message]
2015-11-02 20:40 ` Paul Turner
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=20151029015852.GF11242@worktop.amr.corp.intel.com \
--to=peterz@infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=ohaugan@codeaurora.org \
/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