public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: linux-kernel@vger.kernel.org, mingo@kernel.org,
	jiangshanlai@gmail.com, dipankar@in.ibm.com,
	akpm@linux-foundation.org, mathieu.desnoyers@efficios.com,
	josh@joshtriplett.org, tglx@linutronix.de, rostedt@goodmis.org,
	dhowells@redhat.com, edumazet@google.com, dvhart@linux.intel.com,
	fweisbec@gmail.com, oleg@redhat.com, bobby.prani@gmail.com
Subject: Re: [PATCH tip/core/rcu 03/13] rcu: Stop treating in-kernel CPU-bound workloads as errors
Date: Thu, 25 Feb 2016 09:20:19 -0800	[thread overview]
Message-ID: <20160225172019.GR3522@linux.vnet.ibm.com> (raw)
In-Reply-To: <20160225094317.GN6356@twins.programming.kicks-ass.net>

On Thu, Feb 25, 2016 at 10:43:17AM +0100, Peter Zijlstra wrote:
> On Tue, Feb 23, 2016 at 09:12:40PM -0800, Paul E. McKenney wrote:
> > Commit 4a81e8328d379 ("Reduce overhead of cond_resched() checks for RCU")
> > handles the error case where a nohz_full loops indefinitely in the kernel
> > with the scheduling-clock interrupt disabled.  However, this handling
> > includes IPIing the CPU running the offending loop, which is not what
> > we want for real-time workloads.  And there are starting to be real-time
> > CPU-bound in-kernel workloads, and these must be handled without IPIing
> > the CPU, at least not in the common case.  Therefore, this situation can
> > no longer be dismissed as an error case.
> 
> Do explain. Doing "for (;;) ;" in a kernel RT thread is just as bad for
> general system health as is doing the same in userspace.

The use case is instead something like this:

	for (;;) {
		do_something();
		cond_resched_rcu_qs();
	}

If you instead do something like this:

	for (;;)
		do_something();

where do_something() doesn't invoke cond_resched_rcu_qs() often enough,
then your kernel is broken and the warrantee says that you get to keep
the pieces.

> Also, who runs his RT workload in-kernel ?

That would be me, actually.

I use something very much like this in rcutorture and in rcuperf (the
latter currently exists only in -rcu, although 0day has been helpfully
finding various problems with it).  In rcutorture, the problem never
arises given default kernel-boot-parameter settings.  However, you
could easily set various timing parameters to exceed the RCU CPU stall
warning timeout.

In rcuperf, this sort of thing happens by default under heavy load.

So why bother if the use case is this obscure?

Because I have been getting beaten up repeatedly over the past few years
about RCU sending IPIs, so I figured that this time I should at least
-try- to get ahead of the game!  ;-)

							Thanx, Paul

  reply	other threads:[~2016-02-25 17:20 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-24  5:12 [PATCH tip/core/rcu 0/13] Miscellaneous fixes for 4.6 Paul E. McKenney
2016-02-24  5:12 ` [PATCH tip/core/rcu 01/13] rcu: Assign false instead of 0 for ->core_needs_qs Paul E. McKenney
2016-02-24  5:12 ` [PATCH tip/core/rcu 02/13] rcu: Update rcu_report_qs_rsp() comment Paul E. McKenney
2016-02-24  5:12 ` [PATCH tip/core/rcu 03/13] rcu: Stop treating in-kernel CPU-bound workloads as errors Paul E. McKenney
2016-02-25  9:43   ` Peter Zijlstra
2016-02-25 17:20     ` Paul E. McKenney [this message]
2016-02-24  5:12 ` [PATCH tip/core/rcu 04/13] rcu: Set rdp->gpwrap when CPU is idle Paul E. McKenney
2016-02-24  5:12 ` [PATCH tip/core/rcu 05/13] rcutorture: Correct no-expedite console messages Paul E. McKenney
2016-02-24  5:12 ` [PATCH tip/core/rcu 06/13] rcu: Remove useless rcu_data_p when !PREEMPT_RCU Paul E. McKenney
2016-02-24  5:12 ` [PATCH tip/core/rcu 07/13] sparse: Add __private to privatize members of structs Paul E. McKenney
2016-02-24  5:12 ` [PATCH tip/core/rcu 08/13] RCU: Privatize rcu_node::lock Paul E. McKenney
2016-02-24  5:12 ` [PATCH tip/core/rcu 09/13] irq: Privatize irq_common_data::state_use_accessors Paul E. McKenney
2016-02-24  5:12 ` [PATCH tip/core/rcu 10/13] rcu: Make rcu/tiny_plugin.h explicitly non-modular Paul E. McKenney
2016-02-24  5:12 ` [PATCH tip/core/rcu 11/13] rcu: Document unique-name limitation for DEFINE_STATIC_SRCU() Paul E. McKenney
2016-02-24  5:12 ` [PATCH tip/core/rcu 12/13] rcu: Catch up rcu_report_qs_rdp() comment with reality Paul E. McKenney
2016-02-24  5:12 ` [PATCH tip/core/rcu 13/13] rcu: Remove rcu_user_hooks_switch 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=20160225172019.GR3522@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=bobby.prani@gmail.com \
    --cc=dhowells@redhat.com \
    --cc=dipankar@in.ibm.com \
    --cc=dvhart@linux.intel.com \
    --cc=edumazet@google.com \
    --cc=fweisbec@gmail.com \
    --cc=jiangshanlai@gmail.com \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mingo@kernel.org \
    --cc=oleg@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    /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