[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210323135116.GF1719932@casper.infradead.org>
Date: Tue, 23 Mar 2021 13:51:16 +0000
From: Matthew Wilcox <willy@...radead.org>
To: David Howells <dhowells@...hat.com>
Cc: Trond Myklebust <trondmy@...merspace.com>,
Anna Schumaker <anna.schumaker@...app.com>,
Steve French <sfrench@...ba.org>,
Dominique Martinet <asmadeus@...ewreck.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Christoph Hellwig <hch@....de>,
Alexander Viro <viro@...iv.linux.org.uk>, linux-mm@...ck.org,
linux-cachefs@...hat.com, linux-afs@...ts.infradead.org,
linux-nfs@...r.kernel.org, linux-cifs@...r.kernel.org,
ceph-devel@...r.kernel.org, v9fs-developer@...ts.sourceforge.net,
linux-fsdevel@...r.kernel.org, Jeff Layton <jlayton@...hat.com>,
David Wysochanski <dwysocha@...hat.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 02/28] mm: Add an unlock function for
PG_private_2/PG_fscache
On Tue, Mar 23, 2021 at 01:17:20PM +0000, David Howells wrote:
> +++ b/fs/afs/write.c
> @@ -846,7 +846,7 @@ vm_fault_t afs_page_mkwrite(struct vm_fault *vmf)
> */
> #ifdef CONFIG_AFS_FSCACHE
> if (PageFsCache(page) &&
> - wait_on_page_bit_killable(page, PG_fscache) < 0)
> + wait_on_page_fscache_killable(page) < 0)
> return VM_FAULT_RETRY;
> #endif
>
> @@ -861,7 +861,8 @@ vm_fault_t afs_page_mkwrite(struct vm_fault *vmf)
> * details the portion of the page we need to write back and we might
> * need to redirty the page if there's a problem.
> */
> - wait_on_page_writeback(page);
> + if (wait_on_page_writeback_killable(page) < 0)
> + return VM_FAULT_RETRY | VM_FAULT_LOCKED;
You forgot to unlock the page. Also, if you're waiting killably here,
do you need to wait before you get the page lock? Ditto for waiting on
fscache -- do you want to do that before or after you get the page lock?
Also, I never quite understood why you needed to wait for fscache
writes to finish before allowing the page to be dirtied. Is this a
wait_for_stable_page() kind of situation, where the cache might be
calculating a checksum on it? Because as far as I can tell, once the
page is dirty in RAM, the contents of the on-disk cache are irrelevant ...
unless they're part of a RAID 5 checksum kind of situation.
I didn't spot any other problems ...
Powered by blists - more mailing lists