Re: [PATCH] xfs: allocate sector sized IO buffer via page_frag_alloc

2019-02-26 Thread Vlastimil Babka
On 2/26/19 5:19 PM, Matthew Wilcox wrote: > On Tue, Feb 26, 2019 at 08:14:33AM -0800, Darrick J. Wong wrote: >> On Tue, Feb 26, 2019 at 06:04:40AM -0800, Matthew Wilcox wrote: >> Wait a minute, are you all saying that /directio/ is broken on XFS too?? >> XFS doesn't use blockdev_direct_IO anymore.

[PATCH] block: add a new flag BLK_MQ_POLL_HYBRID_INVALID for hybrid poll

2019-02-26 Thread Yufen Yu
For q->poll_nsec == -1, means using classic poll, not hybrid poll. We introduce a new flag BLK_POLL_DELAY_INVALID to replace -1, which may make code much easier to read. Signed-off-by: Yufen Yu --- block/blk-mq.c | 4 ++-- block/blk-sysfs.c | 4 ++-- include/linux/blkdev.h | 3 +++

[PATCH v3] scsi: sd: block: Fix regressions in read-only block device handling

2019-02-26 Thread Martin K. Petersen
Some devices come online in write protected state and switch to read-write once they are ready to process I/O requests. These devices broke with commit 20bd1d026aac ("scsi: sd: Keep disk read-only when re-reading partition") because we had no way to distinguish between a user decision to set a bloc

Re: [PATCH 11/19] block: implement bio helper to add iter bvec pages to bio

2019-02-26 Thread Jens Axboe
On 2/26/19 9:05 PM, Jens Axboe wrote: > On 2/26/19 8:44 PM, Ming Lei wrote: >> On Tue, Feb 26, 2019 at 08:37:05PM -0700, Jens Axboe wrote: >>> On 2/26/19 8:09 PM, Ming Lei wrote: On Tue, Feb 26, 2019 at 07:43:32PM -0700, Jens Axboe wrote: > On 2/26/19 7:37 PM, Ming Lei wrote: >> On Tue

Re: [PATCH 11/19] block: implement bio helper to add iter bvec pages to bio

2019-02-26 Thread Jens Axboe
On 2/26/19 8:44 PM, Ming Lei wrote: > On Tue, Feb 26, 2019 at 08:37:05PM -0700, Jens Axboe wrote: >> On 2/26/19 8:09 PM, Ming Lei wrote: >>> On Tue, Feb 26, 2019 at 07:43:32PM -0700, Jens Axboe wrote: On 2/26/19 7:37 PM, Ming Lei wrote: > On Tue, Feb 26, 2019 at 07:28:54PM -0700, Jens Axbo

Re: [PATCH 11/19] block: implement bio helper to add iter bvec pages to bio

2019-02-26 Thread Ming Lei
On Tue, Feb 26, 2019 at 08:37:05PM -0700, Jens Axboe wrote: > On 2/26/19 8:09 PM, Ming Lei wrote: > > On Tue, Feb 26, 2019 at 07:43:32PM -0700, Jens Axboe wrote: > >> On 2/26/19 7:37 PM, Ming Lei wrote: > >>> On Tue, Feb 26, 2019 at 07:28:54PM -0700, Jens Axboe wrote: > On 2/26/19 7:21 PM, Min

Re: [PATCH 11/19] block: implement bio helper to add iter bvec pages to bio

2019-02-26 Thread Jens Axboe
On 2/26/19 8:37 PM, Jens Axboe wrote: > On 2/26/19 8:09 PM, Ming Lei wrote: >> On Tue, Feb 26, 2019 at 07:43:32PM -0700, Jens Axboe wrote: >>> On 2/26/19 7:37 PM, Ming Lei wrote: On Tue, Feb 26, 2019 at 07:28:54PM -0700, Jens Axboe wrote: > On 2/26/19 7:21 PM, Ming Lei wrote: >> On Tue

Re: [PATCH] xfs: allocate sector sized IO buffer via page_frag_alloc

2019-02-26 Thread Dave Chinner
On Wed, Feb 27, 2019 at 09:50:55AM +0800, Ming Lei wrote: > On Wed, Feb 27, 2019 at 07:45:50AM +1100, Dave Chinner wrote: > > On Tue, Feb 26, 2019 at 05:33:04PM +0800, Ming Lei wrote: > > > On Tue, Feb 26, 2019 at 03:58:26PM +1100, Dave Chinner wrote: > > > > On Mon, Feb 25, 2019 at 07:27:37PM -080

