From patchwork Thu Jan 26 21:51:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 9540157 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 52ADC601D7 for ; Thu, 26 Jan 2017 21:53:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4868E2830A for ; Thu, 26 Jan 2017 21:53:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3D0D728324; Thu, 26 Jan 2017 21:53:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B4C782830A for ; Thu, 26 Jan 2017 21:53:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753617AbdAZVxp (ORCPT ); Thu, 26 Jan 2017 16:53:45 -0500 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:53250 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753810AbdAZVxD (ORCPT ); Thu, 26 Jan 2017 16:53:03 -0500 Received: from pps.filterd (m0109331.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v0QLmCAV009123; Thu, 26 Jan 2017 13:52:00 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=subject : to : references : cc : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=facebook; bh=ye27xksUWfBpCwaqSf728pkXigy/82ftJ2GCRbDNs3M=; b=MHW0jqRc8F2Hj2UTnMNdnx4ZGh/mejBe0v49LJF6HI3e2QR6eXDTEt8LdJcmT9Dkh1LX 6Q/Oqdfzgpf0O0Oa9hIgh1r2GlDsOll3uJ1Lm8zzTEgDg4zF6Z7LAb0HJacrNOsaeqIj zg1zCyu/DwbCa//1iMMhCLhbe/YpGBrEbhQ= Received: from maileast.thefacebook.com ([199.201.65.23]) by mx0a-00082601.pphosted.com with ESMTP id 287pqh8j41-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 26 Jan 2017 13:52:00 -0800 Received: from NAM03-CO1-obe.outbound.protection.outlook.com (192.168.183.28) by o365-in.thefacebook.com (192.168.177.23) with Microsoft SMTP Server (TLS) id 14.3.294.0; Thu, 26 Jan 2017 16:51:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.onmicrosoft.com; s=selector1-fb-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=ye27xksUWfBpCwaqSf728pkXigy/82ftJ2GCRbDNs3M=; b=KYISPGJNeiQRJ6fq4qGqKk8LpIhOr4Xhvi47ta74r08n1L35I2YBt00aQxPezhp3WtAOIVwney+TUXkfc5m4XPB7cHdvQvHTiFBDXKppNyC6bVLGlqoqyLcq1OXek02Ayj71ZdQyOxL3kMrRma7slGLkRQtoBZj0M0iy1n6/m/c= Received: from [192.168.1.154] (216.160.245.98) by CY4PR15MB1191.namprd15.prod.outlook.com (10.172.177.13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.860.13; Thu, 26 Jan 2017 21:51:55 +0000 Subject: Re: [dm-devel] split scsi passthrough fields out of struct request V2 To: Bart Van Assche , "hch@lst.de" References: <1485365126-23210-1-git-send-email-hch@lst.de> <1485455329.2540.7.camel@sandisk.com> <1485456745.2540.9.camel@sandisk.com> <20170126185924.GA25289@lst.de> <71e22257-0592-fdd3-25e5-a78ceced2ab9@sandisk.com> <4054e944-b28d-1cd6-574f-6cd90e28c301@fb.com> <1485464486.2540.12.camel@sandisk.com> <6995c991-65a4-8dca-c36e-fb2eff277ca9@fb.com> <1485467235.2540.14.camel@sandisk.com> CC: "linux-scsi@vger.kernel.org" , "linux-raid@vger.kernel.org" , "dm-devel@redhat.com" , "linux-block@vger.kernel.org" , "snitzer@redhat.com" , "j-nomura@ce.jp.nec.com" From: Jens Axboe Message-ID: Date: Thu, 26 Jan 2017 14:51:52 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <1485467235.2540.14.camel@sandisk.com> X-Originating-IP: [216.160.245.98] X-ClientProxiedBy: MWHPR13CA0026.namprd13.prod.outlook.com (10.173.117.140) To CY4PR15MB1191.namprd15.prod.outlook.com (10.172.177.13) X-MS-Office365-Filtering-Correlation-Id: 17c9d8fc-e82c-4317-2c8a-08d446358c05 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:CY4PR15MB1191; X-Microsoft-Exchange-Diagnostics: 1; CY4PR15MB1191; 3:Uis7bjPFRd1SCgE10hZFeb27dWlcXDtXyf2Kl2xG0wYvfE5Q1XqJ96Kx7ZXUxPZ5bHkb57pl2U2B5xPBDKOfIQCS9vB0Jj0jjtITleJ1M8crCv9is6uji6oWK3UHvrDZ4BhBM4UPnHVGxCCQaIuXFmE6QDpSxtpJGxSMKN+7aboNDE21ED2sF8nreJcAUKr37lg5rgamrQZSeDwLp81hPFLsjljfdwfHEtTHWjA9WNkDF3tilfZXHkojB8iFKXErawIR45ZrhepQh+Mb6CcCVA==; 25:N9XDKSVR0Aat+ljkM7eVyhwvtgzZgtB2/Z90LSudO5tiynUM3Bw54KeV1ve9F1yBH1xxs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y9H2YR0VBK7qhmAOB9joT45CChBSdD38rqx40qmVYBetr1JeVXr3EiHris6LHG26a9GHjSLjiCk2KPuVWg2S8qttZKlp/mJeZEkYVdKJQPRNWFqEWrSqPTQiCIpSOL21Q7XH8An2ObQ4NNoVKLFlC3FpsTZ8gc7R0ggE6w0xSaJlCYEOqbo4ljPU X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6041248)(20161123555025)(20161123562025)(20161123560025)(20161123564025)(6072148); SRVR:CY4PR15MB1191; BCL:0; PCL:0; RULEID:; SRVR:CY4PR15MB1191; X-Microsoft-Exchange-Diagnostics: 1; CY4PR15MB1191; 4:tzlPQsqnJOl62FfCTJvNdVrNEYqk1Nge9r/rH+W6Mxq6RpLsG7+dcwpTokb6WpKbpEttsjAhS8CsoJMNIIe0yOE1MxiYeZLkO6OIIlzV0NfVtHsRatVaB3i7u0bunKSY4jPXRRocClBwt1cobW22NnIBloNAMdBo34+F2Q0Mfh6WYU0GsW5+YTFvlb9AARAVaeuHg+WW0yLbrVLVbQ7YD+3cPO1Yuaaf9sQbyDLhvfATWjdBRqXElr43pZtjozhMhSZoyz40M1TscTPq8xCjq59hgoSolhT/DChDPEFlcE5sYnrVQ1oQjjQHZtTus0pQK9P2THJVIEnE+IhLt9r5o9ARlN/BsH20c0SlGZpYIUEkTPLPmDbQDPBN1Ci8WY1WWnOSHEJ82F4Es5D68I+M43tEZsKLGLZ8P2naYUxrrjCAEmoyi9t/VvaP4ka8SsS14W9EdiUmQyvDKPCBO7hNRF+AUZ+pzSf2VNWlOJM8T22Z8d50eWzzsQipLO2XIEUTjM+2kb2LSzAvZOTLE7Y01+/V3X9VYiME2vA4F28q6eUsObMi3E8UthsNAeZjxWrvX22FSOM1+OSqhe3fjSxdNQ== X-Forefront-PRVS: 019919A9E4 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(6049001)(7916002)(39450400003)(39830400002)(39410400002)(189002)(199003)(377454003)(24454002)(90366009)(50466002)(86362001)(64126003)(230700001)(6486002)(77096006)(101416001)(25786008)(8656002)(83506001)(2501003)(54906002)(68736007)(54356999)(31696002)(76176999)(38730400001)(3846002)(6116002)(6666003)(189998001)(33646002)(97736004)(36756003)(81156014)(5660300001)(65826007)(31686004)(50986999)(81166006)(1691005)(42186005)(8676002)(2950100002)(53936002)(66066001)(65956001)(65806001)(4001350100001)(105586002)(117156001)(23746002)(93886004)(106356001)(2906002)(229853002)(7736002)(305945005)(5001770100001)(4326007)(47776003)(92566002); DIR:OUT; SFP:1102; SCL:1; SRVR:CY4PR15MB1191; H:[192.168.1.154]; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: fb.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; CY4PR15MB1191; 23:iueLCUOshTXsqRbr2/MAhLBimRjpDDvFzZ6/e?= =?Windows-1252?Q?QRbm1+HRWkePQnpQluZwKysQRpe4MkBTNQJECCbSZsmLlFOpLGFylDm/?= =?Windows-1252?Q?VmX5zf5JCupxmbv7DjEQu4chOx4GLvNUtmjGwGqhAlJ6dANErjS717/e?= =?Windows-1252?Q?HjPkpN7OBQ7/s3FbwfQIuPvkb62CZOPmciFO3mzyvS0OLnp7ke98+hE4?= =?Windows-1252?Q?jYbeumDC5v7ldymDwy4Hws2nfNnQgVu6w3Hts7YLjS+M0QHdtSsjNe85?= =?Windows-1252?Q?Npqd9wGir+2IPbkVkOzBAo2czlkG7LPUE3BwsQQSxx8foKOm2V+hoQFE?= =?Windows-1252?Q?WKJblYsCEdRtHjgUjNsqxabk5+MmKhNphl7CNKoWH4Sh897h+Lul4rq8?= =?Windows-1252?Q?2Ut+1hmL+f3WUsmQ0mgRZczMuvMYa4DCIrZI4dc6t/AK7NvtwsE0lWMz?= =?Windows-1252?Q?FWvbXdIcld6MHPk6GXhVpsug1aNmOB+C6lO7HEF3SzFIMHiHPldM/D6z?= =?Windows-1252?Q?Zg5hRlEoYue9LX0I6Izo7H22dpHsgjx4af34eU4vN0UDfvlT+f4dlHmW?= =?Windows-1252?Q?jV+8qIkE6wdh6MChBsEzKWzKxGKWbknH9NRmI+UbtKvsj0wDMT6CB6Yz?= =?Windows-1252?Q?K2pjCes5Hh3LhfwyZlv2tXtdGi4WOUEB+8dMHnVmgR5mBE+cs1Y6y7Yw?= =?Windows-1252?Q?ELPSKY3U2jZV7igxz+EYZgLYR8bbSRJYkrkJvSGrYfv64NJUnbiIsF3+?= =?Windows-1252?Q?Qpi61LLVNMks6BdWMBEuKmKrQXRwVwMZy/sWGhyfUYmQMbkERWCQGfFU?= =?Windows-1252?Q?KR77Is0yRC0EbQDPTuI/5CFa9juor6pP+MwFKgdys61eUnXXTUrm7vw7?= =?Windows-1252?Q?TpWD7DopS8GsuK6fwnF2Vpz01E7RGUsEnR8TZX40SNbiWLy1aZPrAN/A?= =?Windows-1252?Q?xxV1nK+rt0EsInoCuGMgPuFn+NHzffvdewM1L3u28ijt0xTmuQ8jT6cF?= =?Windows-1252?Q?a+Lk6I7j+q5URXxo+VMVVf3LEs1QOfTyYmuZVIzkdyyY8geYLqEMmsK2?= =?Windows-1252?Q?nMk0OKooOp9mjx7OAkxM3LHHVWiX9BZxaX5msCH5R+za2ZsEnPd2x8yz?= =?Windows-1252?Q?BcfudzI0CTa8jE0SXf4ULzeHJ/myG2zbYZRIrEf2YmuH8om86PCALj/A?= =?Windows-1252?Q?EFHUSAsN2q2nRZd6m4ZfpMnXnYZYIyysVneXm0DTWOewme779ug6P7JX?= =?Windows-1252?Q?uAU5WFIOPUjidpwv6lClyL/y97+7dEQcB8zqJHWcwEWZTyyX0v/lb95P?= =?Windows-1252?Q?EOHRa9ooycSOMgrdLFrn2cFwyS0qDmCOsY7qA0lLqYJ5ZfUmEVF7wlSl?= =?Windows-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amDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR15MB1191; 7:cL+hTQzvvQ78qsIarNb2NHOnnipw+8wtu6jieYYvHu+ST+4MovnCXGn4gISIejXyEtV7gkr7klGK8nnlXtJ4lLv2D+llIeL2evdQGs+/NprN/PVG3DFWh1MxQTyVXwHRDLQc0i4D8u5RqMHNAWEYUvTKniWQm+lonVpul095kvpkcEwMNq4+mr7i/8xVCwnf1etXdjhAK4LZgo4VWKutiI9NwQyTzKdKT5TIUIQ+YNIaamq9LvyAEt5xOjOCeQUulUWTNBKzaFi7sPQyc2mm0FulwLnGvL9eLvolxOCCmYejsAraH5rgLkhC3j9WvYU0elWHQSlMSXTclvW/FbESZkgLteKasOrlJievP295ps/aTKSz427yB9MZmNWlmVsiAtwpmSsyccrjxmAtTfc8CIxlUMGITIXjYrB4QABlT9IR8kxcDujeIe2DWbaiURHzfHV9Wz1xMYEbv5eqZV3uyw==; 20:WQRKSRyYenP7rTFP74EgE1Qm8BLWwdAKN4373ywcvE3fVv/N54TJdopKo7Ab1egHJFPQJ6D13MRJojT1CVx1N7ZY1ukeonEJZw89BOVLhKd6MRvy/d2+eF+L88M2IO4UbONJv2fys6f55UBgAAI+9fV9fsY4RsXI3e7TZOm0EqQ= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2017 21:51:55.6678 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR15MB1191 X-OriginatorOrg: fb.com X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-01-26_15:, , signatures=0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 01/26/2017 02:47 PM, Bart Van Assche wrote: > (gdb) list *(blk_mq_sched_get_request+0x310) > 0xffffffff8132dcf0 is in blk_mq_sched_get_request (block/blk-mq-sched.c:136). > 131 rq->rq_flags |= RQF_QUEUED; > 132 } else > 133 rq = __blk_mq_alloc_request(data, op); > 134 } else { > 135 rq = __blk_mq_alloc_request(data, op); > 136 data->hctx->tags->rqs[rq->tag] = rq; > 137 } > 138 > 139 if (rq) { > 140 if (!op_is_flush(op)) { > > (gdb) disas blk_mq_sched_get_request > [ ... ] > 0xffffffff8132dce3 <+771>: callq 0xffffffff81324ab0 <__blk_mq_alloc_request> > 0xffffffff8132dce8 <+776>: mov %rax,%rcx > 0xffffffff8132dceb <+779>: mov 0x18(%r12),%rax > 0xffffffff8132dcf0 <+784>: movslq 0x5c(%rcx),%rdx > [ ... ] > (gdb) print &((struct request *)0)->tag > $1 = (int *) 0x5c > > I think this means that rq == NULL and that a test for rq is missing after the > __blk_mq_alloc_request() call? That is exactly what it means, looks like that one path doesn't handle that. You'd have to exhaust the pool with atomic allocs for this to trigger, we don't do that at all in the normal IO path. So good catch, must be the dm part that enables this since it does NOWAIT allocations. diff --git a/block/blk-mq-sched.c b/block/blk-mq-sched.c index 3136696f4991..c27613de80c5 100644 --- a/block/blk-mq-sched.c +++ b/block/blk-mq-sched.c @@ -134,7 +134,8 @@ struct request *blk_mq_sched_get_request(struct request_queue *q, rq = __blk_mq_alloc_request(data, op); } else { rq = __blk_mq_alloc_request(data, op); - data->hctx->tags->rqs[rq->tag] = rq; + if (rq) + data->hctx->tags->rqs[rq->tag] = rq; } if (rq) {