Re: [PATCH v6 2/5] fs: Convert kiocb rw_hint from enum to u16

2018-05-22 Thread Goldwyn Rodrigues
On 05/22/2018 10:32 AM, Jens Axboe wrote: > On 5/22/18 9:07 AM, adam.manzana...@wdc.com wrote: >> From: Adam Manzanares >> >> In order to avoid kiocb bloat for per command iopriority support, rw_hint >> is converted from enum to a u16. Added a guard around ki_hint

Re: [PATCH v7 2/2] Return bytes transferred for partial direct I/O

2018-05-20 Thread Goldwyn Rodrigues
On 05/19/2018 08:29 PM, Theodore Y. Ts'o wrote: > On Thu, Feb 08, 2018 at 12:59:48PM -0600, Goldwyn Rodrigues wrote: >> From: Goldwyn Rodrigues <rgold...@suse.com> >> >> In case direct I/O encounters an error midway, it returns the error. >> Instead it should

Re: [PATCH 31/33] iomap: add support for sub-pagesize buffered I/O without buffer heads

2018-05-15 Thread Goldwyn Rodrigues
On 05/15/2018 02:26 AM, Christoph Hellwig wrote: > On Mon, May 14, 2018 at 11:00:08AM -0500, Goldwyn Rodrigues wrote: >>> + if (iop || i_blocksize(inode) == PAGE_SIZE) >>> + return iop; >> >> Why is this an equal comparison operator? Shouldn't th

Re: [PATCH 31/33] iomap: add support for sub-pagesize buffered I/O without buffer heads

2018-05-14 Thread Goldwyn Rodrigues
On 05/09/2018 02:48 AM, Christoph Hellwig wrote: > After already supporting a simple implementation of buffered writes for > the blocksize == PAGE_SIZE case in the last commit this adds full support > even for smaller block sizes. There are three bits of per-block > information in the

Re: [PATCH v7 2/2] Return bytes transferred for partial direct I/O

2018-03-08 Thread Goldwyn Rodrigues
On 03/07/2018 06:53 PM, Darrick J. Wong wrote: > On Thu, Feb 08, 2018 at 12:59:48PM -0600, Goldwyn Rodrigues wrote: >> From: Goldwyn Rodrigues <rgold...@suse.com> >> >> In case direct I/O encounters an error midway, it returns the error. >> Instead it should

[PATCH v7 2/2] Return bytes transferred for partial direct I/O

2018-02-08 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> In case direct I/O encounters an error midway, it returns the error. Instead it should be returning the number of bytes transferred so far. Test case for filesystems (with ENOSPC): 1. Create an almost full filesystem 2. Create a file, say /mnt/la

[PATCH v7 1/2] xfs: remove assert to check bytes returned

2018-02-08 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> Since we can return less than count in case of partial direct writes, remove the ASSERT. Signed-off-by: Goldwyn Rodrigues <rgold...@suse.com> --- fs/xfs/xfs_file.c | 6 -- 1 file changed, 6 deletions(-) Changes since v6: - Reorder

Re: [PATCH v6 1/2] Return bytes transferred for partial direct I/O

2018-01-30 Thread Goldwyn Rodrigues
On 01/29/2018 01:04 PM, Randy Dunlap wrote: > On 01/29/2018 06:57 AM, Goldwyn Rodrigues wrote: >> From: Goldwyn Rodrigues <rgold...@suse.com> >> > >> diff --git a/Documentation/sysctl/fs.txt b/Documentation/sysctl/fs.txt >> index 6c00c1e2743f..72e213d62511

[PATCH 2/2] xfs: remove assert to check bytes returned

2018-01-29 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> Since we can return less than count in case of partial direct writes, remove the ASSERT. Signed-off-by: Goldwyn Rodrigues <rgold...@suse.com> Acked-by: Dave Chinner <dchin...@redhat.com> Reviewed-by: Darrick J. Wong <darrick.w..

[PATCH v6 1/2] Return bytes transferred for partial direct I/O

2018-01-29 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> In case direct I/O encounters an error midway, it returns the error. Instead it should be returning the number of bytes transferred so far. Test case for filesystems (with ENOSPC): 1. Create an almost full filesystem 2. Create a file, say /mnt/la

Re: [PATCH v5 1/2] Return bytes transferred for partial direct I/O

2018-01-25 Thread Goldwyn Rodrigues
On 01/23/2018 12:35 AM, Matthew Wilcox wrote: > On Mon, Jan 22, 2018 at 08:28:54PM -0700, Jens Axboe wrote: >> On 1/22/18 8:18 PM, Goldwyn Rodrigues wrote: >>>> that their application was "already broken". I'd hate for a kernel >>>> upgrade to br

