From: Sunil Mushran <Sunil.Mushran@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] OCFS2 and direct-io writes
Date: Thu, 05 Jun 2008 16:10:27 -0700 [thread overview]
Message-ID: <48487263.9060205@oracle.com> (raw)
In-Reply-To: <9560740CA5C0C54BB3853AC9A4164BBB0308251D@EX-101.mail.navisite.com>
Ivan,
Updating inode->i_size will require us to take the EX on the inode
cluster lock. (We take great pains to avoid taking that lock
in the directio path lest we serialize those ios across the
cluster.)
As far as treating unwritten extents as holes goes, we do that
simply to remember to initialize them, which is more efficient
in the buffered path. Skipping this will be a security hole.
Mark, Comments?
Also cc-ing Chris incase he can shed some light into XFS behavior.
Sunil
Eivind Sarto wrote:
>
> I am looking at possibility of using OCFS2 with an existing
> application that
> requires very high throughput for read and write file access.
> Files are created by single writer (process) and can be read by
> multiple reader,
> possibly while the file is being written. 100+ different files may be
> written
> simultaneously, and can be read by 1000+ readers.
>
> I am currently using XFS on a local filesystem, preallocating the
> unwritten extents with RESVSP,
> writing and reading the files with large direct-io requests.
>
> OCFS2-1.3.9 appears to almost support the features I need. Large
> direct-io requests can be passed straight
> through to the storage device and allocation of unwritten extents are
> supported (even same API as XFS).
> However, direct-io writes are not supported if the file is being
> appended. The direct-io requests
> is converted to a buffered-io and the io write-bandwidth is not very good.
>
> I am not familiar with OCFS2 internals and my question is the following:
> Would it be possible to modify OCFS2 to support direct-io when writing
> a file sequentially?
> Would it easier if the data blocks had already been allocated as
> unwritten extents (using RESVSP)?
>
>
> I actually attempted to hack the OCFS2 code a bit to allow direct-io
> writes to happen when the extents
> had previously been allocated with a RESVSP. It only to a couple of
> minor changes:
> file.c:ocfs2_prepare_inode_for_write()
> Don't disable direct_io if file is growing.
> file.c:ocfs2_check_range_for_holes()
> Don't treat unwritten extents as holes.
> aops.c:ocfs2_direct_IO_get_blocks()
> Map unwritten extents if they exists.
>
> With these changes, a single/local OCFS2 filesystem will allow me to
> write/create files using
> large, direct-io. All the write requests go straight through to the
> storage. And the write performance
> is very close to that of XFS.
> But, in a distributed environment the inode->i_size does not get
> syncronized with the other nodes in
> the cluster. The direct-io path does not syncronize the inode->i_size.
>
> Would it be possible to safely to update the i_size for all nodes in a
> cluster, without causing any
> races or other problems?
> If so, does anyone have any suggestions as to how and where in the
> code I could syncronize the i_size?
>
> Any feedback would be appreciated.
> Thanks,
> -ivan
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Ocfs2-devel mailing list
> Ocfs2-devel at oss.oracle.com
> http://oss.oracle.com/mailman/listinfo/ocfs2-devel
next prev parent reply other threads:[~2008-06-05 23:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-04 0:22 [Ocfs2-devel] OCFS2 and direct-io writes Eivind Sarto
2008-06-05 23:10 ` Sunil Mushran [this message]
2008-06-06 0:04 ` Eivind Sarto
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48487263.9060205@oracle.com \
--to=sunil.mushran@oracle.com \
--cc=ocfs2-devel@oss.oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.