From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dongsu Park Subject: Re: [RFC PATCH 01/17] block: make generic_make_request handle arbitrarily sized bios Date: Tue, 23 Dec 2014 12:41:40 +0100 Message-ID: <20141223114140.GB15080@gmail.com> References: <20141223101614.GA13138@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Return-path: Content-Disposition: inline In-Reply-To: <20141223101614.GA13138@infradead.org> Sender: linux-kernel-owner@vger.kernel.org To: Christoph Hellwig Cc: linux-kernel@vger.kernel.org, Jens Axboe , Kent Overstreet , Ming Lin , Al Viro , Ming Lei , Neil Brown , Alasdair Kergon , Mike Snitzer , dm-devel@redhat.com, drbd-dev@lists.linbit.com, Jiri Kosina , Geoff Levand , Jim Paris , Joshua Morris , Philip Kelleher , Minchan Kim , Nitin Gupta , Oleg Drokin , Andreas Dilger List-Id: dm-devel.ids Hi Christoph, On 23.12.2014 02:16, Christoph Hellwig wrote: > > +void blk_queue_split(struct request_queue *q, struct bio **bio, > > + struct bio_set *bs) > > +{ > > + struct bio *split; > > + > > + if ((*bio)->bi_rw & REQ_DISCARD) > > + split = blk_bio_discard_split(q, *bio, bs); > > + else if ((*bio)->bi_rw & REQ_WRITE_SAME) > > + split = blk_bio_write_same_split(q, *bio, bs); > > + else > > + split = blk_bio_segment_split(q, *bio, q->bio_split); > > + > > + if (split) { > > + bio_chain(split, *bio); > > + generic_make_request(*bio); > > + *bio = split; > > + } > > +} > > +EXPORT_SYMBOL(blk_queue_split); > > I think blk_queue_split needs to explicitly skip BLOCK_PC bios. Those > are SCSI pass through ioctls that we can't split due to their opaque > nature. You mean, checking rq->cmd_type == REQ_TYPE_BLOCK_PC, right? I'm wondering about how to check that in blk_queue_split(). At the moment when blk_queue_split() is called, it's even before a request is mapped e.g. in blk_sq_make_request(). Unlike scsi drivers where it's easy to get cmd->rq, blk_queue_split() doesn't seem to be able to get a request by blk_get_request(). Or am I missing something? Thanks, Dongsu From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by mail09.linbit.com (LINBIT Mail Daemon) with ESMTPS id 4C5541045C37 for ; Tue, 23 Dec 2014 12:41:43 +0100 (CET) Received: by mail-wi0-f178.google.com with SMTP id em10so10493089wid.11 for ; Tue, 23 Dec 2014 03:41:43 -0800 (PST) Date: Tue, 23 Dec 2014 12:41:40 +0100 From: Dongsu Park To: Christoph Hellwig Message-ID: <20141223114140.GB15080@gmail.com> References: <20141223101614.GA13138@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20141223101614.GA13138@infradead.org> Cc: Jens Axboe , Nitin Gupta , Mike Snitzer , Ming Lin , Minchan Kim , Neil Brown , Jiri Kosina , Ming Lei , linux-kernel@vger.kernel.org, Jim Paris , Philip Kelleher , Oleg Drokin , Geoff Levand , Kent Overstreet , Al Viro , Andreas Dilger , dm-devel@redhat.com, Joshua Morris , Alasdair Kergon , drbd-dev@lists.linbit.com Subject: Re: [Drbd-dev] [RFC PATCH 01/17] block: make generic_make_request handle arbitrarily sized bios List-Id: "*Coordination* of development, patches, contributions -- *Questions* \(even to developers\) go to drbd-user, please." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Hi Christoph, On 23.12.2014 02:16, Christoph Hellwig wrote: > > +void blk_queue_split(struct request_queue *q, struct bio **bio, > > + struct bio_set *bs) > > +{ > > + struct bio *split; > > + > > + if ((*bio)->bi_rw & REQ_DISCARD) > > + split = blk_bio_discard_split(q, *bio, bs); > > + else if ((*bio)->bi_rw & REQ_WRITE_SAME) > > + split = blk_bio_write_same_split(q, *bio, bs); > > + else > > + split = blk_bio_segment_split(q, *bio, q->bio_split); > > + > > + if (split) { > > + bio_chain(split, *bio); > > + generic_make_request(*bio); > > + *bio = split; > > + } > > +} > > +EXPORT_SYMBOL(blk_queue_split); > > I think blk_queue_split needs to explicitly skip BLOCK_PC bios. Those > are SCSI pass through ioctls that we can't split due to their opaque > nature. You mean, checking rq->cmd_type == REQ_TYPE_BLOCK_PC, right? I'm wondering about how to check that in blk_queue_split(). At the moment when blk_queue_split() is called, it's even before a request is mapped e.g. in blk_sq_make_request(). Unlike scsi drivers where it's easy to get cmd->rq, blk_queue_split() doesn't seem to be able to get a request by blk_get_request(). Or am I missing something? Thanks, Dongsu