[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210406122148.GC19407@quack2.suse.cz>
Date: Tue, 6 Apr 2021 14:21:48 +0200
From: Jan Kara <jack@...e.cz>
To: Kent Overstreet <kent.overstreet@...il.com>
Cc: Christoph Hellwig <hch@...radead.org>, Jan Kara <jack@...e.cz>,
linux-fsdevel@...r.kernel.org,
Matthew Wilcox <willy@...radead.org>,
linux-ext4@...r.kernel.org
Subject: Re: [PATCH 2/3] mm: Provide address_space operation for filling
pages for read
On Fri 02-04-21 17:17:10, Kent Overstreet wrote:
> On Wed, Jan 20, 2021 at 04:20:01PM +0000, Christoph Hellwig wrote:
> > On Wed, Jan 20, 2021 at 05:06:10PM +0100, Jan Kara wrote:
> > > Provide an address_space operation for filling pages needed for read
> > > into page cache. Filesystems can use this operation to seriealize
> > > page cache filling with e.g. hole punching properly.
> >
> > Besides the impending rewrite of the area - having another indirection
> > here is just horrible for performance. If we want locking in this area
> > it should be in core code and common for multiple file systems.
>
> Agreed.
Please see v2 [1] where the indirection is avoided.
> But, instead of using a rwsemaphore, why not just make it a lock with two shared
> states that are exclusive with each other? One state for things that add pages
> to the page cache, the other state for things that want to prevent that. That
> way, DIO can use it too...
Well, the filesystems I convert use rwsem currently so for the conversion,
keeping rwsem is the simplest. If we then decide for a more fancy locking
primitive (and I agree what you describe should be possible), then we can
do that but IMO that's the next step (because it requires auditing every
filesystem that the new primitive is indeed safe for them).
Honza
[1] https://lore.kernel.org/linux-fsdevel/20210212160108.GW19070@quack2.suse.cz/
--
Jan Kara <jack@...e.com>
SUSE Labs, CR
Powered by blists - more mailing lists