public inbox for linux-rt-users@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	"Ingo Molnar" <mingo@kernel.org>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Clark Williams" <williams@redhat.com>,
	linux-rt-users <linux-rt-users@vger.kernel.org>,
	"Mike Galbraith" <umgwanakikbuti@gmail.com>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	"Jörn Engel" <joern@purestorage.com>
Subject: Re: [RFC][PATCH v4] sched/rt: Use IPI to trigger RT task push migration instead of pulling
Date: Fri, 27 Feb 2015 10:08:30 +0100	[thread overview]
Message-ID: <20150227090830.GF21418@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <20150226112635.69b5870f@gandalf.local.home>

On Thu, Feb 26, 2015 at 11:26:35AM -0500, Steven Rostedt wrote:
> Index: linux-rt.git/kernel/sched/rt.c
> ===================================================================
> --- linux-rt.git.orig/kernel/sched/rt.c	2015-02-26 10:55:26.107945935 -0500
> +++ linux-rt.git/kernel/sched/rt.c	2015-02-26 10:55:38.277777892 -0500

> +/* Called from hardirq context */
> +static void try_to_push_tasks(void *arg)
> +{
> +	struct rt_rq *rt_rq = arg;
> +	struct rq *rq, *src_rq;
> +	int this_cpu;
> +	int cpu;
> +
> +	this_cpu = rt_rq->push_cpu;
> +
> +	/* Paranoid check */
> +	BUG_ON(this_cpu != smp_processor_id());
> +
> +	rq = cpu_rq(this_cpu);
> +	src_rq = rq_of_rt_rq(rt_rq);
> +
> + again:

Superfluous space there!

> +	if (has_pushable_tasks(rq)) {
> +		raw_spin_lock(&rq->lock);
> +		push_rt_task(rq);
> +		raw_spin_unlock(&rq->lock);
> +	}

So push_rt_task() has a return value; should we use it?

That is, currently we iterate the entire rto mask and migrate everything
we come across, is there an argument to be had to only migrate 1 task
and then call it quits?

> Index: linux-rt.git/kernel/sched/sched.h
> ===================================================================
> --- linux-rt.git.orig/kernel/sched/sched.h	2015-02-26 10:55:26.107945935 -0500
> +++ linux-rt.git/kernel/sched/sched.h	2015-02-26 10:55:28.082918664 -0500
> @@ -6,6 +6,7 @@
>  #include <linux/mutex.h>
>  #include <linux/spinlock.h>
>  #include <linux/stop_machine.h>
> +#include <linux/irq_work.h>
>  #include <linux/tick.h>
>  #include <linux/slab.h>
>  
> @@ -435,6 +436,11 @@ struct rt_rq {
>  	unsigned long rt_nr_total;
>  	int overloaded;
>  	struct plist_head pushable_tasks;
> +	struct call_single_data push_csd;

You waaztin' maa spaaz!

> +	int push_flags;
> +	int push_cpu;
> +	struct irq_work push_work;
> +	raw_spinlock_t push_lock;
>  #endif
>  	int rt_queued;
>  

One could make an argument for using a separate per-cpu variable and
cacheline align the thing...

> Index: linux-rt.git/kernel/sched/features.h
> ===================================================================
> --- linux-rt.git.orig/kernel/sched/features.h	2015-02-26 10:55:26.107945935 -0500
> +++ linux-rt.git/kernel/sched/features.h	2015-02-26 10:55:28.083918650 -0500
> @@ -56,6 +56,17 @@ SCHED_FEAT(NONTASK_CAPACITY, true)
>   */
>  SCHED_FEAT(TTWU_QUEUE, true)
>  
> +/*
> + * In order to avoid a thundering herd attack of CPUS that are

I would suggest you remap your caps-lock to some useful key :-)

> + * lowering their priorities at the same time, and there being
> + * a single CPU that has an RT task that can migrate and is waiting
> + * to run, where the other CPUs will try to take that CPUs
> + * rq lock and possibly create a large contention, sending an
> + * IPI to that CPU and let that CPU push the RT task to where
> + * it should go may be a better scenario.
> + */
> +SCHED_FEAT(RT_PUSH_IPI, true)
> +
>  SCHED_FEAT(FORCE_SD_OVERLAP, false)
>  SCHED_FEAT(RT_RUNTIME_SHARE, true)
>  SCHED_FEAT(LB_MIN, false)

  reply	other threads:[~2015-02-27  9:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-26 16:26 [RFC][PATCH v4] sched/rt: Use IPI to trigger RT task push migration instead of pulling Steven Rostedt
2015-02-27  9:08 ` Peter Zijlstra [this message]
2015-02-27 14:29   ` Steven Rostedt

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=20150227090830.GF21418@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=joern@purestorage.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=umgwanakikbuti@gmail.com \
    --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