Re: [PATCH v5 1/2] Return bytes transferred for partial direct I/O

2018-01-22 Thread Goldwyn Rodrigues
On 01/22/2018 01:13 PM, Jens Axboe wrote: > On 1/22/18 12:10 PM, Andreas Dilger wrote: >> >>> On Jan 20, 2018, at 8:07 PM, Jens Axboe <ax...@kernel.dk> wrote: >>> >>> On 1/20/18 7:23 PM, Goldwyn Rodrigues wrote: >>>> >>>> >

Re: [PATCH v5 1/2] Return bytes transferred for partial direct I/O

2018-01-21 Thread Goldwyn Rodrigues
On 01/20/2018 09:07 PM, Jens Axboe wrote: > On 1/20/18 7:23 PM, Goldwyn Rodrigues wrote: >> >> >> On 01/20/2018 08:11 PM, Andi Kleen wrote: >>> Goldwyn Rodrigues <rgold...@suse.de> writes: >>> >>>> From: Goldwyn Rodrigues <rgold..

Re: [PATCH v5 1/2] Return bytes transferred for partial direct I/O

2018-01-20 Thread Goldwyn Rodrigues
On 01/20/2018 01:47 PM, Al Viro wrote: > On Fri, Jan 19, 2018 at 06:33:56AM +, Al Viro wrote: >>> For both patches, >>> Reviewed-by: Darrick J. Wong >> >> Applied; will be in -next tomorrow morning after the tree I'm putting >> together >> gets through local

Re: [PATCH v5 1/2] Return bytes transferred for partial direct I/O

2018-01-20 Thread Goldwyn Rodrigues
On 01/20/2018 08:11 PM, Andi Kleen wrote: > Goldwyn Rodrigues <rgold...@suse.de> writes: > >> From: Goldwyn Rodrigues <rgold...@suse.com> >> >> In case direct I/O encounters an error midway, it returns the error. >> Instead it should be return

[PATCH v5 1/2] Return bytes transferred for partial direct I/O

2018-01-18 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> In case direct I/O encounters an error midway, it returns the error. Instead it should be returning the number of bytes transferred so far. Test case for filesystems (with ENOSPC): 1. Create an almost full filesystem 2. Create a file, say /mnt/la

[PATCH 2/2] xfs: remove assert to check bytes returned

2018-01-18 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> Since we can return less than count in case of partial direct writes, remove the ASSERT. Signed-off-by: Goldwyn Rodrigues <rgold...@suse.com> --- fs/xfs/xfs_file.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/fs/xfs/xfs_fil

Re: [PATCH v5] Return bytes transferred for partial direct I/O

2018-01-05 Thread Goldwyn Rodrigues
On 01/04/2018 08:10 PM, Darrick J. Wong wrote: > On Wed, Nov 22, 2017 at 06:29:01AM -0600, Goldwyn Rodrigues wrote: >> From: Goldwyn Rodrigues <rgold...@suse.com> >> >> In case direct I/O encounters an error midway, it returns the error. >> Instead it should

[PATCH] block: Set BIO_TRACE_COMPLETION on new bio during split

2017-11-30 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> Fixes: fbbaf700e7b1 ("block: trace completion of all bios.") Signed-off-by: Goldwyn Rodrigues <rgold...@suse.com> --- block/bio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/bio.c b/block/bi

[PATCH v5] Return bytes transferred for partial direct I/O

2017-11-22 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> In case direct I/O encounters an error midway, it returns the error. Instead it should be returning the number of bytes transferred so far. Test case for filesystems (with ENOSPC): 1. Create an almost full filesystem 2. Create a file, say /mnt/la

[PATCH 6/9] dm: add nowait support

2017-10-04 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> Add support for bio based dm devices, which exclusively sets a make_request_fn(). Request based devices are supported by default. Signed-off-by: Goldwyn Rodrigues <rgold...@suse.com> --- drivers/md/dm.c | 28

[PATCH 9/9] dm-mpath: Add nowait support

2017-10-04 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> If there are no queues, bail if REQ_NOWAIT is set instead of queueing up I/O. Signed-off-by: Goldwyn Rodrigues <rgold...@suse.com> --- drivers/md/dm-mpath.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/md/dm-mpath.c b/d

[PATCH 7/9] dm: Add nowait support to raid1

2017-10-04 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> If the I/O would block because the devices are syncing, bail. Signed-off-by: Goldwyn Rodrigues <rgold...@suse.com> --- drivers/md/dm-raid1.c | 13 + 1 file changed, 13 insertions(+) diff --git a/drivers/md/dm-raid1.c b/drivers