Re: [PATCH 11/19] block: implement bio helper to add iter bvec pages to bio

2019-02-26 Thread Jens Axboe
On 2/26/19 8:09 PM, Ming Lei wrote: > On Tue, Feb 26, 2019 at 07:43:32PM -0700, Jens Axboe wrote: >> On 2/26/19 7:37 PM, Ming Lei wrote: >>> On Tue, Feb 26, 2019 at 07:28:54PM -0700, Jens Axboe wrote: On 2/26/19 7:21 PM, Ming Lei wrote: > On Tue, Feb 26, 2019 at 06:57:16PM -0700, Jens Axbo

Re: [PATCH 11/19] block: implement bio helper to add iter bvec pages to bio

2019-02-26 Thread Ming Lei
On Tue, Feb 26, 2019 at 07:43:32PM -0700, Jens Axboe wrote: > On 2/26/19 7:37 PM, Ming Lei wrote: > > On Tue, Feb 26, 2019 at 07:28:54PM -0700, Jens Axboe wrote: > >> On 2/26/19 7:21 PM, Ming Lei wrote: > >>> On Tue, Feb 26, 2019 at 06:57:16PM -0700, Jens Axboe wrote: > On 2/26/19 6:53 PM, Min

Re: [PATCH 11/19] block: implement bio helper to add iter bvec pages to bio

2019-02-26 Thread Jens Axboe
On 2/26/19 7:37 PM, Ming Lei wrote: > On Tue, Feb 26, 2019 at 07:28:54PM -0700, Jens Axboe wrote: >> On 2/26/19 7:21 PM, Ming Lei wrote: >>> On Tue, Feb 26, 2019 at 06:57:16PM -0700, Jens Axboe wrote: On 2/26/19 6:53 PM, Ming Lei wrote: > On Tue, Feb 26, 2019 at 06:47:54PM -0700, Jens Axbo

Re: [PATCH 11/19] block: implement bio helper to add iter bvec pages to bio

2019-02-26 Thread Ming Lei
On Tue, Feb 26, 2019 at 07:28:54PM -0700, Jens Axboe wrote: > On 2/26/19 7:21 PM, Ming Lei wrote: > > On Tue, Feb 26, 2019 at 06:57:16PM -0700, Jens Axboe wrote: > >> On 2/26/19 6:53 PM, Ming Lei wrote: > >>> On Tue, Feb 26, 2019 at 06:47:54PM -0700, Jens Axboe wrote: > On 2/26/19 6:21 PM, Min

Re: [PATCH 11/19] block: implement bio helper to add iter bvec pages to bio

2019-02-26 Thread Jens Axboe
On 2/26/19 7:21 PM, Ming Lei wrote: > On Tue, Feb 26, 2019 at 06:57:16PM -0700, Jens Axboe wrote: >> On 2/26/19 6:53 PM, Ming Lei wrote: >>> On Tue, Feb 26, 2019 at 06:47:54PM -0700, Jens Axboe wrote: On 2/26/19 6:21 PM, Ming Lei wrote: > On Tue, Feb 26, 2019 at 11:56 PM Jens Axboe wrote:

Re: [PATCH 11/19] block: implement bio helper to add iter bvec pages to bio

2019-02-26 Thread Ming Lei
On Tue, Feb 26, 2019 at 06:57:16PM -0700, Jens Axboe wrote: > On 2/26/19 6:53 PM, Ming Lei wrote: > > On Tue, Feb 26, 2019 at 06:47:54PM -0700, Jens Axboe wrote: > >> On 2/26/19 6:21 PM, Ming Lei wrote: > >>> On Tue, Feb 26, 2019 at 11:56 PM Jens Axboe wrote: > > On 2/25/19 9:34 PM, Jens

Re: [PATCH 11/19] block: implement bio helper to add iter bvec pages to bio

2019-02-26 Thread Jens Axboe
On 2/26/19 6:53 PM, Ming Lei wrote: > On Tue, Feb 26, 2019 at 06:47:54PM -0700, Jens Axboe wrote: >> On 2/26/19 6:21 PM, Ming Lei wrote: >>> On Tue, Feb 26, 2019 at 11:56 PM Jens Axboe wrote: On 2/25/19 9:34 PM, Jens Axboe wrote: > On 2/25/19 8:46 PM, Eric Biggers wrote: >> Hi Je

Re: [PATCH 11/19] block: implement bio helper to add iter bvec pages to bio

