public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Jonathan Corbet <corbet@lwn.net>
Cc: linux-kernel@vger.kernel.org, Andi Kleen <andi@firstfloor.org>,
	Oleg Nesterov <oleg@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Al Viro <viro@ZenIV.linux.org.uk>,
	Davide Libenzi <davidel@xmailserver.org>,
	David Miller <davem@davemloft.net>,
	Christoph Hellwig <hch@lst.de>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Matt Mackall <mpm@selenic.com>
Subject: Re: [PATCH 3/4] Move FASYNC bit handling to f_op->fasync()
Date: Sun, 8 Feb 2009 10:05:50 +0100	[thread overview]
Message-ID: <20090208090550.GC18521@lst.de> (raw)
In-Reply-To: <1234037217-16124-4-git-send-email-corbet@lwn.net>

On Sat, Feb 07, 2009 at 01:06:56PM -0700, Jonathan Corbet wrote:
> Removing the BKL from FASYNC handling ran into the challenge of keeping the
> setting of the FASYNC bit in filp->f_flags atomic with regard to calls to
> the underlying fasync() function.  Andi Kleen suggested moving the handling
> of that bit into fasync(); this patch does exactly that.  As a result, we
> have a couple of internal API changes: fasync() must now manage the FASYNC
> bit, and it will be called without the BKL held.
> 
> As it happens, every fasync() implementation in the kernel with one
> exception calls fasync_helper().  So, if we make fasync_helper() set the
> FASYNC bit, we can avoid making any changes to the other fasync()
> functions - as long as those functions, themselves, have proper locking.
> Most fasync() implementations do nothing but call fasync_helper() - which
> has its own lock - so they are easily verified as correct.  The BKL had
> already been pushed down into the rest.
> 
> The networking code has its own version of fasync_helper(), so that code
> has been augmented with explicit FASYNC bit handling.

> +	/* Maintaining the FASYNC bit is our job now */

Not sure this comment is a good idea.  All comments of the style
something has changes and is this now get stale really soon.  If you
want to document that change in more details it should probably go
into Documentation/filesystems/Locking near the fasync part.


But the actual good changes look good, so:


Reviewed-by: Christoph Hellwig <hch@lst.de>


  reply	other threads:[~2009-02-08  9:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-07 20:06 [PATCH/RFC] Fasync BKL removal Jonathan Corbet
2009-02-07 20:06 ` [PATCH 1/4] Rename struct file->f_ep_lock Jonathan Corbet
2009-02-08  8:56   ` Christoph Hellwig
2009-02-08 19:51   ` Davide Libenzi
2009-02-07 20:06 ` [PATCH 2/4] Use f_lock to protect f_flags Jonathan Corbet
2009-02-08  9:02   ` Christoph Hellwig
2009-02-07 20:06 ` [PATCH 3/4] Move FASYNC bit handling to f_op->fasync() Jonathan Corbet
2009-02-08  9:05   ` Christoph Hellwig [this message]
2009-02-10  2:41     ` Jonathan Corbet
2009-02-07 20:06 ` [PATCH 4/4] Rationalize fasync return values Jonathan Corbet
2009-02-07 20:28 ` [PATCH/RFC] Fasync BKL removal Matt Mackall
  -- strict thread matches above, loose matches on Subject: below --
2009-02-02 18:20 [PATCH/RFC] F_SETFL/Fasync BKL removal, now without unsightly global locks Jonathan Corbet
2009-02-02 18:20 ` [PATCH 3/4] Move FASYNC bit handling to f_op->fasync() Jonathan Corbet

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=20090208090550.GC18521@lst.de \
    --to=hch@lst.de \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=andi@firstfloor.org \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=davidel@xmailserver.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpm@selenic.com \
    --cc=oleg@redhat.com \
    --cc=viro@ZenIV.linux.org.uk \
    /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