Skip to contentSkip to conversation

linux-next: manual merge of the block tree with the vfs tree

DISCUSSION Stephen Rothwell 4 participants 7 messages Jan 27, 2015 – Feb 2, 2015 Linux-next tree

lore
Share & tools
lore
#0 lore raw

Hi Jens,

Today's linux-next merge of the block tree got a conflict in drivers/block/loop.c between commit c2ca80413553 ("loop: convert to vfs_iter_read/write") from the vfs tree and commit b5dd2f6047ca ("block: loop: improve performance via blk-mq") and several others from the block tree.

I have no idea how fixed it up so I just used the version of the file from the block tree (its been there a while). Please have a chat and figure out how to combine these two large changes.

Signature · 2 lines
Cheers,
Stephen Rothwell                    [email protected]
#1 lore raw
Quoted 11 lines · Stephen Rothwell

Hi Jens,

Today's linux-next merge of the block tree got a conflict in drivers/block/loop.c between commit c2ca80413553 ("loop: convert to vfs_iter_read/write") from the vfs tree and commit b5dd2f6047ca ("block: loop: improve performance via blk-mq") and several others from the block tree.

I have no idea how fixed it up so I just used the version of the file from the block tree (its been there a while). Please have a chat and figure out how to combine these two large changes.

Why isn't the loop patch in the block tree? That'd avoid such incidents. We could add a dependency for the required VFS patch.

Signature · 1 line
Jens Axboe
#2 lore raw
Quoted 9 lines · Jens Axboe
Quoted 8 lines · Stephen Rothwell

Hi Jens,

Today's linux-next merge of the block tree got a conflict in drivers/block/loop.c between commit c2ca80413553 ("loop: convert to vfs_iter_read/write") from the vfs tree and commit b5dd2f6047ca ("block: loop: improve performance via blk-mq") and several others from the block tree.

Quoted 6 lines
Quoted 3 lines

I have no idea how fixed it up so I just used the version of the file from the block tree (its been there a while). Please have a chat and figure out how to combine these two large changes.

Why isn't the loop patch in the block tree? That'd avoid such incidents. We could add a dependency for the required VFS patch.

I don't mind opening a never-rebased branch for generic iov_iter-related stuff; if you prefer to handle it that way - just tell. The first two patches from that series would definitely go there; as for the rest... no preferences here.

#3 lore raw
Quoted 4 lines · Al Viro

I don't mind opening a never-rebased branch for generic iov_iter-related stuff; if you prefer to handle it that way - just tell. The first two patches from that series would definitely go there; as for the rest... no preferences here.

It might make sense to just keep the VFS patches in your tree. The target ones also are something I'd prefer if it goes through Nic with additional review. In addition they aren't really critical, so if you merge the prep patches now we can feed the rest through the proper trees in the .21 merge window.

#4 lore raw
Quoted 11 lines · Christoph Hellwig
Quoted 4 lines · Al Viro

I don't mind opening a never-rebased branch for generic iov_iter-related stuff; if you prefer to handle it that way - just tell. The first two patches from that series would definitely go there; as for the rest... no preferences here.

It might make sense to just keep the VFS patches in your tree. The target ones also are something I'd prefer if it goes through Nic with additional review. In addition they aren't really critical, so if you merge the prep patches now we can feed the rest through the proper trees in the .21 merge window.

Done. The first two are in #iov_iter now (merged into #for-next), the rest is dropped. And #iov_iter is in never-rebased mode, so feel free to pull it wherever you need it.

#5 lore raw
Quoted 13 lines · Al Viro
Quoted 11 lines · Christoph Hellwig
Quoted 4 lines · Al Viro

I don't mind opening a never-rebased branch for generic iov_iter-related stuff; if you prefer to handle it that way - just tell. The first two patches from that series would definitely go there; as for the rest... no preferences here.

It might make sense to just keep the VFS patches in your tree. The target ones also are something I'd prefer if it goes through Nic with additional review. In addition they aren't really critical, so if you merge the prep patches now we can feed the rest through the proper trees in the .21 merge window.

Quoted 3 lines

Done. The first two are in #iov_iter now (merged into #for-next), the rest is dropped. And #iov_iter is in never-rebased mode, so feel free to pull it wherever you need it.

FWIW, there's an interesting question about the second commit in there - what do we want vfs_iter_{read,write}() to do with *iter in case if it has hit this:

        if (ret == -EIOCBQUEUED)
                ret = wait_on_sync_kiocb(&kiocb);

Do we require ->read_iter() and ->write_iter() on sync kiocb to do all advancing the iter before returning -EIOCBQUEUED? What's more, do we ever want to have it returned on sync kiocb? IOW, is there any point in having that wait in callers?

Note that there are _very_ few drivers that ever do that; fs/direct_io.c, for example, will wait for completion in case of sync kiocb. AFAICS, there are exactly two drivers like that: drivers/usb/gadget/legacy/inode.c and drivers/usb/gadget/function/f_fs.c. And the latter is very easy to convert to "waits in case of sync kiocb" - there already are two codepaths ({read,write} and aio_{read,write}) and it's trivial to teach the sync path to deal with arbitrary iov_iter, with aio side of things doing the sync variant in case of sync kiocb. Cheaper, as well, since we don't need to copy iovec, etc.

I'm not sure if ep_io() and ep_aio_rwtail() + wait for completion are eqiuvalent; ep_read/ep_write are very easy to turn into sync side of ->read_iter/->write_iter and if that's equivalent to ep_aio_read/ep_aio_write on sync kiocb + waiting for completion, we are fine.

Comments?

#6 lore raw
Quoted 10 lines · Al Viro

FWIW, there's an interesting question about the second commit in there - what do we want vfs_iter_{read,write}() to do with *iter in case if it has hit this:

        if (ret == -EIOCBQUEUED)
                ret = wait_on_sync_kiocb(&kiocb);

Do we require ->read_iter() and ->write_iter() on sync kiocb to do all advancing the iter before returning -EIOCBQUEUED? What's more, do we ever want to have it returned on sync kiocb? IOW, is there any point in having that wait in callers?

See my "[RFC] split struct kiocb" series to sort out that mess. For now none of the callers relies on the iov_iter being advances, so until then we can simply ignore that problem until then.

Quoted 4 lines

I'm not sure if ep_io() and ep_aio_rwtail() + wait for completion are eqiuvalent; ep_read/ep_write are very easy to turn into sync side of ->read_iter/->write_iter and if that's equivalent to ep_aio_read/ep_aio_write on sync kiocb + waiting for completion, we are fine.

They are very similar, and yes thet should be moved to iter version of the methods. I actually started that but then ran into problems with the aio core that needed addressing first.