Re: infinite loop? with mmap, nfs, pwrite, O_DIRECT

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

 



On Mon, 2005-11-21 at 15:34 -0800, Andrew Morton wrote:
> Trond Myklebust <[email protected]> wrote:
> >
> >  Anything that calls lock_page() should be avoided in O_DIRECT,
> 
> Why?
> 
> And it's still doing lock_page():
> 
> 	nfs_file_direct_write()
> 	->filemap_fdatawrite()
> 	  ->do_writepages()
> 	    ->nfs_writepages()
> 	      ->generic_writepages()
> 	        ->mpage_writepages()
> 	          ->lock_page()

True.

> > however
> >   we should be able to call invalidate_inode_pages() since that doesn't
> >   wait on the page lock.
> 
> invalidate_inode_pages2() is better.


> And using generic_file_direct_IO() is
> better still, since it handles mmap coherency and only work upon that part
> of the file which is actually undergoing IO.

Unlike local filesystems, we don't want to have to take the i_sem in any
of the direct IO paths. The latter is just a liability as far as
applications are concerned: it doesn't offer any protection for local
data (there _is_ no local data to protect), but gets seriously in the
way of write parallelism.

The only difference I can see between the two paths is the call to
unmap_mapping_range(). What effect would that have?

Cheers,
  Trond

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux