Re: Q: generic_file_write sets PG_locked???

Linus Torvalds (torvalds@transmeta.com)
22 Apr 1999 23:04:05 GMT


In article <14111.40097.154796.570022@dukat.scot.redhat.com>,
Stephen C. Tweedie <sct@redhat.com> wrote:
>
>Yes and no. PageLocked may just indicate a background writeback in
>progress. That definitely happens in the swap cache right now, but the
>vfs code doesn't use it for the page cache (yet). It will do.

In fact, it already does for NFS, which uses PageLocked for exactly that
reason (to serialize read and write requests to the same page).

> However,
>if a given filesystem provides its own write-page strategy functions
>which have their own locking semantics, there's no real reason to
>prevent it from doing so as long as the page mapping functions continue
>to block on a non-uptodate page.

For "valid to read", you only check Uptodate. For any actual IO
(whether it's because you're going to actually _do_ the read or set up
some write), PageLocked should be used to synchronize. NFS already does
this, and generic_file_read() already understands about it.

Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/