All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Yong Zhang <yong.zhang0@gmail.com>
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	Peter Zijlstra <peterz@infradead.org>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-rt-users <linux-rt-users@vger.kernel.org>,
	Ingo Molnar <mingo@elte.hu>, Carsten Emde <ce@ceag.ch>,
	Clark Williams <williams@redhat.com>,
	Kumar Gala <galak@gate.crashing.org>,
	Ralf Baechle <ralf@linux-mips.org>, rostedt <rostedt@goodmis.org>,
	Nicholas Mc Guire <der.herr@hofr.at>
Subject: Re: On migrate_disable() and latencies
Date: Thu, 28 Jul 2011 09:01:23 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LFD.2.02.1107280855220.2660@ionos> (raw)
In-Reply-To: <20110728055043.GA570@windriver.com>

On Thu, 28 Jul 2011, Yong Zhang wrote:

> On Wed, Jul 27, 2011 at 11:30:08AM -0700, Paul E. McKenney wrote:
> > o	Tasks awakening outside of migrate-disable regions will pick
> > 	the CPU running the lowest-priority task, whether or not this
> > 	task is in migrate-disable state.  (At least I don't see
> > 	anything in 3.0-rt3 that looks like a scheduling decision
> > 	based on ->migrate_disable, perhaps due to blindness.)
> 
> I'm also confused here, seems we just disable migration for RT task.
> migrate_disable()
> {
> 	...
> 		if (p->sched_class->set_cpus_allowed)
> 			p->sched_class->set_cpus_allowed(p, mask);
> 		p->rt.nr_cpus_allowed =	cpumask_weight(mask);
> 	...
> }
> 
> Shouldn't we also forbid migration on !RT task?

We do. Just RT is the only sched class which has a set_cpus_allowed()
callback implemented and want's an update to its rt.nr_cpus_allowed
field.

       if (!p->migrate_disable) {
                if (p->sched_class && p->sched_class->set_cpus_allowed)
                        p->sched_class->set_cpus_allowed(p, new_mask);
                p->rt.nr_cpus_allowed = cpumask_weight(new_mask);
        }

The general part is here:

       cpumask_copy(&p->cpus_allowed, new_mask);

And tsk_cpus_allowed() does:
{
        if (p->migrate_disable)
                return cpumask_of(task_cpu(p));

        return &p->cpus_allowed;
}

which is the relevant information to keep any task independent of it's
sched class pinned.

Thanks,

	tglx

  reply	other threads:[~2011-07-28  7:01 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-22 10:19 On migrate_disable() and latencies Peter Zijlstra
2011-07-22 10:49 ` Peter Zijlstra
2011-07-22 14:57   ` Peter Zijlstra
2011-07-22 17:45 ` Nicholas Mc Guire
2011-07-25  8:21   ` Peter Zijlstra
2011-07-23  0:39 ` Paul E. McKenney
2011-07-25  8:30   ` Peter Zijlstra
2011-07-25 21:17     ` Paul E. McKenney
2011-07-27 11:13       ` Peter Zijlstra
2011-07-27 18:30         ` Paul E. McKenney
2011-07-28  5:50           ` Yong Zhang
2011-07-28  7:01             ` Thomas Gleixner [this message]
2011-07-28  7:10               ` Yong Zhang
2011-07-28  7:54           ` Nicholas Mc Guire
2011-07-28 12:05             ` Paul E. McKenney

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=alpine.LFD.2.02.1107280855220.2660@ionos \
    --to=tglx@linutronix.de \
    --cc=ce@ceag.ch \
    --cc=der.herr@hofr.at \
    --cc=galak@gate.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=ralf@linux-mips.org \
    --cc=rostedt@goodmis.org \
    --cc=williams@redhat.com \
    --cc=yong.zhang0@gmail.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 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.