Thread (19 messages) 19 messages, 5 authors, 2021-02-15

Re: [GIT PULL] fscache: I/O API modernisation and netfs helper library

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2021-02-09 22:50:58
Also in: ceph-devel, linux-fsdevel, linux-nfs, lkml

On Tue, Feb 9, 2021 at 12:21 PM Matthew Wilcox [off-list ref] wrote:
Yeah, I have trouble with the private2 vs fscache bit too.  I've been
trying to persuade David that he doesn't actually need an fscache
bit at all; he can just increment the page's refcount to prevent it
from being freed while he writes data to the cache.
Does the code not hold a refcount already?

Honestly, the fact that writeback doesn't take a refcount, and then
has magic "if writeback is set, don't free" code in other parts of the
VM layer has been a problem already, when the wakeup ended up
"leaking" from a previous page to a new allocation.

I very much hope the fscache bit does not make similar mistakes,
because the rest of the VM will _not_ have special "if fscache is set,
then we won't do X" the way we do for writeback.

So I think the fscache code needs to hold a refcount regardless, and
that the fscache bit is set the page has to have a reference.

So what are the current lifetime rules for the fscache bit?

             Linus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help