Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1159604pxu; Fri, 27 Nov 2020 00:48:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJyA+4fxIq2kl4qo8RIMkhFIDEY3UqYqhc0hkgoRop62mTjvLD7lRqCASjl4L3Y93F3VIwOk X-Received: by 2002:a17:906:13d4:: with SMTP id g20mr6429315ejc.206.1606466913980; Fri, 27 Nov 2020 00:48:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606466913; cv=none; d=google.com; s=arc-20160816; b=bNonaaHgNt1n0lffubvmh0iGY+8eVkn0QbmSPcT8wq2Ucde3HjCrX/YLT/+vm6NVM+ T47RT6DmNVTDK34dQaXLpEDc6k6Y3WpTYF5LZtJ5+tPsdxWFvIdEo1mU+JEcWg5fvuEn QM+RMesxFng316elpiaWqHyLmPdYAA+N1Log+B5h/ovFeVna+MsNkRQ5YAE5qYHkcysN RpACWtwFP+DK7BH3+57iaUIF87hCQXQod4lMAPyhVk0A+l/THVmo2ZajOSUJedjFZjec dR54x+77MhnjQVfeD5BWrBYeU9cNnWBxl28a6CGUGjE/CV2QqtQnmwvAMuKNPCwAUUQl EIUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=CGuxrkK2iZdB4UEGYj2iQ4NnbaMBbMY85hcPMYR8MBQ=; b=EluuOYih3x5eE7lTN8uqVUs85MR/94F6aJdFwDhdoegfTpxnPQ10HmZtGYUd3y23sg PeC2kYJvcFvULnGoz0OQbt4+0hrs3wXZKn+f1uOER5uIIeQ2r0furKrVRDkzWx/sjOGN WTwNkSwqvdFw89ygB3qHsbb++k0h4gAu1Pfrb4B2iCtrmgrlQnNENLoWD4FTVmhJqQUt rpnc/4rfbdrV27F3bRw+mmWwK57MpOFjKHgvqdogMAwV2LAH4dn5U6yR8rWaUmfxkxev Zyyv9yhyz//wDwKE/akorLzFh/XaxtedxBOMRmyZskLoPw2viDE/ZsF4jOQXR3scTtiH RukQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hJ07LBPK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l12si4622656edq.55.2020.11.27.00.48.11; Fri, 27 Nov 2020 00:48:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=hJ07LBPK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392255AbgK0ClJ (ORCPT + 99 others); Thu, 26 Nov 2020 21:41:09 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:29484 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728340AbgK0ClJ (ORCPT ); Thu, 26 Nov 2020 21:41:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606444867; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=CGuxrkK2iZdB4UEGYj2iQ4NnbaMBbMY85hcPMYR8MBQ=; b=hJ07LBPK6aOMffsSjpk9yNfN2rJ5yqivomKTC6wLsq0yGTDqAXtvAk34j3ics8Rl6SJrR9 sPQ5R/aTXogA5wylVerANw4aFt9YHMmIgpWdOcMsO5ZNrPJvatQLqIwz8nXGsWC+hwiFzw 4lONryBFrIs6mxBj1n+eXBOyzrw+tos= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-361-kITHRiolM6uqfv8pokK3Vw-1; Thu, 26 Nov 2020 21:41:04 -0500 X-MC-Unique: kITHRiolM6uqfv8pokK3Vw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AE3738049C3; Fri, 27 Nov 2020 02:41:03 +0000 (UTC) Received: from T590 (ovpn-12-114.pek2.redhat.com [10.72.12.114]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1B52B1001281; Fri, 27 Nov 2020 02:40:56 +0000 (UTC) Date: Fri, 27 Nov 2020 10:40:52 +0800 From: Ming Lei To: Daniel Wagner Cc: linux-block@vger.kernel.org, Jens Axboe , linux-kernel@vger.kernel.org Subject: Re: [PATCH] blk-mq: Make running from the wrong CPU less scary Message-ID: <20201127024052.GB126383@T590> References: <20201126095152.19151-1-dwagner@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201126095152.19151-1-dwagner@suse.de> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 26, 2020 at 10:51:52AM +0100, Daniel Wagner wrote: > The current warning looks aweful like a proper crash. This is > confusing. There is not much information to gained from the stack > trace anyway, let's drop it. > > While at it print the cpumask as there might be additial helpful > information when debugging the sitation. > > Signed-off-by: Daniel Wagner > --- > Hi, > > We got a report from a customer because he was concerned about the log > entries. As it turns out, it fooled me too to be honest. What do you > think about making it a bit less look-a-like a kernel oops? > > > smpboot: Booting Node 0 Processor 12 APIC 0x26 > WARNING, didn't collect load info for all cpus, balancing is broken > run queue from wrong CPU 0, hctx active > CPU: 0 PID: 42300 Comm: kworker/13:2H Kdump: loaded Tainted: G OE X 5.3.18-109.$ > Hardware name: IBM System x3650 M5 -[5462AC1]-/00KG915, BIOS -[TCE144J-3.11]- 12/03/2019 > Workqueue: kblockd blk_mq_run_work_fn > Call Trace: > dump_stack+0x66/0x8b > __blk_mq_run_hw_queue+0xee/0x100 > process_one_work+0x1f4/0x3e0 > worker_thread+0x2d/0x3e0 > ? process_one_work+0x3e0/0x3e0 > kthread+0x10d/0x130 > ? kthread_park+0xa0/0xa0 > ret_from_fork+0x35/0x40 > run queue from wrong CPU 0, hctx active > CPU: 0 PID: 42300 Comm: kworker/13:2H Kdump: loaded Tainted: G OE X 5.3.18-109.$ > Hardware name: IBM System x3650 M5 -[5462AC1]-/00KG915, BIOS -[TCE144J-3.11]- 12/03/2019 > Workqueue: kblockd blk_mq_run_work_fn > > > Thanks, > Daniel > > block/blk-mq.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/block/blk-mq.c b/block/blk-mq.c > index 55bcee5dc032..0427b719d9c4 100644 > --- a/block/blk-mq.c > +++ b/block/blk-mq.c > @@ -1514,10 +1514,8 @@ static void __blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx) > */ > 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(); > + printk(KERN_WARNING "run queue from wrong CPU %d, hctx %*pbl\n", > + raw_smp_processor_id(), cpumask_pr_args(hctx->cpumask)); > } Now we have guaranteed that no any requests originated from one hctx exists when this hctx is going to offline, which is strong enough for killing the check. The reason why such warning is triggered is that wq's cpu hot unplug is handled before blk-mq's handling. I'd suggest to kill the whole branch in the fast path. Thanks, Ming