Re: statfs() / statvfs() syscall ballsup...

From: Andrew Morton
Date: Fri Oct 10 2003 - 21:56:00 EST


Trond Myklebust <trond.myklebust@xxxxxxxxxx> wrote:
>
> It does nothing for the case Joel mentioned where 2 different nodes
> are writing to the same device, and you need to force a read in order
> to resynchronize the page cache.
> Apart from O_DIRECT, we have nothing in the kernel as it stands that
> will allow userland to deal with this case.

Applications may use fadvise(POSIX_FADV_DONTNEED) to invalidate sections of
a file's pagecache.

It is not designed to be 100% reliable though: mmapped pages will be
retained, and dirty pages are skipped.

For the dirty pages it might be useful to add a new mode to fadvise which
syncs a section of a file's pages; -mm has the necessary infrastructure for
that.

POSIX does not define the fadvise() semantics very clearly, so it is largely
up to us to decide what makes sense. There are a number of things which we
can do quite easily in there - it's mainly a matter of working out exactly
what we want to do.

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