linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: David Rientjes <rientjes@google.com>
Cc: Ian Kent <raven@themaw.net>,
	autofs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Matthew Wilcox <mawilcox@microsoft.com>
Subject: Re: [PATCH] autofs4: Use wait_event_killable
Date: Mon, 19 Mar 2018 12:30:31 -0700	[thread overview]
Message-ID: <20180319193031.GC6739@bombadil.infradead.org> (raw)
In-Reply-To: <alpine.DEB.2.20.1803191218210.114201@chino.kir.corp.google.com>

On Mon, Mar 19, 2018 at 12:25:58PM -0700, David Rientjes wrote:
> On Mon, 19 Mar 2018, Matthew Wilcox wrote:
> >  	 * wq->name.name is NULL iff the lock is already released
> >  	 * or the mount has been made catatonic.
> >  	 */
> > -	if (wq->name.name) {
> > -		/* Block all but "shutdown" signals while waiting */
> > -		unsigned long shutdown_sigs_mask;
> > -		unsigned long irqflags;
> > -		sigset_t oldset;
> > -
[...]
> > -
> > -		wait_event_interruptible(wq->queue, wq->name.name == NULL);
[...]
> > -	} else {
> > -		pr_debug("skipped sleeping\n");
> > -	}
> > -
> > +	wait_event_killable(wq->queue, wq->name.name == NULL);
>
> I understand converting the wait_event_interruptible() to 
> wait_event_killable(), but why was the above wait_event_interruptible() 
> only called when wq->name.name != NULL?  

My guess is that it was to avoid the overhead of diddling the signal set
when wq->name.name was already NULL.  I don't really kow though, it
predates git history and I'm too lazy to go and poke through the historical
repos to see if that reason was captured by BitKeeper.

> wait_event_{killable,interruptible}() will return without sleeping when 
> wq->name.name == NULL, so I suppose it has something to do with the 
> comment above it.

  reply	other threads:[~2018-03-19 19:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-19 19:16 [PATCH] autofs4: Use wait_event_killable Matthew Wilcox
2018-03-19 19:25 ` David Rientjes
2018-03-19 19:30   ` Matthew Wilcox [this message]
2018-03-20  2:42   ` Ian Kent
2018-03-20  1:58 ` Ian Kent
2018-03-20  3:12   ` Matthew Wilcox

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=20180319193031.GC6739@bombadil.infradead.org \
    --to=willy@infradead.org \
    --cc=autofs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mawilcox@microsoft.com \
    --cc=raven@themaw.net \
    --cc=rientjes@google.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).