linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Clark Williams <williams@redhat.com>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-rt-users <linux-rt-users@vger.kernel.org>,
	Mike Galbraith <umgwanakikbuti@gmail.com>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	Paul Gortmaker <paul.gortmaker@windriver.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@kernel.org>
Subject: Re: [RFC PATCH RT] rwsem: The return of multi-reader PI rwsems
Date: Thu, 10 Apr 2014 11:38:40 -0400	[thread overview]
Message-ID: <20140410113840.6ad8abfe@gandalf.local.home> (raw)
In-Reply-To: <5346B2C8.6000207@linutronix.de>

On Thu, 10 Apr 2014 17:03:36 +0200
Sebastian Andrzej Siewior <bigeasy@linutronix.de> wrote:

> On 04/10/2014 04:44 PM, Clark Williams wrote:
> > The means of each group of five test runs are:
> > 
> > vanilla.log:  1210117 rt.log:  17210953 (14.2 x slower than
> > vanilla) rt-fixes.log:  10062027 (8.3 x slower than vanilla) 
> > rt-multi.log:  3179582  (2.x x slower than vanilla)
> > 
> > 
> > As expected, vanilla kicked RT's butt when hammering on the 
> > mmap_sem. But somewhat unexpectedly, your fixups helped quite a
> > bit and the multi+fixups got RT back into being almost
> > respectable.
> > 
> > Obviously these are just preliminary results on one piece of h/w
> > but it looks promising.
> 
> Is it easy to look at the latency when you have multiple readers and
> and a high prio writer which has to boost all those readers away
> instead just one?
> Or is this something that should not happen for a high prio RT task
> because it has all memory already allocated?

Note, the patch includes a /proc/sys/kernel/rwsem_reader_limit that is
default value set at possible_cpus. The user can change it to any
number. A number of zero means unlimited, and a number of 1 makes it
work like it did without the patch.

This means that a writer will only have to wait for rwsem_reader_limit
readers, which may give a longer latency, but it is still bounded. Also
note that the rwsem is not fair respect to first come first served, but
priority driven. Same priority tasks may be first in first out, but if
there's a writer waiting and a higher priority reader comes along, it
can still get the lock, making the writer wait longer. But as the
reader is higher priority than the writer, that is expected. The same
priority reader will block if there's a writer waiting.

Clark, it would be interesting if you run the test again with my
patches but set rwsem_reader_limit to 1, and see what the impact of
that is.

-- Steve

  parent reply	other threads:[~2014-04-10 15:38 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-09 19:19 [RFC PATCH RT] rwsem: The return of multi-reader PI rwsems Steven Rostedt
2014-04-10 14:18 ` Mike Galbraith
2014-04-10 14:28   ` Mike Galbraith
2014-04-10 14:32     ` Steven Rostedt
2014-04-11  2:50     ` Mike Galbraith
2014-04-11  3:25       ` Steven Rostedt
2014-04-11  3:52         ` Mike Galbraith
2014-04-11  4:25           ` Mike Galbraith
2014-04-10 14:44 ` Clark Williams
2014-04-10 15:01   ` Steven Rostedt
2014-04-10 15:03   ` Sebastian Andrzej Siewior
2014-04-10 15:36     ` Peter Zijlstra
2014-04-10 19:17       ` Steven Rostedt
2014-04-10 20:48         ` Peter Zijlstra
2014-04-10 21:30         ` Paul E. McKenney
2014-04-10 22:02           ` Steven Rostedt
2014-04-10 15:38     ` Steven Rostedt [this message]
2014-04-11 21:39   ` Daniel Bristot de Oliveira
2014-04-10 17:42 ` [RFC PATCH RT V2] " Steven Rostedt
2014-04-11  2:35   ` [RFC PATCH RT V3] " Steven Rostedt
2014-04-11 12:47     ` Carsten Emde
2014-04-11 13:25       ` Steven Rostedt
2014-04-17 23:26         ` [RFC PATCH RT V4] " Steven Rostedt
2014-04-18  8:19           ` Ingo Molnar
2014-04-24 17:52             ` Steven Rostedt
2014-04-14  9:55 ` [RFC PATCH RT] " Ingo Molnar
2014-04-14 13:34   ` Steven Rostedt
2014-04-14 14:08     ` Peter Zijlstra

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=20140410113840.6ad8abfe@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=bigeasy@linutronix.de \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=paul.gortmaker@windriver.com \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.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;
as well as URLs for NNTP newsgroup(s).