Received: by 10.192.165.148 with SMTP id m20csp570431imm; Wed, 25 Apr 2018 04:27:17 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqCdC0zDqWCZig6FMj/6H2PFAjtUtiRR59J9RhxTLKAmmURjoVs+fRZpP2YsaoBa9rM/cQl X-Received: by 2002:a17:902:5902:: with SMTP id o2-v6mr6568712pli.79.1524655637285; Wed, 25 Apr 2018 04:27:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524655637; cv=none; d=google.com; s=arc-20160816; b=KkvMIYTmSpuW+rAgc3X0d8D7UegHjr308tLYtsLyVbRLBWRlsaS/iTcioRf/T40GI0 dMQ0r9q6mHywTnFl3Ifvo9Z9/vr9qT/xiehnLjFS1m+Ygjc5b8SKoOYRnlY4WWHpgL1/ aYmfDR+I2Jc3PNre8zCvj3RGG5nedFeYnS+KCDAyc6iU2dzrPOq2HKHJJS5J+fQZqN6k ev9sw5qRET6gaWBKjY0WELgwk/dPSR3Pe3FweYJW747TMwX36VB4rpCyzfdVAPCI6KP8 5ISQlSR8w1GURYlaRizzRdLtBKOeZDF8UxuS1NEMzQAJOa6AFJrzv714jgfWGJOWB7Nt X++w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=fkDgSCACzuACG/zLUYfvBMCHlaITGc68KMd5cC7zq4s=; b=fSk4GbEYPVbcQ9cz25dwgjmC1kUv+qbXB8HKkVo+JA1wFPfPrMGzMK8ydJ/qcS5Qb6 MJpj3mjxHk/9n/FzsoKzDAxmrMYW/b1qQ0WsnFbVZdoZHe+x42KWYWONWkSMmx0b8vGD imlrj3ragArmbzhpDA3P/rka4eviAMprBAjNVG6DU+qSt6dNRfMOZvCxeqjsODWTv8CT 3nmRKzhG4iVATbX1JhbyZ99sFC9noswy99JH/cLLQ2nBnDX5Dm39I0fWAaaAmUTLPgi7 KvxlQr/4sWabBWEuS0nlZDvjoloj6Q8KoMOWjuIgpcnYmb+nIwhcEpdVZo9PfDpVxz8J 0eig== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v23si13397317pfl.233.2018.04.25.04.27.03; Wed, 25 Apr 2018 04:27:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753542AbeDYL0E (ORCPT + 99 others); Wed, 25 Apr 2018 07:26:04 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:51668 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752964AbeDYKiu (ORCPT ); Wed, 25 Apr 2018 06:38:50 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 0485236; Wed, 25 Apr 2018 10:38:50 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christian Borntraeger , Stefan Haberland , Christoph Hellwig , Thomas Gleixner , "jianchao.wang" , Ming Lei , Jens Axboe , Sasha Levin Subject: [PATCH 4.14 048/183] blk-mq: turn WARN_ON in __blk_mq_run_hw_queue into printk Date: Wed, 25 Apr 2018 12:34:28 +0200 Message-Id: <20180425103244.490454373@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180425103242.532713678@linuxfoundation.org> References: <20180425103242.532713678@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ming Lei [ Upstream commit 7df938fbc4ee641e70e05002ac67c24b19e86e74 ] We know this WARN_ON is harmless and in reality it may be trigged, so convert it to printk() and dump_stack() to avoid to confusing people. Also add comment about two releated races here. Cc: Christian Borntraeger Cc: Stefan Haberland Cc: Christoph Hellwig Cc: Thomas Gleixner Cc: "jianchao.wang" Signed-off-by: Ming Lei Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- block/blk-mq.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -1143,9 +1143,27 @@ static void __blk_mq_run_hw_queue(struct /* * We should be running this queue from one of the CPUs that * are mapped to it. + * + * There are at least two related races now between setting + * hctx->next_cpu from blk_mq_hctx_next_cpu() and running + * __blk_mq_run_hw_queue(): + * + * - hctx->next_cpu is found offline in blk_mq_hctx_next_cpu(), + * but later it becomes online, then this warning is harmless + * at all + * + * - hctx->next_cpu is found online in blk_mq_hctx_next_cpu(), + * but later it becomes offline, then the warning can't be + * triggered, and we depend on blk-mq timeout handler to + * handle dispatched requests to this hctx */ - WARN_ON(!cpumask_test_cpu(raw_smp_processor_id(), hctx->cpumask) && - cpu_online(hctx->next_cpu)); + if (!cpumask_test_cpu(raw_smp_processor_id(), hctx->cpumask) && + cpu_online(hctx->next_cpu)) { + printk(KERN_WARNING "run queue from wrong CPU %d, hctx %s\n", + raw_smp_processor_id(), + cpumask_empty(hctx->cpumask) ? "inactive": "active"); + dump_stack(); + } /* * We can't run the queue inline with ints disabled. Ensure that