<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7652.24">
<TITLE>OCFS2 and direct-io writes</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>I am looking at possibility of using OCFS2 with an existing application that<BR>
requires very high throughput for read and write file access.<BR>
Files are created by single writer (process) and can be read by multiple reader,<BR>
possibly while the file is being written.&nbsp; 100+ different files may be written<BR>
simultaneously, and can be read by 1000+ readers.<BR>
<BR>
I am currently using XFS on a local filesystem, preallocating the unwritten extents with RESVSP,<BR>
writing and reading the files with large direct-io requests.<BR>
<BR>
OCFS2-1.3.9 appears to almost support the features I need.&nbsp; Large direct-io requests can be passed straight<BR>
through to the storage device and allocation of unwritten extents are supported (even same API as XFS).<BR>
However, direct-io writes are not supported if the file is being appended.&nbsp; The direct-io requests<BR>
is converted to a buffered-io and the io write-bandwidth is not very good.<BR>
<BR>
I am not familiar with OCFS2 internals and my question is the following:<BR>
Would it be possible to modify OCFS2 to support direct-io when writing a file sequentially?<BR>
Would it easier if the data blocks had already been allocated as unwritten extents (using RESVSP)?<BR>
<BR>
<BR>
I actually attempted to hack the OCFS2 code a bit to allow direct-io writes to happen when the extents<BR>
had previously been allocated with a RESVSP.&nbsp; It only to a couple of minor changes:<BR>
&nbsp; file.c:ocfs2_prepare_inode_for_write()<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Don't disable direct_io if file is growing.<BR>
&nbsp; file.c:ocfs2_check_range_for_holes()<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Don't treat unwritten extents as holes.<BR>
&nbsp; aops.c:ocfs2_direct_IO_get_blocks()<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Map unwritten extents if they exists.<BR>
<BR>
With these changes, a single/local OCFS2 filesystem will allow me to write/create files using<BR>
large, direct-io.&nbsp; All the write requests go straight through to the storage.&nbsp; And the write performance<BR>
is very close to that of XFS.<BR>
But, in a distributed environment the inode-&gt;i_size does not get syncronized with the other nodes in<BR>
the cluster.&nbsp; The direct-io path does not syncronize the inode-&gt;i_size.<BR>
<BR>
Would it be possible to safely to update the i_size for all nodes in a cluster, without causing any<BR>
races or other problems?<BR>
If so, does anyone have any suggestions as to how and where in the code I could syncronize the i_size?<BR>
<BR>
Any feedback would be appreciated.<BR>
Thanks,<BR>
-ivan<BR>
</FONT>
</P>

</BODY>
</HTML>