linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the vfs tree with the aio-direct tree
@ 2013-09-05  3:02 Stephen Rothwell
  0 siblings, 0 replies; 6+ messages in thread
From: Stephen Rothwell @ 2013-09-05  3:02 UTC (permalink / raw)
  To: Al Viro
  Cc: linux-next, linux-kernel, Dave Kleikamp, Christoph Hellwig, Jan Kara

[-- Attachment #1: Type: text/plain, Size: 1072 bytes --]

Hi Al,

Today's linux-next merge of the vfs tree got a conflict in fs/direct-io.c
between commit 8f2a7fbb9b10 ("dio: add bio_vec support to
__blockdev_direct_IO()") from the aio-direct tree and commit 7b7a8665edd8
("direct-io: Implement generic deferred AIO completions") from the vfs
tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc fs/direct-io.c
index 75a3989,1782023..0000000
--- a/fs/direct-io.c
+++ b/fs/direct-io.c
@@@ -127,7 -127,7 +127,8 @@@ struct dio 
  	spinlock_t bio_lock;		/* protects BIO fields below */
  	int page_errors;		/* errno from get_user_pages() */
  	int is_async;			/* is IO async ? */
 +	int should_dirty;		/* should we mark read pages dirty? */
+ 	bool defer_completion;		/* defer AIO completion to workqueue? */
  	int io_error;			/* IO error in completion path */
  	unsigned long refcount;		/* direct_io_worker() and bios */
  	struct bio *bio_list;		/* singly linked via bi_private */

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: linux-next: manual merge of the vfs tree with the aio-direct tree
  2013-09-18  2:00 ` Al Viro
  2013-09-18  3:25   ` Dave Kleikamp
@ 2013-09-18 17:06   ` Zach Brown
  1 sibling, 0 replies; 6+ messages in thread
From: Zach Brown @ 2013-09-18 17:06 UTC (permalink / raw)
  To: Al Viro; +Cc: Stephen Rothwell, linux-next, linux-kernel, Dave Kleikamp

> As for aio-direct...  Two questions:
> 	* had anybody tried to measure the effect on branch predictor from
> introducing that method vector?  Commit d6afd4c4 ("iov_iter: hide iovec
> details behind ops function pointers")

FWIW, I never did.  I only went that route to begin with because the few
alternatives I tried before that were even more ugly :(.  It's been long
enough that I can't quite remember what I'd tried, though.

- z

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: linux-next: manual merge of the vfs tree with the aio-direct tree
  2013-09-18  2:00 ` Al Viro
@ 2013-09-18  3:25   ` Dave Kleikamp
  2013-09-18 17:06   ` Zach Brown
  1 sibling, 0 replies; 6+ messages in thread
From: Dave Kleikamp @ 2013-09-18  3:25 UTC (permalink / raw)
  To: Al Viro; +Cc: Stephen Rothwell, linux-next, linux-kernel, Zach Brown

On 09/17/2013 09:00 PM, Al Viro wrote:
> On Wed, Sep 18, 2013 at 10:56:38AM +1000, Stephen Rothwell wrote:
>> Hi Al,
>>
>> Today's linux-next merge of the vfs tree got conflicts in fs/nfs/direct.c
>> and fs/nfs/file.c between commits b9517433d65d ("dio: Convert direct_IO
>> to use iov_iter"), a8431c667ae8 ("nfs: add support for read_iter,
>> write_iter") and a1b8ec384b73 ("nfs: simplify swap") from the aio-direct
>> tree and commit c18d1ec44f7a ("nfs: use %p[dD] instead of open-coded (and
>> often racy) equivalents") from the vfs tree.
>>
>> I fixed it up (see below) and can carry the fix as necessary (no action
>> is required).
> 
> Hrm...  FWIW, I would greatly prefer to offload these printk patches to
> NFS and NFSD trees.  Didn't get around to that yet, but...
> 
> As for aio-direct...  Two questions:
> 	* had anybody tried to measure the effect on branch predictor from
> introducing that method vector?  Commit d6afd4c4 ("iov_iter: hide iovec
> details behind ops function pointers")

Any suggestions for a good benchmark?

> 	* WTF does aforementioned commit lack its author's s-o-b?  The same
> goes for a lot of zab's commits in there...

That would be my bad. Zach's original patches had his s-o-b (w/an Oracle
email address). I'll add them back.

Shaggy

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: linux-next: manual merge of the vfs tree with the aio-direct tree
  2013-09-18  0:56 Stephen Rothwell
@ 2013-09-18  2:00 ` Al Viro
  2013-09-18  3:25   ` Dave Kleikamp
  2013-09-18 17:06   ` Zach Brown
  0 siblings, 2 replies; 6+ messages in thread
From: Al Viro @ 2013-09-18  2:00 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linux-next, linux-kernel, Dave Kleikamp, Zach Brown

On Wed, Sep 18, 2013 at 10:56:38AM +1000, Stephen Rothwell wrote:
> Hi Al,
> 
> Today's linux-next merge of the vfs tree got conflicts in fs/nfs/direct.c
> and fs/nfs/file.c between commits b9517433d65d ("dio: Convert direct_IO
> to use iov_iter"), a8431c667ae8 ("nfs: add support for read_iter,
> write_iter") and a1b8ec384b73 ("nfs: simplify swap") from the aio-direct
> tree and commit c18d1ec44f7a ("nfs: use %p[dD] instead of open-coded (and
> often racy) equivalents") from the vfs tree.
> 
> I fixed it up (see below) and can carry the fix as necessary (no action
> is required).

Hrm...  FWIW, I would greatly prefer to offload these printk patches to
NFS and NFSD trees.  Didn't get around to that yet, but...

As for aio-direct...  Two questions:
	* had anybody tried to measure the effect on branch predictor from
introducing that method vector?  Commit d6afd4c4 ("iov_iter: hide iovec
details behind ops function pointers")
	* WTF does aforementioned commit lack its author's s-o-b?  The same
goes for a lot of zab's commits in there...

^ permalink raw reply	[flat|nested] 6+ messages in thread

* linux-next: manual merge of the vfs tree with the aio-direct tree
@ 2013-09-18  0:56 Stephen Rothwell
  2013-09-18  2:00 ` Al Viro
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen Rothwell @ 2013-09-18  0:56 UTC (permalink / raw)
  To: Al Viro; +Cc: linux-next, linux-kernel, Dave Kleikamp

[-- Attachment #1: Type: text/plain, Size: 6019 bytes --]

Hi Al,

Today's linux-next merge of the vfs tree got conflicts in fs/nfs/direct.c
and fs/nfs/file.c between commits b9517433d65d ("dio: Convert direct_IO
to use iov_iter"), a8431c667ae8 ("nfs: add support for read_iter,
write_iter") and a1b8ec384b73 ("nfs: simplify swap") from the aio-direct
tree and commit c18d1ec44f7a ("nfs: use %p[dD] instead of open-coded (and
often racy) equivalents") from the vfs tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc fs/nfs/direct.c
index 239c2fe,d71d66c..0000000
--- a/fs/nfs/direct.c
+++ b/fs/nfs/direct.c
@@@ -118,18 -117,26 +118,17 @@@ static inline int put_dreq(struct nfs_d
   * @nr_segs: size of iovec array
   *
   * The presence of this routine in the address space ops vector means
 - * the NFS client supports direct I/O. However, for most direct IO, we
 - * shunt off direct read and write requests before the VFS gets them,
 - * so this method is only ever called for swap.
 + * the NFS client supports direct I/O. However, we shunt off direct
 + * read and write requests before the VFS gets them, so this method
 + * should never be called.
   */
 -ssize_t nfs_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov, loff_t pos, unsigned long nr_segs)
 +ssize_t nfs_direct_IO(int rw, struct kiocb *iocb, struct iov_iter *iter,
 +		      loff_t pos)
  {
- 	dprintk("NFS: nfs_direct_IO (%s) off/no(%Ld/%lu) EINVAL\n",
- 			iocb->ki_filp->f_path.dentry->d_name.name,
- 			(long long) pos, iter->nr_segs);
 -#ifndef CONFIG_NFS_SWAP
+ 	dprintk("NFS: nfs_direct_IO (%pD) off/no(%Ld/%lu) EINVAL\n",
 -			iocb->ki_filp, (long long) pos, nr_segs);
++			iocb->ki_filp, (long long) pos, iter->nr_segs);
  
  	return -EINVAL;
 -#else
 -	VM_BUG_ON(iocb->ki_nbytes != PAGE_SIZE);
 -
 -	if (rw == READ || rw == KERNEL_READ)
 -		return nfs_file_direct_read(iocb, iov, nr_segs, pos,
 -				rw == READ ? true : false);
 -	return nfs_file_direct_write(iocb, iov, nr_segs, pos,
 -				rw == WRITE ? true : false);
 -#endif /* CONFIG_NFS_SWAP */
  }
  
  static void nfs_direct_release_pages(struct page **pages, unsigned int npages)
@@@ -1010,13 -905,11 +1009,11 @@@ ssize_t nfs_file_direct_read(struct kio
  	struct address_space *mapping = file->f_mapping;
  	size_t count;
  
 -	count = iov_length(iov, nr_segs);
 +	count = iov_iter_count(iter);
  	nfs_add_stats(mapping->host, NFSIOS_DIRECTREADBYTES, count);
  
- 	dfprintk(FILE, "NFS: direct read(%s/%s, %zd@%Ld)\n",
- 		file->f_path.dentry->d_parent->d_name.name,
- 		file->f_path.dentry->d_name.name,
- 		count, (long long) pos);
+ 	dfprintk(FILE, "NFS: direct read(%pD2, %zd@%Ld)\n",
+ 		file, count, (long long) pos);
  
  	retval = 0;
  	if (!count)
@@@ -1065,13 -959,11 +1062,11 @@@ ssize_t nfs_file_direct_write(struct ki
  	struct address_space *mapping = file->f_mapping;
  	size_t count;
  
 -	count = iov_length(iov, nr_segs);
 +	count = iov_iter_count(iter);
  	nfs_add_stats(mapping->host, NFSIOS_DIRECTWRITTENBYTES, count);
  
- 	dfprintk(FILE, "NFS: direct write(%s/%s, %zd@%Ld)\n",
- 		file->f_path.dentry->d_parent->d_name.name,
- 		file->f_path.dentry->d_name.name,
- 		count, (long long) pos);
+ 	dfprintk(FILE, "NFS: direct write(%pD2, %zd@%Ld)\n",
+ 		file, count, (long long) pos);
  
  	retval = generic_write_checks(file, &pos, &count, 0);
  	if (retval)
diff --cc fs/nfs/file.c
index 19ac4fd,e2fcacf..0000000
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@@ -174,18 -165,18 +165,17 @@@ nfs_file_flush(struct file *file, fl_ow
  EXPORT_SYMBOL_GPL(nfs_file_flush);
  
  ssize_t
 -nfs_file_read(struct kiocb *iocb, const struct iovec *iov,
 -		unsigned long nr_segs, loff_t pos)
 +nfs_file_read_iter(struct kiocb *iocb, struct iov_iter *iter, loff_t pos)
  {
- 	struct dentry * dentry = iocb->ki_filp->f_path.dentry;
- 	struct inode * inode = dentry->d_inode;
+ 	struct inode *inode = file_inode(iocb->ki_filp);
  	ssize_t result;
  
  	if (iocb->ki_filp->f_flags & O_DIRECT)
 -		return nfs_file_direct_read(iocb, iov, nr_segs, pos, true);
 +		return nfs_file_direct_read(iocb, iter, pos);
  
- 	dprintk("NFS: read_iter(%s/%s, %lu@%lu)\n",
- 		dentry->d_parent->d_name.name, dentry->d_name.name,
 -	dprintk("NFS: read(%pD2, %lu@%lu)\n",
++	dprintk("NFS: read_iter(%pD2, %lu@%lu)\n",
+ 		iocb->ki_filp,
 -		(unsigned long) iov_length(iov, nr_segs), (unsigned long) pos);
 +		(unsigned long) iov_iter_count(iter), (unsigned long) pos);
  
  	result = nfs_revalidate_mapping(inode, iocb->ki_filp->f_mapping);
  	if (!result) {
@@@ -655,25 -634,24 +633,24 @@@ static int nfs_need_sync_write(struct f
  	return 0;
  }
  
 -ssize_t nfs_file_write(struct kiocb *iocb, const struct iovec *iov,
 -		       unsigned long nr_segs, loff_t pos)
 +ssize_t nfs_file_write_iter(struct kiocb *iocb, struct iov_iter *iter,
 +			    loff_t pos)
  {
- 	struct dentry * dentry = iocb->ki_filp->f_path.dentry;
- 	struct inode * inode = dentry->d_inode;
+ 	struct file *file = iocb->ki_filp;
+ 	struct inode *inode = file_inode(file);
  	unsigned long written = 0;
  	ssize_t result;
 -	size_t count = iov_length(iov, nr_segs);
 +	size_t count = iov_iter_count(iter);
  
- 	result = nfs_key_timeout_notify(iocb->ki_filp, inode);
+ 	result = nfs_key_timeout_notify(file, inode);
  	if (result)
  		return result;
  
- 	if (iocb->ki_filp->f_flags & O_DIRECT)
+ 	if (file->f_flags & O_DIRECT)
 -		return nfs_file_direct_write(iocb, iov, nr_segs, pos, true);
 +		return nfs_file_direct_write(iocb, iter, pos);
  
- 	dprintk("NFS: write_iter(%s/%s, %lu@%lld)\n",
- 		dentry->d_parent->d_name.name, dentry->d_name.name,
- 		(unsigned long) count, (long long) pos);
 -	dprintk("NFS: write(%pD2, %lu@%Ld)\n",
++	dprintk("NFS: write_iter(%pD2, %lu@%Ld)\n",
+ 		file, (unsigned long) count, (long long) pos);
  
  	result = -EBUSY;
  	if (IS_SWAPFILE(inode))

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* linux-next: manual merge of the vfs tree with the aio-direct tree
@ 2013-09-05  2:54 Stephen Rothwell
  0 siblings, 0 replies; 6+ messages in thread
From: Stephen Rothwell @ 2013-09-05  2:54 UTC (permalink / raw)
  To: Al Viro
  Cc: linux-next, linux-kernel, Christoph Hellwig, Asias He, Dave Kleikamp

[-- Attachment #1: Type: text/plain, Size: 943 bytes --]

Hi Al,

Today's linux-next merge of the vfs tree got a conflict in fs/block_dev.c
between commit b176eedb2a8b ("block_dev: add support for read_iter,
write_iter") from the aio-direct tree and commit 02afc27faec9
("direct-io: Handle O_(D)SYNC AIO") from the vfs tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc fs/block_dev.c
index 89d8ec5,1173a4e..0000000
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@@ -1517,8 -1518,8 +1517,8 @@@ ssize_t blkdev_write_iter(struct kiocb 
  	BUG_ON(iocb->ki_pos != pos);
  
  	blk_start_plug(&plug);
 -	ret = __generic_file_aio_write(iocb, iov, nr_segs, &iocb->ki_pos);
 +	ret = __generic_file_write_iter(iocb, iter, &iocb->ki_pos);
- 	if (ret > 0 || ret == -EIOCBQUEUED) {
+ 	if (ret > 0) {
  		ssize_t err;
  
  		err = generic_write_sync(file, pos, ret);

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-09-18 17:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-05  3:02 linux-next: manual merge of the vfs tree with the aio-direct tree Stephen Rothwell
  -- strict thread matches above, loose matches on Subject: below --
2013-09-18  0:56 Stephen Rothwell
2013-09-18  2:00 ` Al Viro
2013-09-18  3:25   ` Dave Kleikamp
2013-09-18 17:06   ` Zach Brown
2013-09-05  2:54 Stephen Rothwell

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).