diff for duplicates of <1516641182.2545.26.camel@sandisk.com> diff --git a/a/1.txt b/N1/1.txt index 5ed7347..909301d 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -1,63 +1,42 @@ -On Mon, 2018-01-22 at 11:35 +0800, Ming Lei wrote: -> DM-MPATH need to allocate request from underlying queue, but when the -> allocation fails, there is no way to make underlying queue's RESTART -> to restart DM's queue. -> -> This patch introduces blk_get_request_notify() for this purpose, and -> caller need to pass 'wait_queue_entry_t' to this function, and make -> sure it is initialized well, so after the current allocation fails, -> DM will get notified when there is request available from underlying -> queue. - -Please mention that this is only a partial solution because the case when -e.g. blk_insert_cloned_request() returns BLK_STS_RESOURCE is not handled. -This could help for drivers that support a very low queue depth (lpfc) but -probably won't be that useful for other drivers. - -> + /* -> + * If caller requires notification when tag is available, add -> + * wait entry of 'data->notifier' to the wait queue. -> + */ -> + if (data->flags & BLK_MQ_REQ_NOWAIT) { -> + bool added = false; -> + -> + spin_lock_irq(&ws->wait.lock); -> + if (list_empty(&data->notifier->entry)) -> + __add_wait_queue(&ws->wait, data->notifier); -> + else -> + added = true; -> + spin_unlock_irq(&ws->wait.lock); -> + -> + if (added) -> + return BLK_MQ_TAG_FAIL; -> + -> + tag = __blk_mq_get_tag(data, bt); -> + if (tag != -1) -> + goto found_tag; -> + return BLK_MQ_TAG_FAIL; -> + } - -Sorry but I don't like this approach. Adding "data->notifier" to the wait -queue creates a link between two request queues, e.g. a dm-mpath queue and -one of the paths that is a member of that dm-mpath queue. This creates the -potential for ugly races between e.g. "data->notifier" being triggered and -removal of the dm-mpath queue. - -> diff --git a/block/blk-mq.h b/block/blk-mq.h -> index 88c558f71819..bec2f675f8f1 100644 -> --- a/block/blk-mq.h -> +++ b/block/blk-mq.h -> @@ -160,6 +160,7 @@ struct blk_mq_alloc_data { -> struct request_queue *q; -> blk_mq_req_flags_t flags; -> unsigned int shallow_depth; -> + wait_queue_entry_t *notifier; - -If others would agree with the approach of this patch please use another name -than "notifier". In the context of the Linux kernel a notifier is an instance -of struct notifier_block. The above "notifier" member is not a notifier but a -wait queue entry. - -Thanks, - -Bart. +T24gTW9uLCAyMDE4LTAxLTIyIGF0IDExOjM1ICswODAwLCBNaW5nIExlaSB3cm90ZToNCj4gRE0t +TVBBVEggbmVlZCB0byBhbGxvY2F0ZSByZXF1ZXN0IGZyb20gdW5kZXJseWluZyBxdWV1ZSwgYnV0 +IHdoZW4gdGhlDQo+IGFsbG9jYXRpb24gZmFpbHMsIHRoZXJlIGlzIG5vIHdheSB0byBtYWtlIHVu +ZGVybHlpbmcgcXVldWUncyBSRVNUQVJUDQo+IHRvIHJlc3RhcnQgRE0ncyBxdWV1ZS4NCj4gDQo+ +IFRoaXMgcGF0Y2ggaW50cm9kdWNlcyBibGtfZ2V0X3JlcXVlc3Rfbm90aWZ5KCkgZm9yIHRoaXMg +cHVycG9zZSwgYW5kDQo+IGNhbGxlciBuZWVkIHRvIHBhc3MgJ3dhaXRfcXVldWVfZW50cnlfdCcg +dG8gdGhpcyBmdW5jdGlvbiwgYW5kIG1ha2UNCj4gc3VyZSBpdCBpcyBpbml0aWFsaXplZCB3ZWxs +LCBzbyBhZnRlciB0aGUgY3VycmVudCBhbGxvY2F0aW9uIGZhaWxzLA0KPiBETSB3aWxsIGdldCBu +b3RpZmllZCB3aGVuIHRoZXJlIGlzIHJlcXVlc3QgYXZhaWxhYmxlIGZyb20gdW5kZXJseWluZw0K +PiBxdWV1ZS4NCg0KUGxlYXNlIG1lbnRpb24gdGhhdCB0aGlzIGlzIG9ubHkgYSBwYXJ0aWFsIHNv +bHV0aW9uIGJlY2F1c2UgdGhlIGNhc2Ugd2hlbg0KZS5nLiBibGtfaW5zZXJ0X2Nsb25lZF9yZXF1 +ZXN0KCkgcmV0dXJucyBCTEtfU1RTX1JFU09VUkNFIGlzIG5vdCBoYW5kbGVkLg0KVGhpcyBjb3Vs +ZCBoZWxwIGZvciBkcml2ZXJzIHRoYXQgc3VwcG9ydCBhIHZlcnkgbG93IHF1ZXVlIG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WJlciBpcyBu +b3QgYSBub3RpZmllciBidXQgYQ0Kd2FpdCBxdWV1ZSBlbnRyeS4NCg0KVGhhbmtzLA0KDQpCYXJ0 +Lg== diff --git a/a/content_digest b/N1/content_digest index afa1e50..b89e719 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -12,68 +12,47 @@ " loberman@redhat.com <loberman@redhat.com>\0" "\00:1\0" "b\0" - "On Mon, 2018-01-22 at 11:35 +0800, Ming Lei wrote:\n" - "> DM-MPATH need to allocate request from underlying queue, but when the\n" - "> allocation fails, there is no way to make underlying queue's RESTART\n" - "> to restart DM's queue.\n" - "> \n" - "> This patch introduces blk_get_request_notify() for this purpose, and\n" - "> caller need to pass 'wait_queue_entry_t' to this function, and make\n" - "> sure it is initialized well, so after the current allocation fails,\n" - "> DM will get notified when there is request available from underlying\n" - "> queue.\n" - "\n" - "Please mention that this is only a partial solution because the case when\n" - "e.g. blk_insert_cloned_request() returns BLK_STS_RESOURCE is not handled.\n" - "This could help for drivers that support a very low queue depth (lpfc) but\n" - "probably won't be that useful for other drivers.\n" - "\n" - "> +\t/*\n" - "> +\t * If caller requires notification when tag is available, add\n" - "> +\t * wait entry of 'data->notifier' to the wait queue.\n" - "> +\t */\n" - "> +\tif (data->flags & BLK_MQ_REQ_NOWAIT) {\n" - "> +\t\tbool added = false;\n" - "> +\n" - "> +\t\tspin_lock_irq(&ws->wait.lock);\n" - "> +\t\tif (list_empty(&data->notifier->entry))\n" - "> +\t\t\t__add_wait_queue(&ws->wait, data->notifier);\n" - "> +\t\telse\n" - "> +\t\t\tadded = true;\n" - "> +\t\tspin_unlock_irq(&ws->wait.lock);\n" - "> +\n" - "> +\t\tif (added)\n" - "> +\t\t\treturn BLK_MQ_TAG_FAIL;\n" - "> +\n" - "> +\t\ttag = __blk_mq_get_tag(data, bt);\n" - "> +\t\tif (tag != -1)\n" - "> +\t\t\tgoto found_tag;\n" - "> +\t\treturn BLK_MQ_TAG_FAIL;\n" - "> +\t}\n" - "\n" - "Sorry but I don't like this approach. Adding \"data->notifier\" to the wait\n" - "queue creates a link between two request queues, e.g. a dm-mpath queue and\n" - "one of the paths that is a member of that dm-mpath queue. This creates the\n" - "potential for ugly races between e.g. \"data->notifier\" being triggered and\n" - "removal of the dm-mpath queue.\n" - "\n" - "> diff --git a/block/blk-mq.h b/block/blk-mq.h\n" - "> index 88c558f71819..bec2f675f8f1 100644\n" - "> --- a/block/blk-mq.h\n" - "> +++ b/block/blk-mq.h\n" - "> @@ -160,6 +160,7 @@ struct blk_mq_alloc_data {\n" - "> \tstruct request_queue *q;\n" - "> \tblk_mq_req_flags_t flags;\n" - "> \tunsigned int shallow_depth;\n" - "> +\twait_queue_entry_t *notifier;\n" - "\n" - "If others would agree with the approach of this patch please use another name\n" - "than \"notifier\". In the context of the Linux kernel a notifier is an instance\n" - "of struct notifier_block. The above \"notifier\" member is not a notifier but a\n" - "wait queue entry.\n" - "\n" - "Thanks,\n" - "\n" - Bart. + "T24gTW9uLCAyMDE4LTAxLTIyIGF0IDExOjM1ICswODAwLCBNaW5nIExlaSB3cm90ZToNCj4gRE0t\n" + "TVBBVEggbmVlZCB0byBhbGxvY2F0ZSByZXF1ZXN0IGZyb20gdW5kZXJseWluZyBxdWV1ZSwgYnV0\n" + "IHdoZW4gdGhlDQo+IGFsbG9jYXRpb24gZmFpbHMsIHRoZXJlIGlzIG5vIHdheSB0byBtYWtlIHVu\n" + "ZGVybHlpbmcgcXVldWUncyBSRVNUQVJUDQo+IHRvIHJlc3RhcnQgRE0ncyBxdWV1ZS4NCj4gDQo+\n" + "IFRoaXMgcGF0Y2ggaW50cm9kdWNlcyBibGtfZ2V0X3JlcXVlc3Rfbm90aWZ5KCkgZm9yIHRoaXMg\n" + "cHVycG9zZSwgYW5kDQo+IGNhbGxlciBuZWVkIHRvIHBhc3MgJ3dhaXRfcXVldWVfZW50cnlfdCcg\n" + "dG8gdGhpcyBmdW5jdGlvbiwgYW5kIG1ha2UNCj4gc3VyZSBpdCBpcyBpbml0a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ay1tcS5oDQo+ICsrKyBiL2Jsb2NrL2Jsay1tcS5o\n" + "DQo+IEBAIC0xNjAsNiArMTYwLDcgQEAgc3RydWN0IGJsa19tcV9hbGxvY19kYXRhIHsNCj4gIAlz\n" + "dHJ1Y3QgcmVxdWVzdF9xdWV1ZSAqcTsNCj4gIAlibGtfbXFfcmVxX2ZsYWdzX3QgZmxhZ3M7DQo+\n" + "ICAJdW5zaWduZWQgaW50IHNoYWxsb3dfZGVwdGg7DQo+ICsJd2FpdF9xdWV1ZV9lbnRyeV90ICpu\n" + "b3RpZmllcjsNCg0KSWYgb3RoZXJzIHdvdWxkIGFncmVlIHdpdGggdGhlIGFwcHJvYWNoIG9mIHRo\n" + "aXMgcGF0Y2ggcGxlYXNlIHVzZSBhbm90aGVyIG5hbWUNCnRoYW4gIm5vdGlmaWVyIi4gSW4gdGhl\n" + "IGNvbnRleHQgb2YgdGhlIExpbnV4IGtlcm5lbCBhIG5vdGlmaWVyIGlzIGFuIGluc3RhbmNlDQpv\n" + "ZiBzdHJ1Y3Qgbm90aWZpZXJfYmxvY2suIFRoZSBhYm92ZSAibm90aWZpZXIiIG1lbWJlciBpcyBu\n" + "b3QgYSBub3RpZmllciBidXQgYQ0Kd2FpdCBxdWV1ZSBlbnRyeS4NCg0KVGhhbmtzLA0KDQpCYXJ0\n" + Lg== -256da21c1c317aad552443483ffdc871c7972d503a25f32e9b00c363510ea462 +a59010f546fd9c864866efd874cbf54300a0bbbaa2fd6f60062eb8a71bed86a1
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.