public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Chanho Min <chanho0207@gmail.com>,
	linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
	chanho.min@lge.com
Subject: Re: [PATCH] sched_rt: the task in irq context can be migrated during context switching
Date: Thu, 05 Jan 2012 22:45:04 +0100	[thread overview]
Message-ID: <1325799904.3508.12.camel@twins> (raw)
In-Reply-To: <1325787342.12696.59.camel@gandalf.stny.rr.com>

On Thu, 2012-01-05 at 13:15 -0500, Steven Rostedt wrote:
> On Thu, 2012-01-05 at 18:55 +0100, Peter Zijlstra wrote:
> 
> > So the problem is quite real, as already said we don't need to worry
> > about the future, but we might want to fix this in previous kernels.
> > What I'm not entirely sure of is the proposed solution, Steven don't we
> > get in trouble by simply bailing out on the push?
> 
> It shouldn't break anything. We shouldn't be pushing tasks that are
> running on a rq anyway. 

Its not running, but its in the middle of getting scheduled out.

> I don't see any harm here. As this scenario can
> only happen if we get an interrupt after letting go of the rq lock and
> before doing the switch_to(). The schedule_tail() calls
> post_schedule_rt() which does the push again, and will push task A at
> that time.

Right, so the post_schedule() hook will try again.

> That said, I'm not sure this patch is enough. I'm worried about a pull
> happening. As task A is running, we could possible possibly pick it on
> another CPU to do a pull.
> 
> Hmm, looking at the code, the pull already does a task_running() test,
> so I guess we should be fine.

Yeah, I'm not sure all those task_running() things make sense though,
when !->on_rq && ->on_cpu we should busy wait for tasks, not skip them.

Then again, with this WANT_INTERRUPTS_ON_CTXSW the busy wait crap is
tricky. Luckily its going the way of the Dodo very soon.

  reply	other threads:[~2012-01-05 21:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-05 11:00 [PATCH] sched_rt: the task in irq context can be migrated during context switching Chanho Min
2012-01-05 14:25 ` Peter Zijlstra
2012-01-05 17:55 ` Peter Zijlstra
2012-01-05 18:15   ` Steven Rostedt
2012-01-05 21:45     ` Peter Zijlstra [this message]
2012-01-10  8:13       ` Chanho Min
2012-01-10  9:23         ` Peter Zijlstra
2012-01-10  9:42           ` Namhyung Kim
2012-01-28  4:05           ` Chanho Min
2012-01-28 12:06 ` [tip:sched/core] sched/rt: Fix task stack corruption under __ARCH_WANT_INTERRUPTS_ON_CTXSW tip-bot for Chanho Min

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=1325799904.3508.12.camel@twins \
    --to=peterz@infradead.org \
    --cc=chanho.min@lge.com \
    --cc=chanho0207@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.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