[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090203161931.4054a25e@bike.lwn.net>
Date: Tue, 3 Feb 2009 16:19:31 -0700
From: Jonathan Corbet <corbet@....net>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: mpm@...enic.com, dada1@...mosbay.com, linux-kernel@...r.kernel.org,
andi@...stfloor.org, oleg@...hat.com, viro@...IV.linux.org.uk,
davidel@...ilserver.org, davem@...emloft.net, hch@....de,
linux-api@...r.kernel.org, alan@...rguk.ukuu.org.uk
Subject: Re: [PATCH 2/4] Convert epoll to a bitlock
On Tue, 3 Feb 2009 14:53:46 -0800
Andrew Morton <akpm@...ux-foundation.org> wrote:
> Well. We _could_ whack part of this nut with my usual hammer: protect
> f_flags with file->f_dentry->d_inode->i_lock. IIRC there was some
> objection to that - performance?
Andi has objected to the addition of locks, but i_lock is maybe
sufficiently dispersed to pass muster there. I had an instinctive
reaction to using a lock which is three pointers away, but I can get
over that. I'll admit a bit of ignorance, though: if a given struct
file exists, do we know for sure that file->f_dentry->d_inode exists?
> One problem here seems to be that we're trying to change multiple
> things at the same time. We can blame the BKL for that.
>
> Can we break the problem into manageable chunks? Your patchset did
> that, I guess. What were those chunks again? ;)
I'm not really sure how to break it down any further. If we take the
i_lock approach, the chunks would be something like:
1) Use i_lock to protect accesses to f_flags. This would enable some
BKL usage to be removed, but would not fix fasync.
2) Move responsibility for the FASYNC bit into ->fasync(), with
fasync_helper() doing it in almost all situations. The remaining
BKL usage would then go away.
3) The same optional fasync() return values cleanup.
Make sense?
jon
--
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