From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>,
Peter Zijlstra <peterz@infradead.org>,
Clark Williams <williams@redhat.com>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Tejun Heo <htejun@gmail.com>
Subject: Re: [PATCH v2 3/3][RT] sched: Have migrate_disable ignore bounded threads
Date: Tue, 27 Sep 2011 17:32:25 -0400 [thread overview]
Message-ID: <1317159146.26514.57.camel@gandalf.stny.rr.com> (raw)
In-Reply-To: <20110927124423.567944215@goodmis.org>
On Tue, 2011-09-27 at 08:40 -0400, Steven Rostedt wrote:
> plain text document attachment
> (peterz-migrate-disable-thread-bound.patch)
> From: Peter Zijlstra <a.p.zijlstra@chello.nl>
Thomas,
Hold off on this patch until we get the kworker/u straighten out. I'm
retesting with the following change:
@@ -1383,7 +1384,7 @@ static struct worker *create_worker(struct global_cwq *gcwq, bool bind)
if (bind && !on_unbound_cpu)
kthread_bind(worker->task, gcwq->cpu);
else {
- worker->task->flags |= PF_THREAD_BOUND;
+// worker->task->flags |= PF_THREAD_BOUND;
if (on_unbound_cpu)
worker->flags |= WORKER_UNBOUND;
}
So far, so good.
-- Steve
>
> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
>
> Index: linux-rt.git/kernel/sched.c
> ===================================================================
> --- linux-rt.git.orig/kernel/sched.c
> +++ linux-rt.git/kernel/sched.c
> @@ -4247,7 +4247,7 @@ void migrate_disable(void)
> {
> struct task_struct *p = current;
>
> - if (in_atomic()) {
> + if (in_atomic() || p->flags & PF_THREAD_BOUND) {
> #ifdef CONFIG_SCHED_DEBUG
> p->migrate_disable_atomic++;
> #endif
> @@ -4278,7 +4278,7 @@ void migrate_enable(void)
> unsigned long flags;
> struct rq *rq;
>
> - if (in_atomic()) {
> + if (in_atomic() || p->flags & PF_THREAD_BOUND) {
> #ifdef CONFIG_SCHED_DEBUG
> p->migrate_disable_atomic--;
> #endif
> @@ -4299,26 +4299,21 @@ void migrate_enable(void)
>
> if (unlikely(migrate_disabled_updated(p))) {
> /*
> - * See comment in update_migrate_disable() about locking.
> + * Undo whatever update_migrate_disable() did, also see there
> + * about locking.
> */
> rq = this_rq();
> raw_spin_lock_irqsave(&rq->lock, flags);
> - mask = tsk_cpus_allowed(p);
> +
> /*
> * Clearing migrate_disable causes tsk_cpus_allowed to
> * show the tasks original cpu affinity.
> */
> p->migrate_disable = 0;
> -
> - WARN_ON(!cpumask_test_cpu(smp_processor_id(), mask));
> -
> - if (unlikely(!cpumask_equal(&p->cpus_allowed, mask))) {
> - /* Get the mask now that migration is enabled */
> - mask = tsk_cpus_allowed(p);
> - if (p->sched_class->set_cpus_allowed)
> - p->sched_class->set_cpus_allowed(p, mask);
> - p->rt.nr_cpus_allowed = cpumask_weight(mask);
> - }
> + mask = tsk_cpus_allowed(p);
> + if (p->sched_class->set_cpus_allowed)
> + p->sched_class->set_cpus_allowed(p, mask);
> + p->rt.nr_cpus_allowed = cpumask_weight(mask);
> raw_spin_unlock_irqrestore(&rq->lock, flags);
> } else
> p->migrate_disable = 0;
prev parent reply other threads:[~2011-09-27 21:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-27 12:40 [PATCH v2 0/3][RT] [RT] rt: patches to postpone migrate disable Steven Rostedt
2011-09-27 12:40 ` [PATCH v2 1/3][RT] sched: Postpone actual migration disalbe to schedule Steven Rostedt
2011-09-27 12:40 ` [PATCH v2 2/3][RT] sched: Do not compare cpu masks in scheduler Steven Rostedt
2011-09-27 12:40 ` [PATCH v2 3/3][RT] sched: Have migrate_disable ignore bounded threads Steven Rostedt
2011-09-27 21:32 ` Steven Rostedt [this message]
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=1317159146.26514.57.camel@gandalf.stny.rr.com \
--to=rostedt@goodmis.org \
--cc=a.p.zijlstra@chello.nl \
--cc=htejun@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=williams@redhat.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
all inboxes | Powered by JetHome®