[PATCH 8/9] dm: Add nowait support to dm-delay

2017-10-04 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> I/O should bail out if any value for delay is set. Signed-off-by: Goldwyn Rodrigues <rgold...@suse.com> --- drivers/md/dm-delay.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/md/dm-delay.c b/drivers/md/dm-delay.c index

[PATCH 4/9] md: raid10 nowait support

2017-10-04 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> Bail and status to EAGAIN if raid10 is going to wait for: + barriers + reshape operation + Too many queued requests Signed-off-by: Goldwyn Rodrigues <rgold...@suse.com> --- drivers/md/r

[PATCH 5/9] md: raid5 nowait support

2017-10-04 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> Return EAGAIN in case RAID5 would block because of waiting due to reshaping. Signed-off-by: Goldwyn Rodrigues <rgold...@suse.com> --- drivers/md/raid5.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/md/raid5.c b/driver

[PATCH 3/9] md: raid1 nowait support

2017-10-04 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> The RAID1 driver would bail with EAGAIN in case of: + I/O has to wait for a barrier + array is frozen + Area is suspended + There are too many pending I/O that it will be queued. To facilitate error for wait barriers, wait_barrier() is ret

[PATCH 2/9] md: Add nowait support to md

2017-10-04 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> Set queue flags to QUEUE_FLAG_NOWAIT to indicate REQ_NOWAIT will be handled. If any of the underlying devices do not support NOWAIT feature, we do not set the flag. If the device is suspended, it returns -EWOULDBLOCK. Signed-off-by: Goldwyn Rod

[PATCH 1/9] QUEUE_FLAG_NOWAIT to indicate device supports nowait

2017-10-04 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> Nowait is a feature of direct AIO, where users can request to return immediately if the I/O is going to block. This translates to REQ_NOWAIT in bio.bi_opf flags. While request based devices don't wait, stacked devices such as md/dm will. In

[PATCH v2 0/9] Nowait support for stacked block devices

2017-10-04 Thread Goldwyn Rodrigues
This is a continuation of the nowait support which was incorporated a while back. We introduced REQ_NOWAIT which would return immediately if the call would block at the block layer. Request based-devices do not wait. However, bio based devices (the ones which exclusively call make_request_fn) need

Re: [PATCH 1/9] QUEUE_FLAG_NOWAIT to indicate device supports nowait

2017-08-10 Thread Goldwyn Rodrigues
On 08/09/2017 09:17 PM, Jens Axboe wrote: > On 08/09/2017 08:07 PM, Goldwyn Rodrigues wrote: >>>>>>>> No, from a multi-device point of view, this is inconsistent. I >>>>>>>> have tried the request bio returns -EAGAIN before the split,

Re: [PATCH 1/9] QUEUE_FLAG_NOWAIT to indicate device supports nowait

2017-08-10 Thread Goldwyn Rodrigues
On 08/09/2017 09:18 PM, Jens Axboe wrote: > On 08/08/2017 02:36 PM, Jens Axboe wrote: >> On 08/08/2017 02:32 PM, Shaohua Li wrote: diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 25f6a0cb27d3..fae021ebec1b 100644 --- a/include/linux/blkdev.h +++

Re: [PATCH 1/9] QUEUE_FLAG_NOWAIT to indicate device supports nowait

2017-08-09 Thread Goldwyn Rodrigues
On 08/09/2017 08:17 PM, Shaohua Li wrote: > On Wed, Aug 09, 2017 at 05:16:23PM -0500, Goldwyn Rodrigues wrote: >> >> >> On 08/09/2017 03:21 PM, Shaohua Li wrote: >>> On Wed, Aug 09, 2017 at 10:35:39AM -0500, Goldwyn Rodrigues wrote: >>>> >>

Re: [PATCH 1/9] QUEUE_FLAG_NOWAIT to indicate device supports nowait

2017-08-09 Thread Goldwyn Rodrigues
On 08/09/2017 03:21 PM, Shaohua Li wrote: > On Wed, Aug 09, 2017 at 10:35:39AM -0500, Goldwyn Rodrigues wrote: >> >> >> On 08/09/2017 10:02 AM, Shaohua Li wrote: >>> On Wed, Aug 09, 2017 at 06:44:55AM -0500, Goldwyn Rodrigues wrote: >>>> >>

Re: [PATCH 1/9] QUEUE_FLAG_NOWAIT to indicate device supports nowait

