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

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

From: David Howells <dhowells@redhat.com>
Date: 2021-02-09 22:50:37
Also in: ceph-devel, linux-cifs, linux-fsdevel, lkml

Linus Torvalds [off-list ref] wrote:
The PG_fscache bit waiting functions are completely crazy. The comment
about "this will wake up others" is actively wrong,
You mean this?

/**
 * unlock_page_fscache - Unlock a page pinned with PG_fscache
 * @page: The page
 *
 * Unlocks the page and wakes up sleepers in wait_on_page_fscache().  Also
 * wakes those waiting for the lock and writeback bits because the wakeup
 * mechanism is shared.  But that's OK - those sleepers will just go back to
 * sleep.
 */

Actually, you're right.  The wakeup check func is evaluated by the
waker-upper.  I can fix the comment with a patch.
and the waiting function looks insane, because you're mixing the two names
for "fscache" which makes the code look totally incomprehensible. Why would
we wait for PF_fscache, when PG_private_2 was set? Yes, I know why, but the
code looks entirely nonsensical.
IIRC someone insisted that I should make it a generic name and put the
accessor functions in the fscache headers (which means they aren't available
to core code), but I don't remember who (maybe Andrew? it was before mid-2007)
- kind of like PG_checked is an alias for PG_owner_priv_1.

I'd be quite happy to move the accessors for PG_fscache to the
linux/page-flags.h as that would simplify things.

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