[Gluster-devel] IO-Cache or Glupy
Jeff Darcy
jdarcy at redhat.com
Tue Apr 1 14:21:08 UTC 2014
On Tue, Apr 1, 2014 at 7:17 AM, Музафаров Максим
Ринатович <mmr at skbkontur.ru> wrote:
> Where I can find some documentation about io-cache translator?
> I want to test some more caching algorithms instead of LRU, but
> missed in structures of io-cache. Is it true, that I just need to
> change page->page_lru structure or any other?
Unfortunately, there's no documentation for how this (or almost any
other) translator works internally. I have a project to write a "book"
covering that kind of material, but I haven't gotten further than a
table of contents due to other commitments.
It's not clear that you need to change the data structures so much as a
few key functions. The LRU strategy is effectively defined by
__ioc_page_get (additions) and __ioc_inode_prune (evictions) so you'll
probably want to take a good look at the call trees for both of those.
In particular, make sure you understand some of the synchronization
concerns. There are a lot of edge cases when faults, cached reads,
writes, truncates, etc. overlap.
> Another time, I can write my own cache translator, using glupy, but I
> don’t know, how can I get data from file? Is it “xdata”
> variable or something else?
I'm not sure how xdata would help, and in any case it's not fully
handled by glupy yet. Most of the information you need is in the
arguments for readv, writev, and (f)truncate, so look at the
default_xxx definitions for those.
More information about the Gluster-devel
mailing list