Message ID | CACVXFVM_bSd=SQeNg8gjaXd1R1oFreV+jnWgEVDoVwozcQ5Nbw@mail.gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Tue, Dec 15, 2015 at 09:27:14PM +0800, Ming Lei wrote: > On Tue, Dec 15, 2015 at 9:06 PM, Eryu Guan <guaneryu@gmail.com> wrote: > > On Tue, Dec 15, 2015 at 08:06:47PM +0800, Ming Lei wrote: > >> On Tue, Dec 15, 2015 at 7:20 PM, Eryu Guan <guaneryu@gmail.com> wrote: > >> > On Fri, Dec 11, 2015 at 07:53:40PM +0800, Eryu Guan wrote: > >> >> Hi, > >> >> > >> >> I saw this kernel BUG_ON on 4.4-rc4 kernel, and this can be reproduced > >> >> easily on ppc64 host by: > >> > > >> > This is still reproducible with 4.4-rc5 kernel. > >> > >> Could you capture the debug log after appyling the attached patch and > >> the reproduction? > > > > Thanks for looking into this! dmesg shows: > > > > [ 686.217682] bio_split: sectors 0, bio_sectors 128, bi_rw 0 > > Then I guess queue_max_sectors(q) is bad, could you apply the > attached patch(and the last patch) and post the log? [ 301.279018] blk_bio_segment_split: nseg 0, max_secs 64, max segs 2048 [ 301.279023] bv.len 65536, bv.offset 0 [ 301.279026] bio_split: sectors 0, bio_sectors 128, bi_rw 0 If full call trace is needed please let me know. Thanks, Eryu -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Wed, Dec 16, 2015 at 12:56 AM, Eryu Guan <guaneryu@gmail.com> wrote: > On Tue, Dec 15, 2015 at 09:27:14PM +0800, Ming Lei wrote: >> On Tue, Dec 15, 2015 at 9:06 PM, Eryu Guan <guaneryu@gmail.com> wrote: >> > On Tue, Dec 15, 2015 at 08:06:47PM +0800, Ming Lei wrote: >> >> On Tue, Dec 15, 2015 at 7:20 PM, Eryu Guan <guaneryu@gmail.com> wrote: >> >> > On Fri, Dec 11, 2015 at 07:53:40PM +0800, Eryu Guan wrote: >> >> >> Hi, >> >> >> >> >> >> I saw this kernel BUG_ON on 4.4-rc4 kernel, and this can be reproduced >> >> >> easily on ppc64 host by: >> >> > >> >> > This is still reproducible with 4.4-rc5 kernel. >> >> >> >> Could you capture the debug log after appyling the attached patch and >> >> the reproduction? >> > >> > Thanks for looking into this! dmesg shows: >> > >> > [ 686.217682] bio_split: sectors 0, bio_sectors 128, bi_rw 0 >> >> Then I guess queue_max_sectors(q) is bad, could you apply the >> attached patch(and the last patch) and post the log? > > [ 301.279018] blk_bio_segment_split: nseg 0, max_secs 64, max segs 2048 > [ 301.279023] bv.len 65536, bv.offset 0 > [ 301.279026] bio_split: sectors 0, bio_sectors 128, bi_rw 0 Now, the issue is quite obvious, and page size is 64K on your platform, but max_sectors is set as 64 by commit ca369d51b3e164, and I think it is wrong to set max sectors from OPTIMAL TRANSFER LENGTH. Also it is ugly to set limits->max_sectors from drivers directly, and drivers should have called block helpers to do that. > If full call trace is needed please let me know. Thanks for your test, and the above log is absolutely enough, :-) Thanks, Ming Lei -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
>>>>> "Ming" == Ming Lei <tom.leiming@gmail.com> writes:
Ming> I think it is wrong to set max sectors from OPTIMAL TRANSFER
Ming> LENGTH.
OTL is the preferred size for REQ_TYPE_FS requests as reported by the
device. The intent is to honor that. Your patch clamps the rw_size to
BLK_DEF_MAX_SECTORS which is not correct.
Ming> Also it is ugly to set limits->max_sectors from drivers directly,
Ming> and drivers should have called block helpers to do that.
We're trying to avoid unnecessary accessor functions for the queue
limits. But I will add a sanity check for the page size. And fix up
scsi_debug.
diff --git a/block/blk-merge.c b/block/blk-merge.c index b66f095..d0ea926 100644 --- a/block/blk-merge.c +++ b/block/blk-merge.c @@ -129,6 +129,15 @@ split: *segs = nsegs; if (do_split) { + if (!sectors) { + printk("%s: nseg %u, max_secs %u, max segs %u\n", + __func__, nsegs, + queue_max_sectors(q), + queue_max_segments(q)); + printk("\t bv.len %u, bv.offset %u\n", + bv.bv_len, bv.bv_offset); + } + new = bio_split(bio, sectors, GFP_NOIO, bs); if (new) bio = new;