Re: [RFC PATCH 0/2] O_DIRECT locking rework

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx> 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

-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux