On Tue, Apr 1, 2014 at 7:17 AM, Музафаров Максим Ринатович <m...@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.
_______________________________________________ Gluster-devel mailing list Gluster-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/gluster-devel