public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Michal Hocko <mhocko@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Ingo Molnar <mingo@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Thomas Gleixner <tglx@linutronix.de>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [GIT PULL] killable rwsems for v4.7
Date: Tue, 17 May 2016 19:05:52 +0100	[thread overview]
Message-ID: <20160517180551.GH14480@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20160517070837.GB14453@dhcp22.suse.cz>

On Tue, May 17, 2016 at 09:08:38AM +0200, Michal Hocko wrote:
> On Mon 16-05-16 13:32:28, Linus Torvalds wrote:
> > On Mon, May 16, 2016 at 7:55 AM, Ingo Molnar <mingo@kernel.org> wrote:
> > >
> > > This tree, by Michal Hocko, implements down_write_killable(). The main usecase
> > > will be to update mm_sem usage sites to use this new API,
> > 
> > Hmm. Is somebody (Michal?) looking at down_read_killable() too?
> 
> I wasn't because I didn't need it for my oom_reaper use case.
> 
> > The VFS layer will want it with the pending parallel lookup code - the
> > inode semaphore is being converted to a rwsem, and there's a couple of
> > "killable" users.. The first step actually just wants to the exclusive
> > case (ie the write case that this adds), but I think the readdir code
> > could really use a reading version too..
> 
> This is more a question for Al but I do not think adding killable read
> lock is a big deal. I can certainly help with it.

I'm not sure - killable write is needed in a bunch of places there (and the
only reason it's not used in #work.lookups is to avoid even more merge
headache; as soon as both are merged, I'll post a trivial followup switching
half a dozen places to it), killable read...  Do we really need it?
The only plausible user right now (->i_rwsem one, that is) is parallel readdir.
And I'm not convinced that we need to make that one killable.  We can
(down_read_killable seems to be easy to put together), but is it worth
using it in that usecase?

IIRC, the original motivation had been "what if anything gets stuck on NFS
server and we are left with unkillable processes on client sitting there in
attempts to lock the directory".  Seeing that lookups would be just as prone
to getting stuck (and had been all along)...  It doesn't look like there
could be a deadlock scenario avoided by having that down_read (or mutex_lock)
killable.  I can't find the original thread, unfortunately; does anyone
remember the details?

  reply	other threads:[~2016-05-17 18:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-16 14:55 [GIT PULL] killable rwsems for v4.7 Ingo Molnar
2016-05-16 20:32 ` Linus Torvalds
2016-05-17  7:08   ` Michal Hocko
2016-05-17 18:05     ` Al Viro [this message]
2016-05-17 18:31       ` Linus Torvalds
2016-05-17 11:02   ` 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=20160517180551.GH14480@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhocko@kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /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