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

2017-05-11 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues 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 taken care

[PATCH 04/10] fs: Introduce RWF_NOWAIT

2017-05-11 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues 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 for

[PATCH 08/10] ext4: nowait aio support

2017-05-11 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues 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

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

2017-05-11 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues 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. Signed-off-by: Goldwyn Rodrigues

[PATCH 10/10] btrfs: nowait aio support

2017-05-11 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues 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 Signed-off-by: Goldwyn Rodrigues

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

2017-05-11 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues 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 effect is

[PATCH 09/10] xfs: nowait aio support

2017-05-11 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues 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 finish.

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

2017-05-11 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues Signed-off-by: Goldwyn Rodrigues Reviewed-by: Christoph Hellwig --- fs/read_write.c| 12 +++- include/linux/fs.h | 14 ++ 2 files changed, 17 insertions(+), 9 deletions(-) diff --git

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

2017-05-11 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues 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 (the ones with

[PATCH 06/10] fs: Introduce IOMAP_NOWAIT

2017-05-11 Thread Goldwyn Rodrigues
From: Goldwyn Rodrigues IOCB_NOWAIT translates to IOMAP_NOWAIT for iomaps. This is used by XFS in the XFS patch. Signed-off-by: Goldwyn Rodrigues Reviewed-by: Christoph Hellwig --- fs/iomap.c| 2 ++ include/linux/iomap.h | 1 + 2

[PATCH 0/10 v8] No wait AIO

2017-05-11 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

Re: [PATCH 5/8] nowait aio: return on congested block device

2017-05-11 Thread Goldwyn Rodrigues
On 05/11/2017 02:44 AM, Christoph Hellwig wrote: > Looks fine, > > Reviewed-by: Christoph Hellwig > > Although lifting the make_request limit is something a lot of users > would appreciate in the near future.. > Yes, I understand. That will be on my todo list next on priority.

[GIT PULL] Block fixes for 4-12-rc1

2017-05-11 Thread Jens Axboe
Hi Linus, A smaller collection of fixes that should go into -rc1. This pull request contains: - A fix from Christoph, fixing a regression with the WRITE_SAME and partial completions. Caused a BUG() on ppc. - Fixup for __blk_mq_stop_hw_queues(), it should be static. From Colin. - Removal of

Re: [PATCH] block: handle partial completions for special payload requests

2017-05-11 Thread Jens Axboe
On 05/11/2017 04:34 AM, Christoph Hellwig wrote: > SCSI devices can return short writes on Write Same just like for normal > writes, so we need to handle this case for our special payload requests > as well. Added for 4.12-rc1, thanks Christoph. -- Jens Axboe

Kyber scheduler brings system to halt when used on swap partition

2017-05-11 Thread Markus Trippelsdorf
Using the new Kyber mq scheduler brings my system to a halt as soon as it starts swapping. The swap partition resides on an SSD and is the only partition in use on that drive. Symptoms are stuttering sound and non moving mouse pointer. After a while the monitor switches off, because it gets no

[RFC PATCH 2/3] mmc: core: Remove redundant abort-able claim host API

2017-05-11 Thread Ulf Hansson
The only user of the abort-able claim host API was the SDIO IRQ thread, but as that use has now been removed, let's simplify the code and remove the API. Signed-off-by: Ulf Hansson --- drivers/mmc/core/core.c | 31 ++- drivers/mmc/core/core.h

[RFC PATCH 3/3] mmc: core: Allow mmc block device to re-claim the host

2017-05-11 Thread Ulf Hansson
The current mmc block device implementation is tricky when it comes to claim and release of the host, while processing I/O requests. In principle we need to claim the host at the first request entering the queue and then we need to release the host, as soon as the queue becomes empty. This

[RFC PATCH 1/3] mmc: sdio: Don't use abort-able claim host method from SDIO IRQ thread

2017-05-11 Thread Ulf Hansson
In a step to simplify the use of the lock, mmc_claim|release_host(), let's change the SDIO IRQ thread to move away from using the abort-able claim host method. In the SDIO IRQ thread case, we can instead check the numbers of SDIO IRQs that are currently claimed via host->sdio_irqs, as this field

[RFC PATCH 0/3] mmc: core: Prepare mmc host locking for blk-mq

2017-05-11 Thread Ulf Hansson
The current APIs, mmc_claim|release_host() doesn't play well when the mmc block device driver tries to convert to blk-mq. In principle we need a re-claiming possibility of the host from the mmc block device driver, and to know when to release the host, need to keep track of a reference count

[PATCH] block: handle partial completions for special payload requests

2017-05-11 Thread Christoph Hellwig
SCSI devices can return short writes on Write Same just like for normal writes, so we need to handle this case for our special payload requests as well. Signed-off-by: Christoph Hellwig Reported-by: Abdul Haleem Tested-by: Abdul Haleem

Re: [PATCH 7/9] Guard bvec iteration logic

2017-05-11 Thread Ming Lei
On Wed, May 10, 2017 at 07:20:50PM +0400, Dmitry Monakhov wrote: > Currently if some one try to advance bvec beyond it's size we simply > dump WARN_ONCE and continue to iterate beyond bvec array boundaries. > This simply means that we endup dereferencing/corrupting random memory > region. > >

Re: [PATCH 5/8] nowait aio: return on congested block device

2017-05-11 Thread Christoph Hellwig
Looks fine, Reviewed-by: Christoph Hellwig Although lifting the make_request limit is something a lot of users would appreciate in the near future..

Re: [PATCH 2/8] nowait aio: Introduce RWF_NOWAIT

2017-05-11 Thread Christoph Hellwig
On Tue, May 09, 2017 at 07:22:13AM -0500, Goldwyn Rodrigues wrote: > From: Goldwyn Rodrigues > > This flag 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

Re: [PATCH 3/8] nowait aio: return if direct write will trigger writeback

2017-05-11 Thread Christoph Hellwig
It might make sense to move filemap_range_has_page into a separate prep patch. Otherwise this looks fine: Reviewed-by: Christoph Hellwig

Re: [PATCH 1/8] Use RWF_* flags for AIO operations

2017-05-11 Thread Christoph Hellwig
Please add subsystem prefixes to your subject lines, e.g. fs: for all the generic fs ones, xfs: for XFS, block: for block layer changes, etc. > > - if (flags & ~(RWF_HIPRI | RWF_DSYNC | RWF_SYNC)) > - return -EOPNOTSUPP; > - > init_sync_kiocb(, filp); > - if

Re: [PATCH 7/9] Guard bvec iteration logic

2017-05-11 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig