Re: [PATCH] iomap: Fix the write_count in iomap_add_to_ioend().

2020-09-17 Thread Darrick J. Wong
On Thu, Sep 17, 2020 at 03:48:04PM +0100, Christoph Hellwig wrote: > On Thu, Sep 17, 2020 at 06:42:19AM -0400, Brian Foster wrote: > > That wouldn't address the latency concern Dave brought up. That said, I > > have no issue with this as a targeted solution for the softlockup issue. > >

Re: [PATCH] iomap: Fix the write_count in iomap_add_to_ioend().

2020-09-17 Thread Ming Lei
On Thu, Sep 17, 2020 at 09:04:55AM +0100, Christoph Hellwig wrote: > On Wed, Sep 16, 2020 at 09:07:14AM -0400, Brian Foster wrote: > > Dave described the main purpose earlier in this thread [1]. The initial > > motivation is that we've had downstream reports of soft lockup problems > > in

Re: [PATCH] iomap: Fix the write_count in iomap_add_to_ioend().

2020-09-17 Thread Christoph Hellwig
On Thu, Sep 17, 2020 at 06:42:19AM -0400, Brian Foster wrote: > That wouldn't address the latency concern Dave brought up. That said, I > have no issue with this as a targeted solution for the softlockup issue. > iomap_finish_ioend[s]() is common code for both the workqueue and > ->bi_end_io()

Re: [PATCH] iomap: Fix the write_count in iomap_add_to_ioend().

2020-09-17 Thread Brian Foster
On Thu, Sep 17, 2020 at 09:04:55AM +0100, Christoph Hellwig wrote: > On Wed, Sep 16, 2020 at 09:07:14AM -0400, Brian Foster wrote: > > Dave described the main purpose earlier in this thread [1]. The initial > > motivation is that we've had downstream reports of soft lockup problems > > in

Re: [PATCH] iomap: Fix the write_count in iomap_add_to_ioend().

2020-09-17 Thread Christoph Hellwig
On Wed, Sep 16, 2020 at 09:07:14AM -0400, Brian Foster wrote: > Dave described the main purpose earlier in this thread [1]. The initial > motivation is that we've had downstream reports of soft lockup problems > in writeback bio completion down in the bio -> bvec loop of > iomap_finish_ioend()

Re: [PATCH] iomap: Fix the write_count in iomap_add_to_ioend().

2020-09-16 Thread Brian Foster
On Wed, Sep 16, 2020 at 09:45:10AM +0100, Christoph Hellwig wrote: > On Tue, Sep 15, 2020 at 05:12:42PM -0700, Darrick J. Wong wrote: > > On Tue, Aug 25, 2020 at 10:49:17AM -0400, Brian Foster wrote: > > > cc Ming > > > > > > On Tue, Aug 25, 2020 at 10:42:03AM +1000, Dave Chinner wrote: > > > >

Re: [PATCH] iomap: Fix the write_count in iomap_add_to_ioend().

2020-09-16 Thread Christoph Hellwig
On Tue, Sep 15, 2020 at 05:12:42PM -0700, Darrick J. Wong wrote: > On Tue, Aug 25, 2020 at 10:49:17AM -0400, Brian Foster wrote: > > cc Ming > > > > On Tue, Aug 25, 2020 at 10:42:03AM +1000, Dave Chinner wrote: > > > On Mon, Aug 24, 2020 at 11:48:41AM -0400, Brian Foster wrote: > > > > On Mon,

Re: [PATCH] iomap: Fix the write_count in iomap_add_to_ioend().

2020-09-15 Thread Darrick J. Wong
On Tue, Aug 25, 2020 at 10:49:17AM -0400, Brian Foster wrote: > cc Ming > > On Tue, Aug 25, 2020 at 10:42:03AM +1000, Dave Chinner wrote: > > On Mon, Aug 24, 2020 at 11:48:41AM -0400, Brian Foster wrote: > > > On Mon, Aug 24, 2020 at 04:04:17PM +0100, Christoph Hellwig wrote: > > > > On Mon, Aug

Re: [PATCH] iomap: Fix the write_count in iomap_add_to_ioend().

2020-08-31 Thread Brian Foster
On Mon, Aug 31, 2020 at 12:01:07PM +0800, Ming Lei wrote: > On Tue, Aug 25, 2020 at 10:49:17AM -0400, Brian Foster wrote: > > cc Ming > > > > On Tue, Aug 25, 2020 at 10:42:03AM +1000, Dave Chinner wrote: > > > On Mon, Aug 24, 2020 at 11:48:41AM -0400, Brian Foster wrote: > > > > On Mon, Aug 24,

