Re: next bio iters break discard?

2014-01-31 Thread Jens Axboe
On Fri, Jan 31 2014, Hugh Dickins wrote: > On Thu, 16 Jan 2014, Kent Overstreet wrote: > > > > Ok, I reread the code and figured it out - the analagous change also has to > > be > > made in __blk_segment_map_sg(). I'll mail out a patch for this tomorrow > > after > > I've stared at the code

Re: next bio iters break discard?

2014-01-31 Thread Hugh Dickins
On Thu, 16 Jan 2014, Kent Overstreet wrote: > > Ok, I reread the code and figured it out - the analagous change also has to be > made in __blk_segment_map_sg(). I'll mail out a patch for this tomorrow after > I've stared at the code more and had less beer. I'd been hoping for a patch to try, but

Re: next bio iters break discard?

2014-01-31 Thread Hugh Dickins
On Thu, 16 Jan 2014, Kent Overstreet wrote: Ok, I reread the code and figured it out - the analagous change also has to be made in __blk_segment_map_sg(). I'll mail out a patch for this tomorrow after I've stared at the code more and had less beer. I'd been hoping for a patch to try, but now

Re: next bio iters break discard?

2014-01-31 Thread Jens Axboe
On Fri, Jan 31 2014, Hugh Dickins wrote: On Thu, 16 Jan 2014, Kent Overstreet wrote: Ok, I reread the code and figured it out - the analagous change also has to be made in __blk_segment_map_sg(). I'll mail out a patch for this tomorrow after I've stared at the code more and had

Re: next bio iters break discard?

2014-01-16 Thread Kent Overstreet
On Thu, Jan 16, 2014 at 12:21:10PM -0800, Hugh Dickins wrote: > For me this just shifts the crash, > from __blk_recalc_rq_segments() to blk_rq_map_sg(): > > blk_rq_map_sg > scsi_init_sgtable > scsi_init_io > scsi_setup_blk_pc_cmnd > sd_prep_fn > blk_peek_request > scsi_request_fn >

Re: next bio iters break discard?

2014-01-16 Thread Kent Overstreet
On Thu, Jan 16, 2014 at 12:21:10PM -0800, Hugh Dickins wrote: > On Tue, 14 Jan 2014, Kent Overstreet wrote: > > > > Does the below patch look like what we want? I'm assuming that if > > You don't fill me with confidence ;) > > > multiple WRITE_SAME bios are merged, since they're all writing the

Re: next bio iters break discard?

2014-01-16 Thread Hugh Dickins
On Tue, 14 Jan 2014, Kent Overstreet wrote: > > Does the below patch look like what we want? I'm assuming that if You don't fill me with confidence ;) > multiple WRITE_SAME bios are merged, since they're all writing the same > data we can consider the entire request to be a single segment. > >

Re: next bio iters break discard?

2014-01-16 Thread Hugh Dickins
On Tue, 14 Jan 2014, Kent Overstreet wrote: Does the below patch look like what we want? I'm assuming that if You don't fill me with confidence ;) multiple WRITE_SAME bios are merged, since they're all writing the same data we can consider the entire request to be a single segment.

Re: next bio iters break discard?

2014-01-16 Thread Kent Overstreet
On Thu, Jan 16, 2014 at 12:21:10PM -0800, Hugh Dickins wrote: On Tue, 14 Jan 2014, Kent Overstreet wrote: Does the below patch look like what we want? I'm assuming that if You don't fill me with confidence ;) multiple WRITE_SAME bios are merged, since they're all writing the same

Re: next bio iters break discard?

2014-01-16 Thread Kent Overstreet
On Thu, Jan 16, 2014 at 12:21:10PM -0800, Hugh Dickins wrote: For me this just shifts the crash, from __blk_recalc_rq_segments() to blk_rq_map_sg(): blk_rq_map_sg scsi_init_sgtable scsi_init_io scsi_setup_blk_pc_cmnd sd_prep_fn blk_peek_request scsi_request_fn __blk_run_queue

Re: next bio iters break discard?

2014-01-15 Thread Martin K. Petersen
> "Kent" == Kent Overstreet writes: Kent> Side note, one of the things on my todo list/wishlist is make a Kent> separate enum for bio type - bare flush, normal read/write, scsi Kent> command, discard and write same. In particular with bi_size Kent> meaning different things depending on the

Re: next bio iters break discard?

2014-01-15 Thread Martin K. Petersen
Kent == Kent Overstreet k...@daterainc.com writes: Kent Side note, one of the things on my todo list/wishlist is make a Kent separate enum for bio type - bare flush, normal read/write, scsi Kent command, discard and write same. In particular with bi_size Kent meaning different things depending

Re: next bio iters break discard?

