From: Peter Zijlstra <peterz@infradead.org>
To: paulmck@linux.vnet.ibm.com
Cc: Steven Rostedt <rostedt@goodmis.org>,
LKML <linux-kernel@vger.kernel.org>,
RT <linux-rt-users@vger.kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Clark Williams <williams@redhat.com>
Subject: Re: [RFC][PATCH RT] rwsem_rt: Another (more sane) approach to mulit reader rt locks
Date: Thu, 17 May 2012 22:20:40 +0200 [thread overview]
Message-ID: <1337286040.4281.85.camel@twins> (raw)
In-Reply-To: <20120517200838.GL2567@linux.vnet.ibm.com>
On Thu, 2012-05-17 at 13:08 -0700, Paul E. McKenney wrote:
> I don't claim to understand all of the code, but I am also unafraid to
> ask stupid questions. ;-)
>
> So, is it possible to do something like the following?
>
> 1. Schedule a workqueue from an RCU callback, and to have that
> workqueue do the fput.
Possible yes, but also undesirable, fput() can do a lot of work. Viro
very much didn't want this.
> 2. Make things like unmount() do rcu_barrier() followed by
> flush_workqueue(), or probably multiple flush_workqueue()s.
For unmount() we could get away with this, unmount() isn't usually
(ever?) a critical path. However, as noted by viro the fput() which is
still required can itself cause a tremendous amount of work, even if
only synced against an unmount, having this work done from an async
context isn't desired.
> 3. If someone concurrently does munmap() and a write to the
> to-be-unmapped region, then the write can legally happen.
Not entirely different from the current situation -- the timing changes
between the RCU and current implementation, but imagine the write
happens while the unmap() is in progress but hasn't quite reached the
range we write to.
Anyway, this is all firmly in 'undefined' territory so anybody breaking
from this change deserves all the pain (and probably more) they get.
As already stated, any fault in a region that's being unmapped is the
result of an ill-formed program.
> 4. Acquire mmap_sem in the fault path, but only if the fault
> requires blocking, and recheck the situation under
> mmap_sem -- the hope being to prevent long-lived page
> faults from messing things up.
Not relevant, a fault might not need to block but could still extend the
refcount lifetime of the file object beyond unmap and thus bear the
responsibility of the final fput, which we cannot know a-priori.
Its all made much more complex by the fact that we're avoiding taking
the refcount from the speculative fault in order to avoid the 'global'
synchronization on that cacheline -- which is the real problem
really :-)
next prev parent reply other threads:[~2012-05-17 20:20 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-15 14:03 [RFC][PATCH RT] rwsem_rt: Another (more sane) approach to mulit reader rt locks Steven Rostedt
2012-05-15 15:06 ` Peter Zijlstra
2012-05-15 15:42 ` Steven Rostedt
2012-05-15 17:25 ` Steven Rostedt
2012-05-15 17:31 ` Peter Zijlstra
2012-05-15 17:43 ` Steven Rostedt
2012-05-15 16:26 ` Steven Rostedt
2012-05-15 18:00 ` John Kacur
2012-05-15 18:14 ` Steven Rostedt
2012-05-17 15:18 ` Paul E. McKenney
2012-05-17 15:25 ` Paul E. McKenney
2012-05-17 15:32 ` Peter Zijlstra
2012-05-17 15:47 ` Paul E. McKenney
2012-05-17 16:17 ` Peter Zijlstra
2012-05-17 20:08 ` Paul E. McKenney
2012-05-17 20:20 ` Peter Zijlstra [this message]
2012-05-22 15:26 ` Thomas Gleixner
2012-05-22 15:50 ` Steven Rostedt
2012-05-22 16:40 ` Thomas Gleixner
2012-05-22 16:52 ` Steven Rostedt
2012-05-22 17:07 ` Thomas Gleixner
2012-05-22 17:50 ` 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=1337286040.4281.85.camel@twins \
--to=peterz@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-users@vger.kernel.org \
--cc=paulmck@linux.vnet.ibm.com \
--cc=rostedt@goodmis.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;
as well as URLs for NNTP newsgroup(s).