From: Chris Mason <chris.mason@oracle.com>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-fsdevel@vger.kernel.org, zach.brown@oracle.com
Subject: Re: [RFC PATCH 0/2] O_DIRECT locking rework
Date: Fri, 20 Oct 2006 16:05:59 -0400 [thread overview]
Message-ID: <20061020200559.GD8674@think.oraclecorp.com> (raw)
In-Reply-To: <20061020123058.8b422339.akpm@osdl.org>
On Fri, Oct 20, 2006 at 12:30:58PM -0700, Andrew Morton wrote:
> On Fri, 20 Oct 2006 14:32:37 -0400
> Chris Mason <chris.mason@oracle.com> wrote:
>
> > Hello everyone,
> >
> > O_DIRECT locking currently uses a few different per-inode locks to
> > prevent races between buffered io and direct io. This is awkward, and
> > sometimes grows races where we expose old data on disk.
> >
> > For example, I can't quite see how we protect from an mmap triggered
> > writepage from filling a hole in the middle of an O_DIRECT read.
> >
> > This patch set changes O_DIRECT to use page locks instead of
> > mutex/semaphores. It looks in the radix tree for pages affected by this
> > O_DIRECT read/wrte and locks any pages it finds.
>
> Boy, it doesn't do much to simplify the code, does it? An opportunity for
> Linus to again share with us his opinions on direct-io.
It definitely isn't trivial. But hopefully if we make direct-io a
special case via the place holder pages, we can get rid of other (more
complex) special cases elsewhere. I think we can eventually get rid of
the fall back to buffered io stuff with this.
>
> Conceptually, sticking locked pages into the mapping is a good thing to do,
> because it meshes in with all our existing synchronisation design.
>
> I think the fake placeholder page can be a kernel-wide thing rather than
> per-dio? That would be most desirable because then we have
>
> #define PagePlaceHolder(page) (page == global_placeholder_page)
>
> which saves a precious page flag.
I flipped a coin on the placeholder testing mechanism. I can't think of
a reason to have more than one placeholder page, so the global is fine
by me. Zach has some ideas on optimizations at the radix tree level,
but we'll still need some kind of PagePlaceHolder test.
-chris
next prev parent reply other threads:[~2006-10-20 20:06 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-20 18:32 [RFC PATCH 0/2] O_DIRECT locking rework Chris Mason
2006-10-20 18:38 ` [RFC PATCH 1/2] placeholder pages Chris Mason
2006-10-20 18:41 ` [RFC PATCH 1/2] page cache locking for O_DIRECT Chris Mason
2006-10-20 19:30 ` [RFC PATCH 0/2] O_DIRECT locking rework Andrew Morton
2006-10-20 20:03 ` Zach Brown
2006-10-20 20:12 ` Chris Mason
2006-10-20 20:05 ` Chris Mason [this message]
2006-10-20 20:23 ` Andi Kleen
2006-10-24 19:34 ` Chris Mason
2006-10-24 19:38 ` [RFC PATCH 1/2] placeholder pages Chris Mason
2006-10-24 19:40 ` [RFC PATCH 2/2] O_DIRECT locking via placeholders Chris Mason
2006-10-24 20:28 ` [RFC PATCH 0/2] O_DIRECT locking rework Badari Pulavarty
2006-10-24 20:50 ` Chris Mason
2006-10-24 21:52 ` Badari Pulavarty
2006-10-24 22:22 ` Chris Mason
2006-10-24 22:47 ` Badari Pulavarty
2006-10-24 22:37 ` Russell Cattelan
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=20061020200559.GD8674@think.oraclecorp.com \
--to=chris.mason@oracle.com \
--cc=akpm@osdl.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=zach.brown@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.