[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090208090550.GC18521@lst.de>
Date: Sun, 8 Feb 2009 10:05:50 +0100
From: Christoph Hellwig <hch@....de>
To: Jonathan Corbet <corbet@....net>
Cc: linux-kernel@...r.kernel.org, Andi Kleen <andi@...stfloor.org>,
Oleg Nesterov <oleg@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Al Viro <viro@...IV.linux.org.uk>,
Davide Libenzi <davidel@...ilserver.org>,
David Miller <davem@...emloft.net>,
Christoph Hellwig <hch@....de>,
Alan Cox <alan@...rguk.ukuu.org.uk>,
Matt Mackall <mpm@...enic.com>
Subject: Re: [PATCH 3/4] Move FASYNC bit handling to f_op->fasync()
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@....de>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists