<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hi all,</p>
<p>I am currently trying to work out how Lustre behaves when both
"read_cache" and "writethrough_cache" are disabled. What I
particularly want to know is how does writing to the related proc
files influence the cache policy?</p>
<p>To me (and perf_event reports it too on a 2.7 setup), the code
always gets cache pages (using find_or_create_page() in
"lustre/osd-ldiskfs/osd_io.c") even with both cache parameters set
to 0.<br>
After that, if caching is disabled, a call to
generic_error_remove_page() is issued on the pages that were
allocated. This functions is described in the kernel sources like
this:<br>
</p>
<pre><b><i>/*
* Used to get rid of pages on hardware memory corruption.
*/
int generic_error_remove_page(struct adress_space *mapping, struct page *page)
</i></b></pre>
<p>This does not seem to be the "natural" call to use, but anyway, I
can live with that.<br>
What really bothers me is that the behaviour of Lustre from this
point looks exactly the same as if cache was enabled. I can't find
a single branching point that handles things differently: pages
are kmapped, written to/read from, kunmmaped... I am probably
missing something, but I can't figure out what. Could someone
please point me in the right direction?</p>
<p>The functions I find the most relevant to study are:<br>
<font size="-1">"lustre/ofd/ofd_io.c":</font><br>
ofd_preprw() -> ofd_preprw_read() / ofd_preprw_write()</p>
<p>their counterparts:<br>
<font size="-1">"lustre/ofd/ofd_io.c":</font><br>
ofd_commitrw() -> ofd_commitrw_read() /
ofd_commitrw_write()</p>
<p>the handlers of the proc files
"/proc/fs/lustre/obdfilter/*/{read,writethrough}_cache_enable":<br>
<font size="-1">"lustre/osd-ldiskfs/osd_lproc.c":</font><br>
ldiskfs_osd_cache_seq_write(), ldiskfs_osd_wcache_seq_write()</p>
<p>and the only places that use the variables set by the proc files
(where generic_error_remove_page() is used):<br>
<font size="-1">"lustre/osd-ldiskfs/osd_io.c":</font><br>
osd_read_prep(), osd_write_prep()</p>
<p>(I suspect I am missing something really important about what
generic_error_remove_page() does)</p>
<p><br>
</p>
<p>Regards</p>
<p>Quentin Bouget</p>
</body>
</html>