2019-02-26 Thread Ming Lei
On Tue, Feb 26, 2019 at 06:47:54PM -0700, Jens Axboe wrote: > On 2/26/19 6:21 PM, Ming Lei wrote: > > On Tue, Feb 26, 2019 at 11:56 PM Jens Axboe wrote: > >> > >> On 2/25/19 9:34 PM, Jens Axboe wrote: > >>> On 2/25/19 8:46 PM, Eric Biggers wrote: > Hi Jens, > > On Thu, Feb 21, 2019

Re: [PATCH] xfs: allocate sector sized IO buffer via page_frag_alloc

2019-02-26 Thread Ming Lei
On Wed, Feb 27, 2019 at 07:45:50AM +1100, Dave Chinner wrote: > On Tue, Feb 26, 2019 at 05:33:04PM +0800, Ming Lei wrote: > > On Tue, Feb 26, 2019 at 03:58:26PM +1100, Dave Chinner wrote: > > > On Mon, Feb 25, 2019 at 07:27:37PM -0800, Matthew Wilcox wrote: > > > > On Tue, Feb 26, 2019 at 02:02:14P

Re: [PATCH 11/19] block: implement bio helper to add iter bvec pages to bio

2019-02-26 Thread Jens Axboe
On 2/26/19 6:21 PM, Ming Lei wrote: > On Tue, Feb 26, 2019 at 11:56 PM Jens Axboe wrote: >> >> On 2/25/19 9:34 PM, Jens Axboe wrote: >>> On 2/25/19 8:46 PM, Eric Biggers wrote: Hi Jens, On Thu, Feb 21, 2019 at 10:45:27AM -0700, Jens Axboe wrote: > On 2/20/19 3:58 PM, Ming Lei wr

Re: [PATCH] xfs: allocate sector sized IO buffer via page_frag_alloc

2019-02-26 Thread Ming Lei
On Tue, Feb 26, 2019 at 08:19:12AM -0800, Matthew Wilcox wrote: > On Tue, Feb 26, 2019 at 08:14:33AM -0800, Darrick J. Wong wrote: > > On Tue, Feb 26, 2019 at 06:04:40AM -0800, Matthew Wilcox wrote: > > > On Tue, Feb 26, 2019 at 09:42:48PM +0800, Ming Lei wrote: > > > > On Tue, Feb 26, 2019 at 05:0

Re: [PATCH 11/19] block: implement bio helper to add iter bvec pages to bio

2019-02-26 Thread Ming Lei
On Tue, Feb 26, 2019 at 11:56 PM Jens Axboe wrote: > > On 2/25/19 9:34 PM, Jens Axboe wrote: > > On 2/25/19 8:46 PM, Eric Biggers wrote: > >> Hi Jens, > >> > >> On Thu, Feb 21, 2019 at 10:45:27AM -0700, Jens Axboe wrote: > >>> On 2/20/19 3:58 PM, Ming Lei wrote: > On Mon, Feb 11, 2019 at 12:0

Regression caused by loopback related patches in 4.14.95

2019-02-26 Thread Thomas Lindroth
When I run "losetup --verbose --partscan --read-only --find /mnt/gemini.61rn.3T/Backups/debian.raw" on a 4.14.103 system losetup hangs for exactly 3 minutes. After the hang the loopback device works like it should. The /mnt/gemini.61rn.3T mount is an ext4 fs on dm-crypt on a spinning sata disk.

Re: [PATCH] xfs: allocate sector sized IO buffer via page_frag_alloc

2019-02-26 Thread Dave Chinner
On Tue, Feb 26, 2019 at 05:33:04PM +0800, Ming Lei wrote: > On Tue, Feb 26, 2019 at 03:58:26PM +1100, Dave Chinner wrote: > > On Mon, Feb 25, 2019 at 07:27:37PM -0800, Matthew Wilcox wrote: > > > On Tue, Feb 26, 2019 at 02:02:14PM +1100, Dave Chinner wrote: > > > > > Or what is the exact size of su

Re: [Drbd-dev] [PATCH] block: Mark expected switch fall-throughs

2019-02-26 Thread Gustavo A. R. Silva
On 1/29/19 3:42 AM, Roland Kammerer wrote: > On Wed, Jan 23, 2019 at 12:45:01AM -0600, Gustavo A. R. Silva wrote: >> In preparation to enabling -Wimplicit-fallthrough, mark switch cases >> where we are expecting to fall through. >> >> Warning level 3 was used: -Wimplicit-fallthrough=3 >> >> This

Re: [PATCH v2 1/2] loop: Report EOPNOTSUPP properly

