[{"id":1731121,"web_url":"http://patchwork.ozlabs.org/comment/1731121/","msgid":"<5b85a365-faa1-3987-9b6b-270399c30686@kernel.dk>","date":"2017-07-27T16:26:29","subject":"Re: blk_mq_sched_insert_request: inconsistent {SOFTIRQ-ON-W} ->\n\t{IN-SOFTIRQ-W} usage","submitter":{"id":4515,"url":"http://patchwork.ozlabs.org/api/people/4515/","name":"Jens Axboe","email":"axboe@kernel.dk"},"content":"On 07/27/2017 08:47 AM, Bart Van Assche wrote:\n> On Thu, 2017-07-27 at 08:02 -0600, Jens Axboe wrote:\n>> The bug looks like SCSI running the queue inline from IRQ\n>> context, that's not a good idea. Can you confirm the below works for\n>> you?\n>>\n>>\n>> diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c\n>> index f6097b89d5d3..78740ebf966c 100644\n>> --- a/drivers/scsi/scsi_lib.c\n>> +++ b/drivers/scsi/scsi_lib.c\n>> @@ -497,7 +497,7 @@ static void scsi_run_queue(struct request_queue *q)\n>>  \t\tscsi_starved_list_run(sdev->host);\n>>  \n>>  \tif (q->mq_ops)\n>> -\t\tblk_mq_run_hw_queues(q, false);\n>> +\t\tblk_mq_run_hw_queues(q, true);\n>>  \telse\n>>  \t\tblk_run_queue(q);\n>>  }\n> \n> Hello Jens,\n> \n> scsi_run_queue() works fine if no scheduler is configured. Additionally, that\n> code predates the introduction of blk-mq I/O schedulers. I think it is\n> nontrivial for block driver authors to figure out that a queue has to be run\n> from process context if a scheduler has been configured that does not support\n> to be run from interrupt context.\n\nNo it doesn't, you could never run the queue from interrupt context with\nasync == false. So I don't think that's confusing at all, you should\nalways be aware of the context.\n\n> How about adding WARN_ON_ONCE(in_interrupt()) to\n> blk_mq_start_hw_queue() or replacing the above patch by the following:\n\nNo, I hate having dependencies like that, because they always just catch\none of them. Looks like the IPR path that hits this should just offload\nto a workqueue or similar, you don't have to make any scsi_run_queue()\nasync.","headers":{"Return-Path":"<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>","X-Original-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xJHTT1lqrz9rxm\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri, 28 Jul 2017 02:28:13 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xJHTT0dXnzDrKs\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri, 28 Jul 2017 02:28:13 +1000 (AEST)","from mail-it0-x22b.google.com (mail-it0-x22b.google.com\n\t[IPv6:2607:f8b0:4001:c0b::22b])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128\n\tbits)) (No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xJHRZ0VgBzDrGp\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tFri, 28 Jul 2017 02:26:33 +1000 (AEST)","by mail-it0-x22b.google.com with SMTP id h199so85148960ith.0\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tThu, 27 Jul 2017 09:26:33 -0700 (PDT)","from [192.168.1.154] ([216.160.245.98])\n\tby smtp.gmail.com with ESMTPSA id\n\tj15sm6240715ioo.27.2017.07.27.09.26.30\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tThu, 27 Jul 2017 09:26:30 -0700 (PDT)"],"Authentication-Results":["ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=kernel-dk.20150623.gappssmtp.com\n\theader.i=@kernel-dk.20150623.gappssmtp.com\n\theader.b=\"BYjzJqgq\"; dkim-atps=neutral","lists.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=kernel-dk.20150623.gappssmtp.com\n\theader.i=@kernel-dk.20150623.gappssmtp.com\n\theader.b=\"BYjzJqgq\"; dkim-atps=neutral","lists.ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=kernel-dk.20150623.gappssmtp.com\n\theader.i=@kernel-dk.20150623.gappssmtp.com header.b=\"BYjzJqgq\"; \n\tdkim-atps=neutral"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=kernel-dk.20150623.gappssmtp.com; s=20150623;\n\th=subject:to:cc:references:from:message-id:date:user-agent\n\t:mime-version:in-reply-to:content-language:content-transfer-encoding; \n\tbh=xqdDzoJWZWYmAd/vkxwcHN5jxBCusr/M5CTQ7CPD+6c=;\n\tb=BYjzJqgq25xzxUpB3qTF3gOY5CmKIFf2IjkdhaxG9eUAF6pwwX7X2Osr8qy07nhD85\n\tocY0f9QLQYbJgyLdSaBXXaHi5UgCVZKMva0ZLccRnmE27A9k3dcoLQ0XYaYhSM9CycJW\n\tduFl2yooqyG8NWARD6Fjw18l/YYxKghGYLOjph/5iBJBcCcmUktR6pw/5K71cXgWb1gw\n\t+PfQbM2e478qMA8uIypJqcutjX7glkwh5IXn5q8ub5avndqpeZnkuvTActhlalgb4++8\n\twP0Qd9whi30+BCfA9I4lXMdZXMv1si/fGyy4H4aRKgev4eCOKT1Y7L/5ziiwKXI1Q1FA\n\tQMuA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:subject:to:cc:references:from:message-id:date\n\t:user-agent:mime-version:in-reply-to:content-language\n\t:content-transfer-encoding;\n\tbh=xqdDzoJWZWYmAd/vkxwcHN5jxBCusr/M5CTQ7CPD+6c=;\n\tb=frfrtHOvhQb4SoG2gjBGZKZSvrCMVYYSarrGHArwhilNiVk0lCOjy8cbwu5dY/LGic\n\twOt3oYJZgIZiG6JOwq+YIa7j+mvNH9arDPwlmcYVH7Mg2VoI39wyz0BTL8Q6COO5YU5h\n\tRe5IrfQ09fbBuoZdluQd7ucR0DEoGu7folUXwhnAeLDAG3ytO6ZDoYrbEH5ALgkY33LX\n\tZY1jsjTt9k/VRJ6X27JhT8ZxUQ7D7543Ptvdyb46ecpm+35zJpMsSR6jWqe3oyJMD3Hp\n\tpsl212G3QjWdB2nDkQf/sVHHB9DczTfQIZMYE7CyICZY8uuKVUCApkY1zFj4S/DA80Rb\n\tvUCw==","X-Gm-Message-State":"AIVw113e3sXjtCz/GwmDeyYaAA9WkDW97Aw1B4vh1wAtjSRZaF1S1dKg\n\tecF1H073sHkeBv2ZtXXPfA==","X-Received":"by 10.36.135.202 with SMTP id f193mr5630017ite.48.1501172791619; \n\tThu, 27 Jul 2017 09:26:31 -0700 (PDT)","Subject":"Re: blk_mq_sched_insert_request: inconsistent {SOFTIRQ-ON-W} ->\n\t{IN-SOFTIRQ-W} usage","To":"Bart Van Assche <Bart.VanAssche@wdc.com>,\n\t\"mpe@ellerman.id.au\" <mpe@ellerman.id.au>","References":"<87a83qfosu.fsf@concordia.ellerman.id.au>\n\t<073ed79c-11ce-e86c-a905-91fd28675d47@kernel.dk>\n\t<1501166846.2516.1.camel@wdc.com>","From":"Jens Axboe <axboe@kernel.dk>","Message-ID":"<5b85a365-faa1-3987-9b6b-270399c30686@kernel.dk>","Date":"Thu, 27 Jul 2017 10:26:29 -0600","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.2.1","MIME-Version":"1.0","In-Reply-To":"<1501166846.2516.1.camel@wdc.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"7bit","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"Linux on PowerPC Developers Mail List\n\t<linuxppc-dev.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/linuxppc-dev/>","List-Post":"<mailto:linuxppc-dev@lists.ozlabs.org>","List-Help":"<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>","Cc":"\"linux-block@vger.kernel.org\" <linux-block@vger.kernel.org>,\n\t\"linuxppc-dev@lists.ozlabs.org\" <linuxppc-dev@lists.ozlabs.org>,\n\t\"linux-kernel@vger.kernel.org\" <linux-kernel@vger.kernel.org>","Errors-To":"linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org","Sender":"\"Linuxppc-dev\"\n\t<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>"}},{"id":1731650,"web_url":"http://patchwork.ozlabs.org/comment/1731650/","msgid":"<87lgn9dqx3.fsf@concordia.ellerman.id.au>","date":"2017-07-28T06:19:36","subject":"Re: blk_mq_sched_insert_request: inconsistent {SOFTIRQ-ON-W} ->\n\t{IN-SOFTIRQ-W} usage","submitter":{"id":46580,"url":"http://patchwork.ozlabs.org/api/people/46580/","name":"Michael Ellerman","email":"mpe@ellerman.id.au"},"content":"Jens Axboe <axboe@kernel.dk> writes:\n> On 07/27/2017 08:47 AM, Bart Van Assche wrote:\n>> On Thu, 2017-07-27 at 08:02 -0600, Jens Axboe wrote:\n>>> The bug looks like SCSI running the queue inline from IRQ\n>>> context, that's not a good idea.\n...\n>> \n>> scsi_run_queue() works fine if no scheduler is configured. Additionally, that\n>> code predates the introduction of blk-mq I/O schedulers. I think it is\n>> nontrivial for block driver authors to figure out that a queue has to be run\n>> from process context if a scheduler has been configured that does not support\n>> to be run from interrupt context.\n>\n> No it doesn't, you could never run the queue from interrupt context with\n> async == false. So I don't think that's confusing at all, you should\n> always be aware of the context.\n>\n>> How about adding WARN_ON_ONCE(in_interrupt()) to\n>> blk_mq_start_hw_queue() or replacing the above patch by the following:\n>\n> No, I hate having dependencies like that, because they always just catch\n> one of them. Looks like the IPR path that hits this should just offload\n> to a workqueue or similar, you don't have to make any scsi_run_queue()\n> async.\n\nOK, so the resolution is \"fix it in IPR\" ?\n\ncheers","headers":{"Return-Path":"<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>","X-Original-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@ozlabs.org","linuxppc-dev@lists.ozlabs.org"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xJdy84w2kz9s03\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri, 28 Jul 2017 16:20:48 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xJdy83tSqzDrSJ\n\tfor <patchwork-incoming@ozlabs.org>;\n\tFri, 28 Jul 2017 16:20:48 +1000 (AEST)","from ozlabs.org (ozlabs.org [IPv6:2401:3900:2:1::2])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xJdwn14LzzDrMS\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tFri, 28 Jul 2017 16:19:37 +1000 (AEST)","from authenticated.ozlabs.org (localhost [127.0.0.1])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPSA id 3xJdwm6lXTz9s65;\n\tFri, 28 Jul 2017 16:19:36 +1000 (AEST)"],"From":"Michael Ellerman <mpe@ellerman.id.au>","To":"Jens Axboe <axboe@kernel.dk>, Bart Van Assche <Bart.VanAssche@wdc.com>, \n\tBrian J King  <bjking1@us.ibm.com>","Subject":"Re: blk_mq_sched_insert_request: inconsistent {SOFTIRQ-ON-W} ->\n\t{IN-SOFTIRQ-W} usage","In-Reply-To":"<5b85a365-faa1-3987-9b6b-270399c30686@kernel.dk>","References":"<87a83qfosu.fsf@concordia.ellerman.id.au>\n\t<073ed79c-11ce-e86c-a905-91fd28675d47@kernel.dk>\n\t<1501166846.2516.1.camel@wdc.com>\n\t<5b85a365-faa1-3987-9b6b-270399c30686@kernel.dk>","User-Agent":"Notmuch/0.21 (https://notmuchmail.org)","Date":"Fri, 28 Jul 2017 16:19:36 +1000","Message-ID":"<87lgn9dqx3.fsf@concordia.ellerman.id.au>","MIME-Version":"1.0","Content-Type":"text/plain","X-BeenThere":"linuxppc-dev@lists.ozlabs.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"Linux on PowerPC Developers Mail List\n\t<linuxppc-dev.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/linuxppc-dev/>","List-Post":"<mailto:linuxppc-dev@lists.ozlabs.org>","List-Help":"<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>","Cc":"\"linux-block@vger.kernel.org\" <linux-block@vger.kernel.org>,\n\t\"linuxppc-dev@lists.ozlabs.org\" <linuxppc-dev@lists.ozlabs.org>,\n\t\"linux-kernel@vger.kernel.org\" <linux-kernel@vger.kernel.org>","Errors-To":"linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org","Sender":"\"Linuxppc-dev\"\n\t<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>"}}]