2014-01-14 Thread Kent Overstreet
On Tue, Jan 14, 2014 at 03:17:32PM -0500, Martin K. Petersen wrote: > > "Kent" == Kent Overstreet writes: > > >> IOW, DISCARD, WRITE SAME and the impending COPY requests do not have > >> a 1:1 mapping between the block range worked on and the size of any > >> bvecs attached. Your recent

Re: next bio iters break discard?

2014-01-14 Thread Martin K. Petersen
> "Kent" == Kent Overstreet writes: >> IOW, DISCARD, WRITE SAME and the impending COPY requests do not have >> a 1:1 mapping between the block range worked on and the size of any >> bvecs attached. Your recent changes must have changed the way we >> handled that in the past. Kent> Yeah -

Re: next bio iters break discard?

2014-01-14 Thread Martin K. Petersen
Kent == Kent Overstreet k...@daterainc.com writes: IOW, DISCARD, WRITE SAME and the impending COPY requests do not have a 1:1 mapping between the block range worked on and the size of any bvecs attached. Your recent changes must have changed the way we handled that in the past. Kent Yeah -

Re: next bio iters break discard?

2014-01-14 Thread Kent Overstreet
On Tue, Jan 14, 2014 at 03:17:32PM -0500, Martin K. Petersen wrote: Kent == Kent Overstreet k...@daterainc.com writes: IOW, DISCARD, WRITE SAME and the impending COPY requests do not have a 1:1 mapping between the block range worked on and the size of any bvecs attached. Your recent

Re: next bio iters break discard?

2014-01-13 Thread Kent Overstreet
On Mon, Jan 13, 2014 at 11:06:33PM -0500, Martin K. Petersen wrote: > > "Kent" == Kent Overstreet writes: > > Kent, > > Kent> I think for discards we can deal with this easily enough - > Kent> __blk_recalc_rq_segments() will have to special case them - but > Kent> there's a similar (but

Re: next bio iters break discard?

2014-01-13 Thread Martin K. Petersen
> "Kent" == Kent Overstreet writes: Kent, Kent> I think for discards we can deal with this easily enough - Kent> __blk_recalc_rq_segments() will have to special case them - but Kent> there's a similar (but worse) issue with WRITE_SAME, and looking Kent> at the code it does attempt to merge

Re: next bio iters break discard?

2014-01-13 Thread Kent Overstreet
On Sun, Jan 12, 2014 at 07:52:40PM -0800, Hugh Dickins wrote: > When I try to exercise heavy swapping with discard on mmotm 2014-01-09, > I soon hit a NULL pointer dereference in __blk_recalc_rq_segments(): > > __blk_recalc_rq_segments > blk_recount_segments > ll_back_merge_fn >

Re: next bio iters break discard?

2014-01-13 Thread Kent Overstreet
On Sun, Jan 12, 2014 at 07:52:40PM -0800, Hugh Dickins wrote: When I try to exercise heavy swapping with discard on mmotm 2014-01-09, I soon hit a NULL pointer dereference in __blk_recalc_rq_segments(): __blk_recalc_rq_segments blk_recount_segments ll_back_merge_fn bio_attempt_back_merge

Re: next bio iters break discard?

2014-01-13 Thread Martin K. Petersen
Kent == Kent Overstreet k...@daterainc.com writes: Kent, Kent I think for discards we can deal with this easily enough - Kent __blk_recalc_rq_segments() will have to special case them - but Kent there's a similar (but worse) issue with WRITE_SAME, and looking Kent at the code it does attempt to

Re: next bio iters break discard?

2014-01-13 Thread Kent Overstreet
On Mon, Jan 13, 2014 at 11:06:33PM -0500, Martin K. Petersen wrote: Kent == Kent Overstreet k...@daterainc.com writes: Kent, Kent I think for discards we can deal with this easily enough - Kent __blk_recalc_rq_segments() will have to special case them - but Kent there's a similar (but

next bio iters break discard?

2014-01-12 Thread Hugh Dickins
When I try to exercise heavy swapping with discard on mmotm 2014-01-09, I soon hit a NULL pointer dereference in __blk_recalc_rq_segments(): __blk_recalc_rq_segments blk_recount_segments ll_back_merge_fn bio_attempt_back_merge blk_queue_bio generic_make_request submit_bio blkdev_issue_discard

next bio iters break discard?

2014-01-12 Thread Hugh Dickins
When I try to exercise heavy swapping with discard on mmotm 2014-01-09, I soon hit a NULL pointer dereference in __blk_recalc_rq_segments(): __blk_recalc_rq_segments blk_recount_segments ll_back_merge_fn bio_attempt_back_merge blk_queue_bio generic_make_request submit_bio blkdev_issue_discard