Re: [PATCH] iomap: Fix the write_count in iomap_add_to_ioend().

2020-08-30 Thread Ming Lei
On Tue, Aug 25, 2020 at 10:49:17AM -0400, Brian Foster wrote: > cc Ming > > On Tue, Aug 25, 2020 at 10:42:03AM +1000, Dave Chinner wrote: > > On Mon, Aug 24, 2020 at 11:48:41AM -0400, Brian Foster wrote: > > > On Mon, Aug 24, 2020 at 04:04:17PM +0100, Christoph Hellwig wrote: > > > > On Mon, Aug

Re: [PATCH] iomap: Fix the write_count in iomap_add_to_ioend().

2020-08-25 Thread Brian Foster
cc Ming On Tue, Aug 25, 2020 at 10:42:03AM +1000, Dave Chinner wrote: > On Mon, Aug 24, 2020 at 11:48:41AM -0400, Brian Foster wrote: > > On Mon, Aug 24, 2020 at 04:04:17PM +0100, Christoph Hellwig wrote: > > > On Mon, Aug 24, 2020 at 10:28:23AM -0400, Brian Foster wrote: > > > > Do I understand

Re: [PATCH] iomap: Fix the write_count in iomap_add_to_ioend().

2020-08-24 Thread Dave Chinner
On Mon, Aug 24, 2020 at 11:48:41AM -0400, Brian Foster wrote: > On Mon, Aug 24, 2020 at 04:04:17PM +0100, Christoph Hellwig wrote: > > On Mon, Aug 24, 2020 at 10:28:23AM -0400, Brian Foster wrote: > > > Do I understand the current code (__bio_try_merge_page() -> > > > page_is_mergeable())

Re: [PATCH] iomap: Fix the write_count in iomap_add_to_ioend().

2020-08-24 Thread Brian Foster
On Mon, Aug 24, 2020 at 04:04:17PM +0100, Christoph Hellwig wrote: > On Mon, Aug 24, 2020 at 10:28:23AM -0400, Brian Foster wrote: > > Do I understand the current code (__bio_try_merge_page() -> > > page_is_mergeable()) correctly in that we're checking for physical page > > contiguity and not

Re: [PATCH] iomap: Fix the write_count in iomap_add_to_ioend().

2020-08-24 Thread Christoph Hellwig
On Mon, Aug 24, 2020 at 10:28:23AM -0400, Brian Foster wrote: > Do I understand the current code (__bio_try_merge_page() -> > page_is_mergeable()) correctly in that we're checking for physical page > contiguity and not necessarily requiring a new bio_vec per physical > page? Yes. > With regard

Re: [PATCH] iomap: Fix the write_count in iomap_add_to_ioend().

2020-08-24 Thread Brian Foster
On Sat, Aug 22, 2020 at 02:13:12PM +0100, Christoph Hellwig wrote: > On Sat, Aug 22, 2020 at 07:53:58AM +1000, Dave Chinner wrote: > > but iomap only allows BIO_MAX_PAGES when creating the bio. And: > > > > #define BIO_MAX_PAGES 256 > > > > So even on a 64k page machine, we should not be

Re: [PATCH] iomap: Fix the write_count in iomap_add_to_ioend().

2020-08-22 Thread Christoph Hellwig
On Sat, Aug 22, 2020 at 07:53:58AM +1000, Dave Chinner wrote: > but iomap only allows BIO_MAX_PAGES when creating the bio. And: > > #define BIO_MAX_PAGES 256 > > So even on a 64k page machine, we should not be building a bio with > more than 16MB of data in it. So how are we getting 4GB of data

Re: [PATCH] iomap: Fix the write_count in iomap_add_to_ioend().

2020-08-21 Thread Dave Chinner
On Fri, Aug 21, 2020 at 10:15:33AM +0530, Ritesh Harjani wrote: > Hello Dave, > > Thanks for reviewing this. > > On 8/21/20 4:41 AM, Dave Chinner wrote: > > On Wed, Aug 19, 2020 at 03:58:41PM +0530, Anju T Sudhakar wrote: > > > From: Ritesh Harjani > > > > > > __bio_try_merge_page() may return