2019-02-26 Thread Evan Green
On Wed, Feb 13, 2019 at 6:32 PM Martin K. Petersen wrote: > > > Evan, > > > Properly plumb out EOPNOTSUPP from loop driver operations, which may > > get returned when for instance a discard operation is attempted but > > not supported by the underlying block device. Before this change, > > everyth

Re: [PATCH v2 2/2] loop: Better discard support for block devices

2019-02-26 Thread Evan Green
On Thu, Feb 14, 2019 at 10:00 AM Evan Green wrote: > > On Wed, Feb 13, 2019 at 6:40 PM Martin K. Petersen > wrote: > > > > > > Evan, > > > > > If the backing device for a loop device is a block device, then mirror > > > the discard properties of the underlying block device into the loop > > > dev

Re: [PATCH] xfs: allocate sector sized IO buffer via page_frag_alloc

2019-02-26 Thread Matthew Wilcox
On Tue, Feb 26, 2019 at 08:14:33AM -0800, Darrick J. Wong wrote: > On Tue, Feb 26, 2019 at 06:04:40AM -0800, Matthew Wilcox wrote: > > On Tue, Feb 26, 2019 at 09:42:48PM +0800, Ming Lei wrote: > > > On Tue, Feb 26, 2019 at 05:02:30AM -0800, Matthew Wilcox wrote: > > > > Wait, we're imposing a ridic

Re: [PATCH] xfs: allocate sector sized IO buffer via page_frag_alloc

2019-02-26 Thread Darrick J. Wong
On Tue, Feb 26, 2019 at 06:04:40AM -0800, Matthew Wilcox wrote: > On Tue, Feb 26, 2019 at 09:42:48PM +0800, Ming Lei wrote: > > On Tue, Feb 26, 2019 at 05:02:30AM -0800, Matthew Wilcox wrote: > > > Wait, we're imposing a ridiculous amount of complexity on XFS for no > > > reason at all? We should

Re: [PATCH 11/19] block: implement bio helper to add iter bvec pages to bio

2019-02-26 Thread Jens Axboe
On 2/25/19 9:34 PM, Jens Axboe wrote: > On 2/25/19 8:46 PM, Eric Biggers wrote: >> Hi Jens, >> >> On Thu, Feb 21, 2019 at 10:45:27AM -0700, Jens Axboe wrote: >>> On 2/20/19 3:58 PM, Ming Lei wrote: On Mon, Feb 11, 2019 at 12:00:41PM -0700, Jens Axboe wrote: > For an ITER_BVEC, we can just

Re: [PATCH] xfs: allocate sector sized IO buffer via page_frag_alloc

