linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Chris Mason <mason@suse.com>
Cc: linux-fsdevel@vger.kernel.org, akpm@osdl.org
Subject: Re: [PATCH RFC] O_DIRECT reads and writes without i_sem
Date: Mon, 1 Nov 2004 16:08:44 +0000	[thread overview]
Message-ID: <20041101160844.GA29251@infradead.org> (raw)
In-Reply-To: <1099323127.23475.80.camel@watt.suse.com>

On Mon, Nov 01, 2004 at 10:32:07AM -0500, Chris Mason wrote:
> Hello everyone,
> 
> Right now, O_DIRECT reads and writes on regular files have to take i_sem
> while reading file metadata in order to make sure we don't race with
> hole filling.
> 
> This patch tries to get around that by avoiding i_sem when we are doing
> an O_DIRECT read or write inside of i_size.  Yet another rw semaphore is
> added to struct inode to protect against holes being filled during the
> O_DIRECT.  direct-io.c gets another special case to be aware of the
> locking.
> 
> This has only been lightly tested, I'm posting here for general comments
> before I go much further.  I'm rounding up some hardware with enough
> disks to benchmark it properly.  
> 
> Only ext2 and reiserfs are modified to drop i_sem during O_DIRECT. ext3
> needs some care around the orphan lists, and I didn't want to get into
> that until the rest of the patch was working.

This gets too complicated for it's own sake.  What about going down the
XFS route and making i_sem a r/w semaphore that's taken only shared
during read and write I/O, but exclusive while setting up write I/O
outside of i_size?  Alternatively just move the I/O locking into the
filesytem.


  reply	other threads:[~2004-11-01 16:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-01 15:32 [PATCH RFC] O_DIRECT reads and writes without i_sem Chris Mason
2004-11-01 16:08 ` Christoph Hellwig [this message]
2004-11-01 16:56   ` Chris Mason
2004-11-05 18:06   ` Chris Mason

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=20041101160844.GA29251@infradead.org \
    --to=hch@infradead.org \
    --cc=akpm@osdl.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=mason@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).