2017-08-09 Thread Goldwyn Rodrigues
On 08/09/2017 10:02 AM, Shaohua Li wrote: > On Wed, Aug 09, 2017 at 06:44:55AM -0500, Goldwyn Rodrigues wrote: >> >> >> On 08/08/2017 03:32 PM, Shaohua Li wrote: >>> On Wed, Jul 26, 2017 at 06:57:58PM -0500, Goldwyn Rodrigues wrote: >>>>

Re: [PATCH 4/9] md: raid5 nowait support

2017-08-09 Thread Goldwyn Rodrigues
On 08/08/2017 03:43 PM, Shaohua Li wrote: > On Wed, Jul 26, 2017 at 06:58:01PM -0500, Goldwyn Rodrigues wrote: >> From: Goldwyn Rodrigues <rgold...@suse.com> >> >> Return EAGAIN in case RAID5 would block because of waiting due to: >> + Reshaping >&g

Re: [PATCH 1/9] QUEUE_FLAG_NOWAIT to indicate device supports nowait

2017-08-09 Thread Goldwyn Rodrigues
On 08/08/2017 03:32 PM, Shaohua Li wrote: > On Wed, Jul 26, 2017 at 06:57:58PM -0500, Goldwyn Rodrigues wrote: >> From: Goldwyn Rodrigues <rgold...@suse.com> >> >> Nowait is a feature of direct AIO, where users can request >> to return immediately if the I/O i

Re: [PATCH 3/9] md: raid1 nowait support

2017-08-09 Thread Goldwyn Rodrigues
On 08/08/2017 03:39 PM, Shaohua Li wrote: > On Wed, Jul 26, 2017 at 06:58:00PM -0500, Goldwyn Rodrigues wrote: >> From: Goldwyn Rodrigues <rgold...@suse.com> >> >> The RAID1 driver would bail with EAGAIN in case of: >> + I/O has to wait for a barrier

[PATCH 5/9] md: raid10 nowait support

2017-07-26 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> Bail and status to EAGAIN if raid10 is going to wait for: + barriers + reshape operation + Too many queued requests Signed-off-by: Goldwyn Rodrigues <rgold...@suse.com> --- drivers/md/r

[PATCH 6/9] dm: add nowait support

2017-07-26 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> Add support for bio based dm devices, which exclusively sets a make_request_fn(). Request based devices are supported by default. Signed-off-by: Goldwyn Rodrigues <rgold...@suse.com> --- drivers/md/dm.c | 3 +++ 1 file changed, 3 inserti

[PATCH 8/9] dm: Add nowait support to dm-delay

2017-07-26 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> I/O should bail out if any value for delay is set. Signed-off-by: Goldwyn Rodrigues <rgold...@suse.com> --- drivers/md/dm-delay.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/md/dm-delay.c b/drivers/md/dm-delay.c index

[PATCH 7/9] dm: Add nowait support to raid1

2017-07-26 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> If the I/O would block because the devices are syncing, bail. Signed-off-by: Goldwyn Rodrigues <rgold...@suse.com> --- drivers/md/dm-raid1.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-r

[PATCH 1/9] QUEUE_FLAG_NOWAIT to indicate device supports nowait

2017-07-26 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> Nowait is a feature of direct AIO, where users can request to return immediately if the I/O is going to block. This translates to REQ_NOWAIT in bio.bi_opf flags. While request based devices don't wait, stacked devices such as md/dm will. In

[PATCH 9/9] dm-mpath: Add nowait support

2017-07-26 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> If there are no queues, bail if REQ_NOWAIT is set instead of queueing up I/O. Signed-off-by: Goldwyn Rodrigues <rgold...@suse.com> --- drivers/md/dm-mpath.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/md/dm-mpath.c b/d

[PATCH 0/9] Nowait feature for stacked block devices

2017-07-26 Thread Goldwyn Rodrigues
This is a continuation of the nowait support which was incorporated a while back. We introduced REQ_NOWAIT which would return immediately if the call would block at the block layer. Request based-devices do not wait. However, bio based devices (the ones which exclusively call make_request_fn) need

[PATCH 2/9] md: Add nowait support to md

2017-07-26 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> Set queue flags to QUEUE_FLAG_NOWAIT to indicate REQ_NOWAIT will be handled. If an I/O on the md will be delayed, it would bail by calling bio_wouldblock_error(). The conditions when this could happen are: + MD is suspended + There is a

[PATCH 3/9] md: raid1 nowait support

2017-07-26 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> The RAID1 driver would bail with EAGAIN in case of: + I/O has to wait for a barrier + array is frozen + Area is suspended + There are too many pending I/O that it will be queued. To facilitate error for wait barriers, wait_barrier() is ret

Re: Commit edf064e7c (btrfs: nowait aio support) breaks shells

