<br><font size=2 face="sans-serif">After doing some more digging it looks
as though a bug was reported on this in 2007. &nbsp;</font>
<br>
<br><a href="https://bugzilla.lustre.org/show_bug.cgi?id=12739"><font size=2 face="sans-serif">https://bugzilla.lustre.org/show_bug.cgi?id=12739</font></a>
<br>
<br><font size=2 face="sans-serif">We have loaded the patch for lustre
attached to this bug, however when running the set_param command I am getting
the following error. &nbsp;</font>
<br>
<br><font size=2 face="sans-serif">lctl set_param llite*.*.stat_blksize=4096</font>
<br><font size=2 face="sans-serif">error: set_param: /proc/{fs,sys}/{lnet,lustre}/llite/lustre*/stat_blksize:
No such process</font>
<br>
<br><font size=2 face="sans-serif">Is this patch still valid for 2.6.9-78.0.22.EL_lustre.1.6.7.2smp</font>
<br>
<br><font size=2 face="sans-serif">Thanks again</font>
<br><font size=2 face="sans-serif"><br>
Rocky<br>
</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">From:</font>
<td><font size=1 face="sans-serif">Andreas Dilger &lt;andreas.dilger@oracle.com&gt;</font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">To:</font>
<td><font size=1 face="sans-serif">Ronald K Long &lt;rklong@usgs.gov&gt;</font>
<tr>
<td valign=top><font size=1 color=#5f5f5f face="sans-serif">Cc:</font>
<td><font size=1 face="sans-serif">&quot;Brian J. Murrell&quot; &lt;Brian.Murrell@Sun.COM&gt;,
lustre-discuss@lists.lustre.org, lustre-discuss-bounces@lists.lustre.org</font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">Date:</font>
<td><font size=1 face="sans-serif">04/14/2010 02:13 PM</font>
<tr valign=top>
<td><font size=1 color=#5f5f5f face="sans-serif">Subject:</font>
<td><font size=1 face="sans-serif">Re: [Lustre-discuss] fseeks on lustre</font></table>
<br>
<hr noshade>
<br>
<br>
<br><tt><font size=2>On 2010-04-14, at 11:08, Ronald K Long wrote:<br>
&gt; We've narrowed down the problem quite a bit.<br>
&gt;<br>
&gt; The problematic code snippet is not actually doing any reads or &nbsp;<br>
&gt; writes;<br>
&gt; it's just doing a massive number of fseek() operations within a couple<br>
&gt; of nested loops. &nbsp;(Note: The production code is doing some I/O,
but &nbsp;<br>
&gt; this<br>
&gt; snippet was narrowed down to the bare minimum example that exhibited
&nbsp;<br>
&gt; the<br>
&gt; problem, which was how we discovered that fseek was the culprit.)<br>
&gt;<br>
&gt; The issue appears to be the behavior of the glibc implementation of<br>
&gt; fseek(). &nbsp;Apparently, a call to fseek() on a buffered file stream
&nbsp;<br>
&gt; causes<br>
&gt; glibc to flush the stream (regardless of whether a flush is actually<br>
&gt; needed). &nbsp;If we modify the snippet to call setvbuf() and disable<br>
&gt; buffering on the file stream before any of the fseek() calls, then
it<br>
&gt; finishes more or less instantly, as you would expect.<br>
<br>
I'd encourage you to file a bug (preferably with a patch) against &nbsp;<br>
glibc to fix this. &nbsp;I've had reasonable success in getting problems
&nbsp;<br>
like this fixed upstream.<br>
<br>
&gt; The problem is that this offending code is actually buried deep &nbsp;<br>
&gt; within a<br>
&gt; COTS library that we're using to do image processing (the Hierarchical<br>
&gt; Data Format (HDF) library). &nbsp;While we do have access to the source
&nbsp;<br>
&gt; code<br>
&gt; for this library and could conceivably modify it, this is a large
and<br>
&gt; complex library, and a change of this nature would require us to do
a<br>
&gt; large amount of regression testing to ensure that nothing was broken.<br>
&gt;<br>
&gt; So at the end of the day this is really not a &quot;Lustre problem&quot;
per se,<br>
&gt; though we would still be interested in any suggestions as to how we
&nbsp;<br>
&gt; can<br>
&gt; minimize the effects of this glibc &quot;flush penalty&quot;. &nbsp;This
penalty is &nbsp;<br>
&gt; not<br>
&gt; particularly onerous when reading and writing to local disk, but is<br>
&gt; obviously more of an issue with a distributed filesystem.<br>
<br>
Similarly, HDF + Lustre usage is very common, and I expect that the &nbsp;<br>
HDF developers would be interested to fix this if possible.<br>
<br>
&gt; On Wed, 2010-04-14 at 07:08 -0500, Ronald K Long wrote:<br>
&gt; &gt;<br>
&gt; &gt; Andreas - Here is a snipet of the strace output.<br>
&gt; &gt;<br>
&gt; &gt; read(3, &nbsp;<br>
&gt; &quot;\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0<br>
&gt; &gt; \0\0&quot;..., 2097152) = 2097152<br>
&gt;<br>
&gt; As Andreas suspected, your application is doing 2MB reads every time.<br>
&gt; Does it really need 2MB of data on each read? &nbsp;If not, can you
fix &nbsp;<br>
&gt; your<br>
&gt; application to only read as much data as it actually wants?<br>
<br>
<br>
Cheers, Andreas<br>
--<br>
Andreas Dilger<br>
Principal Engineer, Lustre Group<br>
Oracle Corporation Canada Inc.<br>
<br>
</font></tt>
<br>
<br>