2019-02-26 Thread Christopher Lameter
On Tue, 26 Feb 2019, Ming Lei wrote: > Then something like the following patch should work for all fs, could > anyone comment on this approach? Note that various subsystems have similar implementations. Have a look at drivers/dma/dmaengine.c struct dmaengine_unmap_pool { struct kmem_cac

Re: [PATCH] xfs: allocate sector sized IO buffer via page_frag_alloc

2019-02-26 Thread Christopher Lameter
On Mon, 25 Feb 2019, Vlastimil Babka wrote: > What about kmem_cache_create() with align parameter? That *should* be > guaranteed regardless of whatever debugging is enabled - if not, I would > consider it a bug. It definitely guarantees that. What would be the point of the alignment parameter oth

Re: [PATCH] xfs: allocate sector sized IO buffer via page_frag_alloc

2019-02-26 Thread Matthew Wilcox
On Tue, Feb 26, 2019 at 09:42:48PM +0800, Ming Lei wrote: > On Tue, Feb 26, 2019 at 05:02:30AM -0800, Matthew Wilcox wrote: > > Wait, we're imposing a ridiculous amount of complexity on XFS for no > > reason at all? We should just change this to 512-byte alignment. Tying > > it to the blocksize o

Re: [PATCH] xfs: allocate sector sized IO buffer via page_frag_alloc

2019-02-26 Thread Ming Lei
On Tue, Feb 26, 2019 at 05:02:30AM -0800, Matthew Wilcox wrote: > On Tue, Feb 26, 2019 at 08:35:46PM +0800, Ming Lei wrote: > > On Tue, Feb 26, 2019 at 04:12:09AM -0800, Matthew Wilcox wrote: > > > On Tue, Feb 26, 2019 at 07:12:49PM +0800, Ming Lei wrote: > > > > The buffer needs to be device block

Re: [PATCH] xfs: allocate sector sized IO buffer via page_frag_alloc

2019-02-26 Thread Matthew Wilcox
On Tue, Feb 26, 2019 at 08:35:46PM +0800, Ming Lei wrote: > On Tue, Feb 26, 2019 at 04:12:09AM -0800, Matthew Wilcox wrote: > > On Tue, Feb 26, 2019 at 07:12:49PM +0800, Ming Lei wrote: > > > The buffer needs to be device block size aligned for dio, and now the > > > block > > > size can be 512, 1

Re: [PATCH] xfs: allocate sector sized IO buffer via page_frag_alloc

2019-02-26 Thread Ming Lei
On Tue, Feb 26, 2019 at 04:12:09AM -0800, Matthew Wilcox wrote: > On Tue, Feb 26, 2019 at 07:12:49PM +0800, Ming Lei wrote: > > On Tue, Feb 26, 2019 at 6:07 PM Vlastimil Babka wrote: > > > On 2/26/19 10:33 AM, Ming Lei wrote: > > > > On Tue, Feb 26, 2019 at 03:58:26PM +1100, Dave Chinner wrote: >

Re: [PATCH] xfs: allocate sector sized IO buffer via page_frag_alloc

2019-02-26 Thread Matthew Wilcox
On Tue, Feb 26, 2019 at 07:12:49PM +0800, Ming Lei wrote: > On Tue, Feb 26, 2019 at 6:07 PM Vlastimil Babka wrote: > > On 2/26/19 10:33 AM, Ming Lei wrote: > > > On Tue, Feb 26, 2019 at 03:58:26PM +1100, Dave Chinner wrote: > > >> On Mon, Feb 25, 2019 at 07:27:37PM -0800, Matthew Wilcox wrote: > >

Re: [PATCH] xfs: allocate sector sized IO buffer via page_frag_alloc

2019-02-26 Thread Ming Lei
On Tue, Feb 26, 2019 at 6:07 PM Vlastimil Babka wrote: > > On 2/26/19 10:33 AM, Ming Lei wrote: > > On Tue, Feb 26, 2019 at 03:58:26PM +1100, Dave Chinner wrote: > >> On Mon, Feb 25, 2019 at 07:27:37PM -0800, Matthew Wilcox wrote: > >>> On Tue, Feb 26, 2019 at 02:02:14PM +1100, Dave Chinner wrote:

Re: [PATCH V2] fs: fix guard_bio_eod to check for real EOD errors

2019-02-26 Thread Ming Lei
On Tue, Feb 26, 2019 at 6:52 PM Carlos Maiolino wrote: > > guard_bio_eod() can truncate a segment in bio to allow it to do IO on > odd last sectors of a device. > > It already checks if the IO starts past EOD, but it does not consider > the possibility of an IO request starting within device bound

[PATCH V2] fs: fix guard_bio_eod to check for real EOD errors

2019-02-26 Thread Carlos Maiolino
guard_bio_eod() can truncate a segment in bio to allow it to do IO on odd last sectors of a device. It already checks if the IO starts past EOD, but it does not consider the possibility of an IO request starting within device boundaries can contain more than one segment past EOD. In such cases, t

Re: [PATCH] xfs: allocate sector sized IO buffer via page_frag_alloc

2019-02-26 Thread Vlastimil Babka
On 2/26/19 10:33 AM, Ming Lei wrote: > On Tue, Feb 26, 2019 at 03:58:26PM +1100, Dave Chinner wrote: >> On Mon, Feb 25, 2019 at 07:27:37PM -0800, Matthew Wilcox wrote: >>> On Tue, Feb 26, 2019 at 02:02:14PM +1100, Dave Chinner wrote: > Or what is the exact size of sub-page IO in xfs most of tim

Re: [PATCH] fs: fix guard_bio_eod to check for real EOD errors

2019-02-26 Thread Carlos Maiolino
On Tue, Feb 26, 2019 at 10:03:04AM +0800, Ming Lei wrote: > On Mon, Feb 25, 2019 at 9:26 PM Carlos Maiolino wrote: > > > > Hi, > > > > On Sat, Feb 23, 2019 at 07:33:21AM +0800, Ming Lei wrote: > > > Hi Carlos, > > > > > > Cc block list given it is related with interface between fs and block > > >

Re: [PATCH] xfs: allocate sector sized IO buffer via page_frag_alloc

2019-02-26 Thread Ming Lei
On Tue, Feb 26, 2019 at 03:58:26PM +1100, Dave Chinner wrote: > On Mon, Feb 25, 2019 at 07:27:37PM -0800, Matthew Wilcox wrote: > > On Tue, Feb 26, 2019 at 02:02:14PM +1100, Dave Chinner wrote: > > > > Or what is the exact size of sub-page IO in xfs most of time? For > > > > > > Determined by mkfs