2017-07-07 Thread Goldwyn Rodrigues
On 07/04/2017 05:16 PM, Jens Axboe wrote: > > Please expedite getting this upstream, asap. > Jens, I have posted an updated patch [1] and it is acked by David. Would you pick it up or should it go through the btrfs tree (or some other tree)? [1] https://patchwork.kernel.org/patch/9825813/

[PATCH v2] btrfs: Correct assignment of pos

2017-07-04 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> Assigning pos for usage early messes up in append mode, where the pos is re-assigned in generic_write_checks(). Assign pos later to get the correct position to write from iocb->ki_pos. Since check_can_nocow also uses the value of pos,

[PATCH] btrfs: Correct assignment of pos

2017-07-04 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> Assigning pos for usage early messes up in append mode, where the pos is re-assigned in generic_write_checks(). Re-assign pos to get the correct position to write from iocb->ki_pos. Fixes: edf064e7c6fe ("btrfs: nowait aio suppor

Re: Commit edf064e7c (btrfs: nowait aio support) breaks shells

2017-07-04 Thread Goldwyn Rodrigues
On 07/04/2017 02:45 AM, Markus Trippelsdorf wrote: > On 2017.07.04 at 06:23 +0200, Markus Trippelsdorf wrote: >> commit edf064e7c6fec3646b06c944a8e35d1a3de5c2c3 (HEAD, refs/bisect/bad) >> Author: Goldwyn Rodrigues <rgold...@suse.com> >> Date: Tue Jun 20 07:05:49

Re: [PATCH 3/3] fs: support RWF_NOWAIT for buffered reads

2017-07-03 Thread Goldwyn Rodrigues
On 06/30/2017 01:15 PM, Christoph Hellwig wrote: > This is based on the old idea and code from Milosz Tanski. With the > aio nowait code it becomes mostly trivial now. > > Signed-off-by: Christoph Hellwig > --- > fs/aio.c | 6 -- > fs/btrfs/file.c| 9

Re: [PATCH 3/3] fs: support RWF_NOWAIT for buffered reads

2017-06-30 Thread Goldwyn Rodrigues
On 06/30/2017 01:15 PM, Christoph Hellwig wrote: > This is based on the old idea and code from Milosz Tanski. With the > aio nowait code it becomes mostly trivial now. > Looks Good. Reviewed-by: Goldwyn Rodrigues <rgold...@suse.com> -- Goldwyn

Re: [PATCH 3/3] fs: support RWF_NOWAIT for buffered reads

2017-06-29 Thread Goldwyn Rodrigues
On 06/29/2017 04:25 PM, Christoph Hellwig wrote: > This is based on the old idea and code from Milosz Tanski. With the > aio nowait code it becomes mostly trivial now. > > Signed-off-by: Christoph Hellwig > --- > fs/aio.c | 6 -- > fs/btrfs/file.c| 2 +- >

[PATCH 10/10] btrfs: nowait aio support

2017-06-20 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> Return EAGAIN if any of the following checks fail + i_rwsem is not lockable + NODATACOW or PREALLOC is not set + Cannot nocow at the desired location + Writing beyond end of file which is not allocated Acked-by: David Sterba <dste...

[PATCH 03/10] fs: Use RWF_* flags for AIO operations

2017-06-20 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> aio_rw_flags is introduced in struct iocb (using aio_reserved1) which will carry the RWF_* flags. We cannot use aio_flags because they are not checked for validity which may break existing applications. Note, the only place RWF_HIPRI comes in

[PATCH 02/10] fs: Introduce filemap_range_has_page()

2017-06-20 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> filemap_range_has_page() return true if the file's mapping has a page within the range mentioned. This function will be used to check if a write() call will cause a writeback of previous writes. Reviewed-by: Christoph Hellwig <h...@lst.de&

[PATCH 04/10] fs: Introduce RWF_NOWAIT and FMODE_AIO_NOWAIT

2017-06-20 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> RWF_NOWAIT informs kernel to bail out if an AIO request will block for reasons such as file allocations, or a writeback triggered, or would block while allocating requests while performing direct I/O. RWF_NOWAIT is translated to IOCB_NOWAIT fo

[PATCH 07/10] block: return on congested block device

2017-06-20 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> A new bio operation flag REQ_NOWAIT is introduced to identify bio's orignating from iocb with IOCB_NOWAIT. This flag indicates to return immediately if a request cannot be made instead of retrying. Stacked devices such as md (th

[PATCH 09/10] xfs: nowait aio support

2017-06-20 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> If IOCB_NOWAIT is set, bail if the i_rwsem is not lockable immediately. IF IOMAP_NOWAIT is set, return EAGAIN in xfs_file_iomap_begin if it needs allocation either due to file extension, writing to a hole, or COW or waiting for other DIOs to

[PATCH 0/10 v14] merge request: No wait AIO

2017-06-20 Thread Goldwyn Rodrigues
Jens, As discussed, here are the patches against the block tree for merge since the block layer changes had the most conflicts. My tree is at https://github.com/goldwynr/linux/tree/nowait-block Changes since v13: + nowait support for dax files in ext4 and xfs -- Goldwyn

[PATCH 05/10] fs: return if direct I/O will trigger writeback

2017-06-20 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> Find out if the I/O will trigger a wait due to writeback. If yes, return -EAGAIN. Return -EINVAL for buffered AIO: there are multiple causes of delay such as page locks, dirty throttling logic, page loading from disk etc. which cannot be take

[PATCH 06/10] fs: Introduce IOMAP_NOWAIT

2017-06-20 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> IOCB_NOWAIT translates to IOMAP_NOWAIT for iomaps. This is used by XFS in the XFS patch. Reviewed-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Jan Kara <j...@suse.cz> Signed-off-by: Goldwyn Rodrigues <rgold...@suse

[PATCH 08/10] ext4: nowait aio support

2017-06-20 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> Return EAGAIN if any of the following checks fail for direct I/O: + i_rwsem is lockable + Writing beyond end of file (will trigger allocation) + Blocks are not allocated at the write location Signed-off-by: Goldwyn Rodrigues <rgold...

[PATCH 01/10] fs: Separate out kiocb flags setup based on RWF_* flags

2017-06-20 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> Also added RWF_SUPPORTED to encompass all flags. Reviewed-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Jan Kara <j...@suse.cz> Signed-off-by: Goldwyn Rodrigues <rgold...@suse.com> --- fs/read_write.c | 12 +++-

Re: [PATCH 0/10 v13] merge request: No wait AIO

2017-06-19 Thread Goldwyn Rodrigues
On 06/19/2017 06:15 PM, Jens Axboe wrote: > On 06/19/2017 10:33 AM, Goldwyn Rodrigues wrote: >> Jens, >> >> As Christoph suggested, I am sending the patches against the block >> tree for merge since the block layer changes had the most conflicts. >> My tree

[PATCH 08/10] ext4: nowait aio support

2017-06-19 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> Return EAGAIN if any of the following checks fail for direct I/O: + i_rwsem is lockable + Writing beyond end of file (will trigger allocation) + Blocks are not allocated at the write location Signed-off-by: Goldwyn Rodrigues <rgold...

[PATCH 09/10] xfs: nowait aio support

2017-06-19 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> If IOCB_NOWAIT is set, bail if the i_rwsem is not lockable immediately. IF IOMAP_NOWAIT is set, return EAGAIN in xfs_file_iomap_begin if it needs allocation either due to file extension, writing to a hole, or COW or waiting for other DIOs to

[PATCH 06/10] fs: Introduce IOMAP_NOWAIT

2017-06-19 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> IOCB_NOWAIT translates to IOMAP_NOWAIT for iomaps. This is used by XFS in the XFS patch. Reviewed-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Jan Kara <j...@suse.cz> Signed-off-by: Goldwyn Rodrigues <rgold...@suse

[PATCH 10/10] btrfs: nowait aio support

2017-06-19 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> Return EAGAIN if any of the following checks fail + i_rwsem is not lockable + NODATACOW or PREALLOC is not set + Cannot nocow at the desired location + Writing beyond end of file which is not allocated Acked-by: David Sterba <dste...

[PATCH 04/10] fs: Introduce RWF_NOWAIT and FMODE_AIO_NOWAIT

2017-06-19 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> RWF_NOWAIT informs kernel to bail out if an AIO request will block for reasons such as file allocations, or a writeback triggered, or would block while allocating requests while performing direct I/O. RWF_NOWAIT is translated to IOCB_NOWAIT fo

[PATCH 02/10] fs: Introduce filemap_range_has_page()

2017-06-19 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> filemap_range_has_page() return true if the file's mapping has a page within the range mentioned. This function will be used to check if a write() call will cause a writeback of previous writes. Reviewed-by: Christoph Hellwig <h...@lst.de&

[PATCH 07/10] block: return on congested block device

2017-06-19 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> A new bio operation flag REQ_NOWAIT is introduced to identify bio's orignating from iocb with IOCB_NOWAIT. This flag indicates to return immediately if a request cannot be made instead of retrying. Stacked devices such as md (th

[PATCH 03/10] fs: Use RWF_* flags for AIO operations

2017-06-19 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> aio_rw_flags is introduced in struct iocb (using aio_reserved1) which will carry the RWF_* flags. We cannot use aio_flags because they are not checked for validity which may break existing applications. Note, the only place RWF_HIPRI comes in

[PATCH 05/10] fs: return if direct I/O will trigger writeback

2017-06-19 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> Find out if the I/O will trigger a wait due to writeback. If yes, return -EAGAIN. Return -EINVAL for buffered AIO: there are multiple causes of delay such as page locks, dirty throttling logic, page loading from disk etc. which cannot be take

[PATCH 01/10] fs: Separate out kiocb flags setup based on RWF_* flags

2017-06-19 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> Also added RWF_SUPPORTED to encompass all flags. Reviewed-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Jan Kara <j...@suse.cz> Signed-off-by: Goldwyn Rodrigues <rgold...@suse.com> --- fs/read_write.c | 12 +++-

[PATCH 0/10 v13] merge request: No wait AIO

2017-06-19 Thread Goldwyn Rodrigues
Jens, As Christoph suggested, I am sending the patches against the block tree for merge since the block layer changes had the most conflicts. My tree is at https://github.com/goldwynr/linux/tree/nowait-block This series adds nonblocking feature to asynchronous I/O writes. io_submit() can be

Re: [PATCH 0/10 v12] No wait AIO

2017-06-15 Thread Goldwyn Rodrigues
On 06/15/2017 05:01 PM, Andrew Morton wrote: > On Thu, 15 Jun 2017 16:51:41 -0500 Goldwyn Rodrigues <rgold...@suse.de> wrote: > >>> I have only minor quibbles - I'll grab the patch series for some -next >>> testing (at least). >>> >> >> I agre

Re: [PATCH 0/10 v12] No wait AIO

2017-06-15 Thread Goldwyn Rodrigues
On 06/15/2017 01:25 PM, Andrew Morton wrote: > On Thu, 15 Jun 2017 10:59:52 -0500 Goldwyn Rodrigues <rgold...@suse.de> wrote: > >> This series adds nonblocking feature to asynchronous I/O writes. >> io_submit() can be delayed because of a number of reason: >>

[PATCH 06/10] fs: Introduce IOMAP_NOWAIT

2017-06-15 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> IOCB_NOWAIT translates to IOMAP_NOWAIT for iomaps. This is used by XFS in the XFS patch. Reviewed-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Jan Kara <j...@suse.cz> Signed-off-by: Goldwyn Rodrigues <rgold...@suse

[PATCH 10/10] btrfs: nowait aio support

2017-06-15 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> Return EAGAIN if any of the following checks fail + i_rwsem is not lockable + NODATACOW or PREALLOC is not set + Cannot nocow at the desired location + Writing beyond end of file which is not allocated Acked-by: David Sterba <dste...

[PATCH 08/10] ext4: nowait aio support

2017-06-15 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> Return EAGAIN if any of the following checks fail for direct I/O: + i_rwsem is lockable + Writing beyond end of file (will trigger allocation) + Blocks are not allocated at the write location Signed-off-by: Goldwyn Rodrigues <rgold...

[PATCH 07/10] block: return on congested block device

2017-06-15 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> A new bio operation flag REQ_NOWAIT is introduced to identify bio's orignating from iocb with IOCB_NOWAIT. This flag indicates to return immediately if a request cannot be made instead of retrying. Stacked devices such as md (th

[PATCH 09/10] xfs: nowait aio support

2017-06-15 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> If IOCB_NOWAIT is set, bail if the i_rwsem is not lockable immediately. IF IOMAP_NOWAIT is set, return EAGAIN in xfs_file_iomap_begin if it needs allocation either due to file extension, writing to a hole, or COW or waiting for other DIOs to

[PATCH 04/10] fs: Introduce RWF_NOWAIT and FMODE_AIO_NOWAIT

2017-06-15 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> RWF_NOWAIT informs kernel to bail out if an AIO request will block for reasons such as file allocations, or a writeback triggered, or would block while allocating requests while performing direct I/O. RWF_NOWAIT is translated to IOCB_NOWAIT fo

[PATCH 02/10] fs: Introduce filemap_range_has_page()

2017-06-15 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> filemap_range_has_page() return true if the file's mapping has a page within the range mentioned. This function will be used to check if a write() call will cause a writeback of previous writes. Reviewed-by: Christoph Hellwig <h...@lst.de&

[PATCH 03/10] fs: Use RWF_* flags for AIO operations

2017-06-15 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> aio_rw_flags is introduced in struct iocb (using aio_reserved1) which will carry the RWF_* flags. We cannot use aio_flags because they are not checked for validity which may break existing applications. Note, the only place RWF_HIPRI comes in

[PATCH 05/10] fs: return if direct write will trigger writeback

2017-06-15 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> Find out if the write will trigger a wait due to writeback. If yes, return -EAGAIN. Return -EINVAL for buffered AIO: there are multiple causes of delay such as page locks, dirty throttling logic, page loading from disk etc. which cannot be take

[PATCH 01/10] fs: Separate out kiocb flags setup based on RWF_* flags

2017-06-15 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> Reviewed-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Jan Kara <j...@suse.cz> Signed-off-by: Goldwyn Rodrigues <rgold...@suse.com> --- fs/read_write.c| 12 +++- include/linux/fs.h | 14 ++ 2 file

[PATCH 0/10 v12] No wait AIO

2017-06-15 Thread Goldwyn Rodrigues
This series adds nonblocking feature to asynchronous I/O writes. io_submit() can be delayed because of a number of reason: - Block allocation for files - Data writebacks for direct I/O - Sleeping because of waiting to acquire i_rwsem - Congested block device The goal of the patch series is to

Re: [PATCH 0/10 v11] No wait AIO

2017-06-12 Thread Goldwyn Rodrigues
On 06/10/2017 12:34 AM, Al Viro wrote: > On Thu, Jun 08, 2017 at 12:39:10AM -0700, Christoph Hellwig wrote: >> As already indicated this whole series looks fine to me. >> >> Al: are you going to pick this up? Or Andrew? > > The main issue here is "let's bail out from ->write_iter() instances"

[PATCH 02/10] fs: Introduce filemap_range_has_page()

2017-06-06 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> filemap_range_has_page() return true if the file's mapping has a page within the range mentioned. This function will be used to check if a write() call will cause a writeback of previous writes. Reviewed-by: Christoph Hellwig <h...@lst.de&

[PATCH 05/10] fs: return if direct write will trigger writeback

2017-06-06 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> Find out if the write will trigger a wait due to writeback. If yes, return -EAGAIN. Return -EINVAL for buffered AIO: there are multiple causes of delay such as page locks, dirty throttling logic, page loading from disk etc. which cannot be take

[PATCH 07/10] block: return on congested block device

2017-06-06 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> A new bio operation flag REQ_NOWAIT is introduced to identify bio's orignating from iocb with IOCB_NOWAIT. This flag indicates to return immediately if a request cannot be made instead of retrying. Stacked devices such as md (th

[PATCH 06/10] fs: Introduce IOMAP_NOWAIT

2017-06-06 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> IOCB_NOWAIT translates to IOMAP_NOWAIT for iomaps. This is used by XFS in the XFS patch. Reviewed-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Jan Kara <j...@suse.cz> Signed-off-by: Goldwyn Rodrigues <rgold...@suse

[PATCH 09/10] xfs: nowait aio support

2017-06-06 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> If IOCB_NOWAIT is set, bail if the i_rwsem is not lockable immediately. IF IOMAP_NOWAIT is set, return EAGAIN in xfs_file_iomap_begin if it needs allocation either due to file extension, writing to a hole, or COW or waiting for other DIOs to

[PATCH 01/10] fs: Separate out kiocb flags setup based on RWF_* flags

2017-06-06 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> Reviewed-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Jan Kara <j...@suse.cz> Signed-off-by: Goldwyn Rodrigues <rgold...@suse.com> --- fs/read_write.c| 12 +++- include/linux/fs.h | 14 ++ 2 file

[PATCH 10/10] btrfs: nowait aio support

2017-06-06 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> Return EAGAIN if any of the following checks fail + i_rwsem is not lockable + NODATACOW or PREALLOC is not set + Cannot nocow at the desired location + Writing beyond end of file which is not allocated Acked-by: David Sterba <dste...

[PATCH 01/10] fs: Separate out kiocb flags setup based on RWF_* flags

2017-06-04 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues <rgold...@suse.com> Reviewed-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Jan Kara <j...@suse.cz> Signed-off-by: Goldwyn Rodrigues <rgold...@suse.com> --- fs/read_write.c| 12 +++- include/linux/fs.h | 14 ++ 2 file

[PATCH 0/10 v10] No wait AIO

2017-06-04 Thread Goldwyn Rodrigues
Formerly known as non-blocking AIO. This series adds nonblocking feature to asynchronous I/O writes. io_submit() can be delayed because of a number of reason: - Block allocation for files - Data writebacks for direct I/O - Sleeping because of waiting to acquire i_rwsem - Congested block

  1   2   >