[Gluster-users] Questions about gluster/fuse, page cache, and coherence

Patrick J. LoPresti lopresti at gmail.com
Mon Aug 15 20:53:50 UTC 2011


(FUSE developers:  Although my questions are specifically about
Gluster, I suspect most of the answers have more to do with FUSE, so I
figure this is on-topic for your list.  If I figured wrong, I
apologize.)

I have done quite a bit of searching looking for answers to these
questions, and I just cannot find them...

I think I understand how the Linux page cache works for an ordinary
local (non-FUSE) partition.  Specifically:

1) When my application calls read(), it reads from the page cache.  If
the page(s) are not resident, the kernel puts my application to sleep
and gets busy reading them from disk.

2) When my application calls write(), it writes to the page cache.
The kernel will -- eventually, when it feels like it -- flush those
dirty pages to disk.

3) When my application calls mmap(), page cache pages are mapped into
my process's address space, allowing me to create a dirty page or read
a page by accessing memory.

4) When the kernel reads a page, it might decide to read some other
pages, depending on the underlying block device's read-ahead
parameters.  I can control these via "blockdev".  On the write side, I
can exercise some control with various VM parameters (dirty_ratio
etc).  I can also use calls like fsync() and posix_fadvise() to exert
some control over page cache management at the application level.


My question is pretty simple.  If you had to re-write the above four
points for a Gluster file system, what would they look like?  If it
matters, I am specifically interested in Gluster 3.2.2 on Suse Linux
Enterprise Server 11 SP1 (Linux 2.6.32.43 + whatever Suse does to
their kernels).

Does Gluster use the page cache on read()?  On write()?  If so, how
does it ensure coherency between clients?  If not, how does mmap()
work (or does it not work)?

What read-ahead will the kernel use?  Does posix_fadvise(...,
POSIX_FADV_WILLNEED) have any effect on a Gluster file system?

I find it hard to imagine that I am the only person with questions
like these...  Did I miss a FAQ list somewhere?

Thanks.

 - Pat



More information about the Gluster-users mailing list