Re: [PATCH] iomap: Fix the write_count in iomap_add_to_ioend().

2020-08-21 Thread Jens Axboe
On 8/21/20 12:07 AM, Christoph Hellwig wrote: > On Wed, Aug 19, 2020 at 03:58:41PM +0530, Anju T Sudhakar wrote: >> From: Ritesh Harjani >> >> __bio_try_merge_page() may return same_page = 1 and merged = 0. >> This could happen when bio->bi_iter.bi_size + len > UINT_MAX. >> Handle this case in

Re: [PATCH] iomap: Fix the write_count in iomap_add_to_ioend().

2020-08-21 Thread Matthew Wilcox
On Wed, Aug 19, 2020 at 03:58:41PM +0530, Anju T Sudhakar wrote: > __bio_try_merge_page() may return same_page = 1 and merged = 0. > This could happen when bio->bi_iter.bi_size + len > UINT_MAX. > Handle this case in iomap_add_to_ioend() by incrementing write_count. One of the patches I have

Re: [PATCH] iomap: Fix the write_count in iomap_add_to_ioend().

2020-08-21 Thread Ritesh Harjani
On 8/21/20 11:30 AM, Christoph Hellwig wrote: On Fri, Aug 21, 2020 at 10:15:33AM +0530, Ritesh Harjani wrote: Please correct me here, but as I see, bio has only these two limits which it checks for adding page to bio. It doesn't check for limits of /sys/block//queue/* no? I guess then it

Re: [PATCH] iomap: Fix the write_count in iomap_add_to_ioend().

2020-08-21 Thread Ritesh Harjani
On 8/21/20 11:37 AM, Christoph Hellwig wrote: On Wed, Aug 19, 2020 at 03:58:41PM +0530, Anju T Sudhakar wrote: From: Ritesh Harjani __bio_try_merge_page() may return same_page = 1 and merged = 0. This could happen when bio->bi_iter.bi_size + len > UINT_MAX. Handle this case in

Re: [PATCH] iomap: Fix the write_count in iomap_add_to_ioend().

2020-08-21 Thread Christoph Hellwig
On Wed, Aug 19, 2020 at 03:58:41PM +0530, Anju T Sudhakar wrote: > From: Ritesh Harjani > > __bio_try_merge_page() may return same_page = 1 and merged = 0. > This could happen when bio->bi_iter.bi_size + len > UINT_MAX. > Handle this case in iomap_add_to_ioend() by incrementing write_count. >

Re: [PATCH] iomap: Fix the write_count in iomap_add_to_ioend().

2020-08-21 Thread Christoph Hellwig
On Fri, Aug 21, 2020 at 09:11:40AM +1000, Dave Chinner wrote: > On Wed, Aug 19, 2020 at 03:58:41PM +0530, Anju T Sudhakar wrote: > > From: Ritesh Harjani > > > > __bio_try_merge_page() may return same_page = 1 and merged = 0. > > This could happen when bio->bi_iter.bi_size + len > UINT_MAX. >

Re: [PATCH] iomap: Fix the write_count in iomap_add_to_ioend().

2020-08-21 Thread Christoph Hellwig
On Fri, Aug 21, 2020 at 10:15:33AM +0530, Ritesh Harjani wrote: > Please correct me here, but as I see, bio has only these two limits > which it checks for adding page to bio. It doesn't check for limits > of /sys/block//queue/* no? I guess then it could be checked > by block layer below b4

Re: [PATCH] iomap: Fix the write_count in iomap_add_to_ioend().

2020-08-20 Thread Ritesh Harjani
Hello Dave, Thanks for reviewing this. On 8/21/20 4:41 AM, Dave Chinner wrote: On Wed, Aug 19, 2020 at 03:58:41PM +0530, Anju T Sudhakar wrote: From: Ritesh Harjani __bio_try_merge_page() may return same_page = 1 and merged = 0. This could happen when bio->bi_iter.bi_size + len > UINT_MAX.

Re: [PATCH] iomap: Fix the write_count in iomap_add_to_ioend().

2020-08-20 Thread Dave Chinner
On Wed, Aug 19, 2020 at 03:58:41PM +0530, Anju T Sudhakar wrote: > From: Ritesh Harjani > > __bio_try_merge_page() may return same_page = 1 and merged = 0. > This could happen when bio->bi_iter.bi_size + len > UINT_MAX. Ummm, silly question, but exactly how are we getting a bio that large in