* [PATCH] dm-mpath: return DM_MAPIO_REQUEUE in case of rq allocation failure @ 2017-09-22 1:35 Ming Lei 2017-09-22 15:06 ` Bart Van Assche 0 siblings, 1 reply; 10+ messages in thread From: Ming Lei @ 2017-09-22 1:35 UTC (permalink / raw) To: dm-devel, Mike Snitzer, Jens Axboe Cc: linux-block, Christoph Hellwig, Bart Van Assche, Laurence Oberman, Ming Lei blk-mq will rerun queue via RESTART after one request is completed, so not necessary to wait random time for requeuing, we should trust blk-mq to do it. More importantly, we need return BLK_STS_RESOURCE to blk-mq so that dequeue from I/O scheduler can be stopped, then I/O merge gets improved. Signed-off-by: Ming Lei <ming.lei@redhat.com> --- drivers/md/dm-mpath.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index 11f273d2f018..0902f7762306 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c @@ -504,8 +504,20 @@ static int multipath_clone_and_map(struct dm_target *ti, struct request *rq, if (queue_dying) { atomic_inc(&m->pg_init_in_progress); activate_or_offline_path(pgpath); + return DM_MAPIO_DELAY_REQUEUE; } - return DM_MAPIO_DELAY_REQUEUE; + + /* + * blk-mq's SCHED_RESTART can cover this requeue, so + * we needn't to deal with it by DELAY_REQUEUE. More + * importantly, we have to return DM_MAPIO_REQUEUE + * so that blk-mq can get the queue busy feedback, + * otherwise I/O merge can be hurt. + */ + if (q->mq_ops) + return DM_MAPIO_REQUEUE; + else + return DM_MAPIO_DELAY_REQUEUE; } clone->bio = clone->biotail = NULL; clone->rq_disk = bdev->bd_disk; -- 2.9.5 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH] dm-mpath: return DM_MAPIO_REQUEUE in case of rq allocation failure 2017-09-22 1:35 [PATCH] dm-mpath: return DM_MAPIO_REQUEUE in case of rq allocation failure Ming Lei @ 2017-09-22 15:06 ` Bart Van Assche 2017-09-22 17:44 ` Ming Lei 0 siblings, 1 reply; 10+ messages in thread From: Bart Van Assche @ 2017-09-22 15:06 UTC (permalink / raw) To: dm-devel@redhat.com, axboe@fb.com, ming.lei@redhat.com, snitzer@redhat.com Cc: Bart Van Assche, hch@infradead.org, linux-block@vger.kernel.org, loberman@redhat.com T24gRnJpLCAyMDE3LTA5LTIyIGF0IDA5OjM1ICswODAwLCBNaW5nIExlaSB3cm90ZToNCj4gKwkJ LyoNCj4gKwkJICogYmxrLW1xJ3MgU0NIRURfUkVTVEFSVCBjYW4gY292ZXIgdGhpcyByZXF1ZXVl LCBzbw0KPiArCQkgKiB3ZSBuZWVkbid0IHRvIGRlYWwgd2l0aCBpdCBieSBERUxBWV9SRVFVRVVF LiBNb3JlDQo+ICsJCSAqIGltcG9ydGFudGx5LCB3ZSBoYXZlIHRvIHJldHVybiBETV9NQVBJT19S RVFVRVVFDQo+ICsJCSAqIHNvIHRoYXQgYmxrLW1xIGNhbiBnZXQgdGhlIHF1ZXVlIGJ1c3kgZmVl ZGJhY2ssDQo+ICsJCSAqIG90aGVyd2lzZSBJL08gbWVyZ2UgY2FuIGJlIGh1cnQuDQo+ICsJCSAq Lw0KPiArCQlpZiAocS0+bXFfb3BzKQ0KPiArCQkJcmV0dXJuIERNX01BUElPX1JFUVVFVUU7DQo+ ICsJCWVsc2UNCj4gKwkJCXJldHVybiBETV9NQVBJT19ERUxBWV9SRVFVRVVFOw0KPiAgCX0NCg0K VGhpcyBwYXRjaCBpcyBpbmZlcmlvciB0byB3aGF0IEkgcG9zdGVkIGJlY2F1c2UgdGhpcyBwYXRj aCBkb2VzIG5vdCBhdm9pZA0KdGhlIGRlbGF5IGlmIG11bHRpcGxlIExVTnMgYXJlIGFzc29jaWF0 ZWQgd2l0aCB0aGUgc2FtZSBTQ1NJIGhvc3QuIENvbnNpZGVyDQplLmcuIHRoZSBmb2xsb3dpbmcg Y29uZmlndXJhdGlvbjoNCiogQSBzaW5nbGUgU0NTSSBob3N0IHdpdGggdHdvIFNDU0kgTFVOcyBh c3NvY2lhdGVkIHRvIHRoYXQgaG9zdCwgZS5nLiAvZGV2L3NkYQ0KICBhbmQgL2Rldi9zZGIuDQoq IEEgZG0tbXBhdGggaW5zdGFuY2UgaGFzIGJlZW4gY3JlYXRlZCBvbiB0b3Agb2YgL2Rldi9zZGEu DQpJZiBhbGwgdGFncyBhcmUgaW4gdXNlIGJ5IHJlcXVlc3RzIHF1ZXVlZCB0byAvZGV2L3NkYiwg bm8gZG0gcmVxdWVzdHMgYXJlIGluDQpwcm9ncmVzcyBhbmQgYSByZXF1ZXN0IGlzIHN1Ym1pdHRl ZCBhZ2FpbnN0IHRoZSBkbS1tcGF0aCBkZXZpY2UgdGhlbiB0aGUNCmJsa19nZXRfcmVxdWVzdChx LCBHRlBfQVRPTUlDKSBjYWxsIHdpbGwgZmFpbC4gVGhlIHJlcXVlc3Qgd2lsbCBiZSByZXF1ZXVl ZA0KYW5kIHRoZSBxdWV1ZSB3aWxsIGJlIHJlcnVuIGFmdGVyIGEgZGVsYXkuDQoNCk15IHBhdGNo IGRvZXMgbm90IGludHJvZHVjZSBhIGRlbGF5IGluIHRoaXMgY2FzZS4NCg0KQmFydC4= ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] dm-mpath: return DM_MAPIO_REQUEUE in case of rq allocation failure 2017-09-22 15:06 ` Bart Van Assche @ 2017-09-22 17:44 ` Ming Lei 2017-09-22 17:54 ` Bart Van Assche 0 siblings, 1 reply; 10+ messages in thread From: Ming Lei @ 2017-09-22 17:44 UTC (permalink / raw) To: Bart Van Assche Cc: dm-devel@redhat.com, axboe@fb.com, snitzer@redhat.com, hch@infradead.org, linux-block@vger.kernel.org, loberman@redhat.com On Fri, Sep 22, 2017 at 03:06:16PM +0000, Bart Van Assche wrote: > On Fri, 2017-09-22 at 09:35 +0800, Ming Lei wrote: > > + /* > > + * blk-mq's SCHED_RESTART can cover this requeue, so > > + * we needn't to deal with it by DELAY_REQUEUE. More > > + * importantly, we have to return DM_MAPIO_REQUEUE > > + * so that blk-mq can get the queue busy feedback, > > + * otherwise I/O merge can be hurt. > > + */ > > + if (q->mq_ops) > > + return DM_MAPIO_REQUEUE; > > + else > > + return DM_MAPIO_DELAY_REQUEUE; > > } > > This patch is inferior to what I posted because this patch does not avoid > the delay if multiple LUNs are associated with the same SCSI host. Consider > e.g. the following configuration: > * A single SCSI host with two SCSI LUNs associated to that host, e.g. /dev/sda > and /dev/sdb. > * A dm-mpath instance has been created on top of /dev/sda. > If all tags are in use by requests queued to /dev/sdb, no dm requests are in > progress and a request is submitted against the dm-mpath device then the > blk_get_request(q, GFP_ATOMIC) call will fail. The request will be requeued > and the queue will be rerun after a delay. > > My patch does not introduce a delay in this case. That delay may not matter because SCHED_RESTART will run queue just after one request is completed. There is at least one issue with get_request(GFP_NOIO): AIO performance regression may not be caused, or even AIO may not be possible. For example, user runs fio(libaio, randread, single job, queue depth: 64, device: dm-mpath disk), if get_request(GFP_NOIO) often blocks because of shared tags or out of tag, the actual queue depth won't reach 64 at all, and may be just 1 in the worst case. Once the actual queue depth is decreased much, random I/O performance should be hurt a lot. -- Ming ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] dm-mpath: return DM_MAPIO_REQUEUE in case of rq allocation failure 2017-09-22 17:44 ` Ming Lei @ 2017-09-22 17:54 ` Bart Van Assche 2017-09-25 3:06 ` Ming Lei 0 siblings, 1 reply; 10+ messages in thread From: Bart Van Assche @ 2017-09-22 17:54 UTC (permalink / raw) To: ming.lei@redhat.com Cc: dm-devel@redhat.com, hch@infradead.org, linux-block@vger.kernel.org, axboe@fb.com, snitzer@redhat.com, loberman@redhat.com T24gU2F0LCAyMDE3LTA5LTIzIGF0IDAxOjQ0ICswODAwLCBNaW5nIExlaSB3cm90ZToNCj4gT24g RnJpLCBTZXAgMjIsIDIwMTcgYXQgMDM6MDY6MTZQTSArMDAwMCwgQmFydCBWYW4gQXNzY2hlIHdy b3RlOg0KPiA+IE9uIEZyaSwgMjAxNy0wOS0yMiBhdCA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PATCH] dm-mpath: return DM_MAPIO_REQUEUE in case of rq allocation failure 2017-09-22 17:54 ` Bart Van Assche @ 2017-09-25 3:06 ` Ming Lei 2017-09-25 15:23 ` Bart Van Assche 0 siblings, 1 reply; 10+ messages in thread From: Ming Lei @ 2017-09-25 3:06 UTC (permalink / raw) To: Bart Van Assche Cc: dm-devel@redhat.com, hch@infradead.org, linux-block@vger.kernel.org, axboe@fb.com, snitzer@redhat.com, loberman@redhat.com On Fri, Sep 22, 2017 at 05:54:48PM +0000, Bart Van Assche wrote: > On Sat, 2017-09-23 at 01:44 +0800, Ming Lei wrote: > > On Fri, Sep 22, 2017 at 03:06:16PM +0000, Bart Van Assche wrote: > > > On Fri, 2017-09-22 at 09:35 +0800, Ming Lei wrote: > > > > + /* > > > > + * blk-mq's SCHED_RESTART can cover this requeue, so > > > > + * we needn't to deal with it by DELAY_REQUEUE. More > > > > + * importantly, we have to return DM_MAPIO_REQUEUE > > > > + * so that blk-mq can get the queue busy feedback, > > > > + * otherwise I/O merge can be hurt. > > > > + */ > > > > + if (q->mq_ops) > > > > + return DM_MAPIO_REQUEUE; > > > > + else > > > > + return DM_MAPIO_DELAY_REQUEUE; > > > > } > > > > > > This patch is inferior to what I posted because this patch does not avoid > > > the delay if multiple LUNs are associated with the same SCSI host. Consider > > > e.g. the following configuration: > > > * A single SCSI host with two SCSI LUNs associated to that host, e.g. /dev/sda > > > and /dev/sdb. > > > * A dm-mpath instance has been created on top of /dev/sda. > > > If all tags are in use by requests queued to /dev/sdb, no dm requests are in > > > progress and a request is submitted against the dm-mpath device then the > > > blk_get_request(q, GFP_ATOMIC) call will fail. The request will be requeued > > > and the queue will be rerun after a delay. > > > > > > My patch does not introduce a delay in this case. > > > > That delay may not matter because SCHED_RESTART will run queue just > > after one request is completed. > > Did you understand what I wrote? SCHED_RESTART will be set for /dev/sdb but not > for the dm queue. That's what I was trying to explain to you in my previous e-mail. The patch I posted in this thread will set SCHED_RESTART for dm queue. > > > There is at least one issue with get_request(GFP_NOIO): AIO > > performance regression may not be caused, or even AIO may not > > be possible. For example, user runs fio(libaio, randread, single > > job, queue depth: 64, device: dm-mpath disk), if get_request(GFP_NOIO) > > often blocks because of shared tags or out of tag, the actual queue > > depth won't reach 64 at all, and may be just 1 in the worst case. > > Once the actual queue depth is decreased much, random I/O performance > > should be hurt a lot. > > That's why we need to modify scsi_lld_busy(). If scsi_lld_busy() will be > modified as I proposed in a previous e-mail then it will become very > unlikely that no tag is available when blk_get_request() is called. With that > scsi_lld_busy() modification it is even possible that we don't need to modify > the dm-mpath driver. Then post out a whole solution, and I'd like to take a look and test. -- Ming ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] dm-mpath: return DM_MAPIO_REQUEUE in case of rq allocation failure 2017-09-25 3:06 ` Ming Lei @ 2017-09-25 15:23 ` Bart Van Assche 2017-09-25 16:10 ` Ming Lei 0 siblings, 1 reply; 10+ messages in thread From: Bart Van Assche @ 2017-09-25 15:23 UTC (permalink / raw) To: ming.lei@redhat.com Cc: dm-devel@redhat.com, hch@infradead.org, linux-block@vger.kernel.org, axboe@fb.com, snitzer@redhat.com, loberman@redhat.com T24gTW9uLCAyMDE3LTA5LTI1IGF0IDExOjA2ICswODAwLCBNaW5nIExlaSB3cm90ZToNCj4gT24g RnJpLCBTZXAgMjIsIDIwMTcgYXQgMDU6NTQ6NDhQTSArMDAwMCwgQmFydCBWYW4gQXNzY2hlIHdy b3RlOg0KPiA+IE9uIFNhdCwgMjAxNy0wOS0yMyBhdCAwMTo0NCArMDgwMCwgTWluZyBMZWkgd3Jv dGU6DQo+ID4gPiBPbiBGcmksIFNlcCAyMiwgMjAxNyBhdCAwMzowNjoxNlBNICswMDAwLCBCYXJ0 IFZhbiBBc3NjaGUgd3JvdGU6DQo+ID4gPiA+IE9uIEZyaSwgMjAxNy0wOS0yMiBhdCAwOTozNSAr MDgwMCwgTWluZyBMZWkgd3JvdGU6DQo+ID4gPiA+ID4gKwkJLyoNCj4gPiA+ID4gPiArC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2UuDQo+ID4gPiBPbmNlIHRoZSBhY3R1YWwgcXVldWUgZGVwdGggaXMgZGVjcmVhc2VkIG11 Y2gsIHJhbmRvbSBJL08gcGVyZm9ybWFuY2UNCj4gPiA+IHNob3VsZCBiZSBodXJ0IGEgbG90Lg0K PiA+IA0KPiA+IFRoYXQncyB3aHkgd2UgbmVlZCB0byBtb2RpZnkgc2NzaV9sbGRfYnVzeSgpLiBJ ZiBzY3NpX2xsZF9idXN5KCkgd2lsbCBiZQ0KPiA+IG1vZGlmaWVkIGFzIEkgcHJvcG9zZWQgaW4g YSBwcmV2aW91cyBlLW1haWwgdGhlbiBpdCB3aWxsIGJlY29tZSB2ZXJ5DQo+ID4gdW5saWtlbHkg dGhhdCBubyB0YWcgaXMgYXZhaWxhYmxlIHdoZW4gYmxrX2dldF9yZXF1ZXN0KCkgaXMgY2FsbGVk LiBXaXRoIHRoYXQNCj4gPiBzY3NpX2xsZF9idXN5KCkgbW9kaWZpY2F0aW9uIGl0IGlzIGV2ZW4g cG9zc2libGUgdGhhdCB3ZSBkb24ndCBuZWVkIHRvIG1vZGlmeQ0KPiA+IHRoZSBkbS1tcGF0aCBk cml2ZXIuDQo+IA0KPiBUaGVuIHBvc3Qgb3V0IGEgd2hvbGUgc29sdXRpb24sIGFuZCBJJ2QgbGlr ZSB0byB0YWtlIGEgbG9vayBhbmQgdGVzdC4NCg0KSSB3aWxsIGRvIHRoYXQgYXMgc29vbiBhcyBJ IGhhdmUgdGhlIHRpbWUgdG8gcnVuIHNvbWUgbWVhc3VyZW1lbnRzLiBUaGUgcmVzdCBvZg0KdGhp cyB3ZWVrIEkgd2lsbCBiZSB0cmF2ZWxpbmcuDQoNCkJhcnQu ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH] dm-mpath: return DM_MAPIO_REQUEUE in case of rq allocation failure 2017-09-25 15:23 ` Bart Van Assche @ 2017-09-25 16:10 ` Ming Lei 2017-09-25 16:17 ` Mike Snitzer 0 siblings, 1 reply; 10+ messages in thread From: Ming Lei @ 2017-09-25 16:10 UTC (permalink / raw) To: Bart Van Assche Cc: dm-devel@redhat.com, hch@infradead.org, linux-block@vger.kernel.org, axboe@fb.com, snitzer@redhat.com, loberman@redhat.com On Mon, Sep 25, 2017 at 03:23:16PM +0000, Bart Van Assche wrote: > On Mon, 2017-09-25 at 11:06 +0800, Ming Lei wrote: > > On Fri, Sep 22, 2017 at 05:54:48PM +0000, Bart Van Assche wrote: > > > On Sat, 2017-09-23 at 01:44 +0800, Ming Lei wrote: > > > > On Fri, Sep 22, 2017 at 03:06:16PM +0000, Bart Van Assche wrote: > > > > > On Fri, 2017-09-22 at 09:35 +0800, Ming Lei wrote: > > > > > > + /* > > > > > > + * blk-mq's SCHED_RESTART can cover this requeue, so > > > > > > + * we needn't to deal with it by DELAY_REQUEUE. More > > > > > > + * importantly, we have to return DM_MAPIO_REQUEUE > > > > > > + * so that blk-mq can get the queue busy feedback, > > > > > > + * otherwise I/O merge can be hurt. > > > > > > + */ > > > > > > + if (q->mq_ops) > > > > > > + return DM_MAPIO_REQUEUE; > > > > > > + else > > > > > > + return DM_MAPIO_DELAY_REQUEUE; > > > > > > } > > > > > > > > > > This patch is inferior to what I posted because this patch does not avoid > > > > > the delay if multiple LUNs are associated with the same SCSI host. Consider > > > > > e.g. the following configuration: > > > > > * A single SCSI host with two SCSI LUNs associated to that host, e.g. /dev/sda > > > > > and /dev/sdb. > > > > > * A dm-mpath instance has been created on top of /dev/sda. > > > > > If all tags are in use by requests queued to /dev/sdb, no dm requests are in > > > > > progress and a request is submitted against the dm-mpath device then the > > > > > blk_get_request(q, GFP_ATOMIC) call will fail. The request will be requeued > > > > > and the queue will be rerun after a delay. > > > > > > > > > > My patch does not introduce a delay in this case. > > > > > > > > That delay may not matter because SCHED_RESTART will run queue just > > > > after one request is completed. > > > > > > Did you understand what I wrote? SCHED_RESTART will be set for /dev/sdb but not > > > for the dm queue. That's what I was trying to explain to you in my previous e-mail. > > > > The patch I posted in this thread will set SCHED_RESTART for dm queue. > > This is not how communication on an open source mailing list is assumed to work. > If you know that you are wrong you are assumed either to shut up or to admit it. You just mentioned 'This patch is inferior' and never explained my patch is wrong, so please go ahead and show me why this patch(the post in this thread, also the following link) is wrong. https://marc.info/?l=linux-block&m=150604412910113&w=2 I admit both are two ways for the issue, but I don't think my patch is wrong. Your approach can be a very big change because .queue_rq() will block, and I also mentioned it might cause AIO regression. I don't understand why you say there is communication issue since no much discussion yet in this thread. Please see the whole discussion: https://marc.info/?t=150604442500001&r=1&w=2 > And if you disagree with the detailed explanation I gave you are assumed to > explain in detail why you think it is wrong. -- Ming ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: dm-mpath: return DM_MAPIO_REQUEUE in case of rq allocation failure 2017-09-25 16:10 ` Ming Lei @ 2017-09-25 16:17 ` Mike Snitzer 2017-09-26 8:50 ` Ming Lei 0 siblings, 1 reply; 10+ messages in thread From: Mike Snitzer @ 2017-09-25 16:17 UTC (permalink / raw) To: Ming Lei Cc: Bart Van Assche, dm-devel@redhat.com, hch@infradead.org, linux-block@vger.kernel.org, axboe@fb.com, loberman@redhat.com On Mon, Sep 25 2017 at 12:10pm -0400, Ming Lei <ming.lei@redhat.com> wrote: > On Mon, Sep 25, 2017 at 03:23:16PM +0000, Bart Van Assche wrote: > > On Mon, 2017-09-25 at 11:06 +0800, Ming Lei wrote: > > > On Fri, Sep 22, 2017 at 05:54:48PM +0000, Bart Van Assche wrote: > > > > On Sat, 2017-09-23 at 01:44 +0800, Ming Lei wrote: > > > > > On Fri, Sep 22, 2017 at 03:06:16PM +0000, Bart Van Assche wrote: > > > > > > On Fri, 2017-09-22 at 09:35 +0800, Ming Lei wrote: > > > > > > > + /* > > > > > > > + * blk-mq's SCHED_RESTART can cover this requeue, so > > > > > > > + * we needn't to deal with it by DELAY_REQUEUE. More > > > > > > > + * importantly, we have to return DM_MAPIO_REQUEUE > > > > > > > + * so that blk-mq can get the queue busy feedback, > > > > > > > + * otherwise I/O merge can be hurt. > > > > > > > + */ > > > > > > > + if (q->mq_ops) > > > > > > > + return DM_MAPIO_REQUEUE; > > > > > > > + else > > > > > > > + return DM_MAPIO_DELAY_REQUEUE; > > > > > > > } > > > > > > > > > > > > This patch is inferior to what I posted because this patch does not avoid > > > > > > the delay if multiple LUNs are associated with the same SCSI host. Consider > > > > > > e.g. the following configuration: > > > > > > * A single SCSI host with two SCSI LUNs associated to that host, e.g. /dev/sda > > > > > > and /dev/sdb. > > > > > > * A dm-mpath instance has been created on top of /dev/sda. > > > > > > If all tags are in use by requests queued to /dev/sdb, no dm requests are in > > > > > > progress and a request is submitted against the dm-mpath device then the > > > > > > blk_get_request(q, GFP_ATOMIC) call will fail. The request will be requeued > > > > > > and the queue will be rerun after a delay. > > > > > > > > > > > > My patch does not introduce a delay in this case. > > > > > > > > > > That delay may not matter because SCHED_RESTART will run queue just > > > > > after one request is completed. > > > > > > > > Did you understand what I wrote? SCHED_RESTART will be set for /dev/sdb but not > > > > for the dm queue. That's what I was trying to explain to you in my previous e-mail. > > > > > > The patch I posted in this thread will set SCHED_RESTART for dm queue. > > > > This is not how communication on an open source mailing list is assumed to work. > > If you know that you are wrong you are assumed either to shut up or to admit it. Code speaks much better than unnecessarily caustic exchanges. Not sure why Bart persists with that.. but that's for him to sort out. > You just mentioned 'This patch is inferior' and never explained my patch > is wrong, so please go ahead and show me why this patch(the post in this > thread, also the following link) is wrong. > > https://marc.info/?l=linux-block&m=150604412910113&w=2 > > I admit both are two ways for the issue, but I don't think my patch > is wrong. Your approach can be a very big change because .queue_rq() > will block, and I also mentioned it might cause AIO regression. I have no interest in changing DM multipath to block in .queue_rq() So please consider that approach a dead end. Ming, just iterate on your revised patchset, test and post when you're happy with it. Thanks, Mike ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: dm-mpath: return DM_MAPIO_REQUEUE in case of rq allocation failure 2017-09-25 16:17 ` Mike Snitzer @ 2017-09-26 8:50 ` Ming Lei 2017-09-26 13:55 ` Bart Van Assche 0 siblings, 1 reply; 10+ messages in thread From: Ming Lei @ 2017-09-26 8:50 UTC (permalink / raw) To: Mike Snitzer Cc: Bart Van Assche, dm-devel@redhat.com, hch@infradead.org, linux-block@vger.kernel.org, axboe@fb.com, loberman@redhat.com On Mon, Sep 25, 2017 at 12:17:03PM -0400, Mike Snitzer wrote: > On Mon, Sep 25 2017 at 12:10pm -0400, > Ming Lei <ming.lei@redhat.com> wrote: > > > On Mon, Sep 25, 2017 at 03:23:16PM +0000, Bart Van Assche wrote: > > > On Mon, 2017-09-25 at 11:06 +0800, Ming Lei wrote: > > > > On Fri, Sep 22, 2017 at 05:54:48PM +0000, Bart Van Assche wrote: > > > > > On Sat, 2017-09-23 at 01:44 +0800, Ming Lei wrote: > > > > > > On Fri, Sep 22, 2017 at 03:06:16PM +0000, Bart Van Assche wrote: > > > > > > > On Fri, 2017-09-22 at 09:35 +0800, Ming Lei wrote: > > > > > > > > + /* > > > > > > > > + * blk-mq's SCHED_RESTART can cover this requeue, so > > > > > > > > + * we needn't to deal with it by DELAY_REQUEUE. More > > > > > > > > + * importantly, we have to return DM_MAPIO_REQUEUE > > > > > > > > + * so that blk-mq can get the queue busy feedback, > > > > > > > > + * otherwise I/O merge can be hurt. > > > > > > > > + */ > > > > > > > > + if (q->mq_ops) > > > > > > > > + return DM_MAPIO_REQUEUE; > > > > > > > > + else > > > > > > > > + return DM_MAPIO_DELAY_REQUEUE; > > > > > > > > } > > > > > > > > > > > > > > This patch is inferior to what I posted because this patch does not avoid > > > > > > > the delay if multiple LUNs are associated with the same SCSI host. Consider > > > > > > > e.g. the following configuration: > > > > > > > * A single SCSI host with two SCSI LUNs associated to that host, e.g. /dev/sda > > > > > > > and /dev/sdb. > > > > > > > * A dm-mpath instance has been created on top of /dev/sda. > > > > > > > If all tags are in use by requests queued to /dev/sdb, no dm requests are in > > > > > > > progress and a request is submitted against the dm-mpath device then the > > > > > > > blk_get_request(q, GFP_ATOMIC) call will fail. The request will be requeued > > > > > > > and the queue will be rerun after a delay. > > > > > > > > > > > > > > My patch does not introduce a delay in this case. > > > > > > > > > > > > That delay may not matter because SCHED_RESTART will run queue just > > > > > > after one request is completed. > > > > > > > > > > Did you understand what I wrote? SCHED_RESTART will be set for /dev/sdb but not > > > > > for the dm queue. That's what I was trying to explain to you in my previous e-mail. > > > > > > > > The patch I posted in this thread will set SCHED_RESTART for dm queue. > > > > > > This is not how communication on an open source mailing list is assumed to work. > > > If you know that you are wrong you are assumed either to shut up or to admit it. > > Code speaks much better than unnecessarily caustic exchanges. Not sure > why Bart persists with that.. but that's for him to sort out. > > > You just mentioned 'This patch is inferior' and never explained my patch > > is wrong, so please go ahead and show me why this patch(the post in this > > thread, also the following link) is wrong. > > > > https://marc.info/?l=linux-block&m=150604412910113&w=2 > > > > I admit both are two ways for the issue, but I don't think my patch > > is wrong. Your approach can be a very big change because .queue_rq() > > will block, and I also mentioned it might cause AIO regression. > > I have no interest in changing DM multipath to block in .queue_rq() > So please consider that approach a dead end. > > Ming, just iterate on your revised patchset, test and post when you're > happy with it. Hi Mike, If you don't consider to change mpath into block in .queue_rq() now, please take this patch first, and I am sure this way is correct, and even it can be thought as a fix. Thanks, Ming ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: dm-mpath: return DM_MAPIO_REQUEUE in case of rq allocation failure 2017-09-26 8:50 ` Ming Lei @ 2017-09-26 13:55 ` Bart Van Assche 0 siblings, 0 replies; 10+ messages in thread From: Bart Van Assche @ 2017-09-26 13:55 UTC (permalink / raw) To: ming.lei@redhat.com, snitzer@redhat.com Cc: dm-devel@redhat.com, hch@infradead.org, linux-block@vger.kernel.org, axboe@fb.com, loberman@redhat.com T24gVHVlLCAyMDE3LTA5LTI2IGF0IDE2OjUwICswODAwLCBNaW5nIExlaSB3cm90ZToNCj4gSWYg eW91IGRvbid0IGNvbnNpZGVyIHRvIGNoYW5nZSBtcGF0aCBpbnRvIGJsb2NrIGluIC5xdWV1ZV9y cSgpIG5vdywNCj4gcGxlYXNlIHRha2UgdGhpcyBwYXRjaCBmaXJzdCwgYW5kIEkgYW0gc3VyZSB0 aGlzIHdheSBpcyBjb3JyZWN0LCBhbmQNCj4gZXZlbiBpdCBjYW4gYmUgdGhvdWdodCBhcyBhIGZp eC4NCg0KQXMgSSBleHBsYWluZWQgZWFybGllciwgaXQgd291bGQgYmUgd3JvbmcgdG8gdGFrZSB0 aGlzIHBhdGNoIHVwc3RyZWFtIHdpdGhvdXQNCmhhdmluZyB0ZXN0ZWQgYW5kIG1lYXN1cmVkIHRo ZSBhbHRlcm5hdGl2ZSBJIGhhZCBwcm9wb3NlZCBmaXJzdA0KKGh0dHBzOi8vd3d3LnNwaW5pY3Mu bmV0L2xpc3RzL2RtLWRldmVsL21zZzMyMjgyLmh0bWwpLiBNeSBhbHRlcm5hdGl2ZSBoYW5kbGVz DQpTQ1NJIGhvc3RzIHdpdGggbXVsdGlwbGUgTFVOcyBwcm9wZXJseSBidXQgdGhlIHBhdGNoIGF0 IHRoZSBzdGFydCBvZiB0aGlzDQplLW1haWwgdGhyZWFkIG5vdC4NCg0KQmFydC4= ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2017-09-26 13:55 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2017-09-22 1:35 [PATCH] dm-mpath: return DM_MAPIO_REQUEUE in case of rq allocation failure Ming Lei 2017-09-22 15:06 ` Bart Van Assche 2017-09-22 17:44 ` Ming Lei 2017-09-22 17:54 ` Bart Van Assche 2017-09-25 3:06 ` Ming Lei 2017-09-25 15:23 ` Bart Van Assche 2017-09-25 16:10 ` Ming Lei 2017-09-25 16:17 ` Mike Snitzer 2017-09-26 8:50 ` Ming Lei 2017-09-26 13:55 ` Bart Van Assche
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox