Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp1956665lqo; Mon, 13 May 2024 03:54:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW9RduJPhIxUogL+xqPtB/6L6UgPy+/76fgiVXuszhJ31vEliWoJtl1RKM3rYBPZJ6akduWfHD+mJz5VhD6yCvoNNu8NBEeO8z9Q3kbLQ== X-Google-Smtp-Source: AGHT+IEMYuIj5CeGEBK4kYgD0uybW7OUYAL+arRVGDzQ7P07Yp+k4Bxcc9gf2kMLWhUfWvtVCpZE X-Received: by 2002:a05:6214:3bc4:b0:6a0:c339:1edd with SMTP id 6a1803df08f44-6a168208ca5mr105449946d6.42.1715597685786; Mon, 13 May 2024 03:54:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715597685; cv=pass; d=google.com; s=arc-20160816; b=ToBKQIEkTXqrSLtRhoR+qibFiiUAbmST8Jhotc5XgTd94ctHHVwRAMezJwQ8p74oCn DPVwr3zjtCF8yFWkW3UEVJ1j8za/qM4g30ZzBSXhQ+xraJEzdpfYg1HtkH+LM/1YQhug Y39d/2MGHKZiQPyzr1Aw+vT/a/rGb+ZXb8lS3cfC/a4ZOwoVWpQ+31Z57CaqQBtk9SZ0 TNnXYoyQUn3efZGLl6Ff35he1eo8sckff9Rzou+3LEX5/Ew/QkHhgEjnNuOvapBLhTrQ Be2OoprnIZHKBS+t/NNqd/X4lu0jhmlkKpKQsGxD6PCBYt/HJHVMJE2gbdX2lFufQUU0 MY6A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=NrDzScTYb+9BVm+zXCq+0/S0QpEoUm/Giic7BzdWDkA=; fh=8FyV5T7srkdeUbKVf13wPVxHWKbzAe52lWj0ZXbhy/I=; b=obXAvgomFXKnQ5MaXq0bHdtklttK7TURPZF18uV+t3E1S5J4le9yS+93oe+Nu/5cu7 hi0zFBG8pKv0gFxkgwyomQzupaZZBC7b6vmNDtyy0LKE6Dq7sCNoM83SCI0y8Jzi9Aea Fi0IvP+yjdeNos9LcAYyvo/S5P5q3DcMEoJxGQudFRMuvqtFc/muKPNlOgV7u9cTft3j gbN/OIKcmZu0ykf7JNq1pn2AcBje+Xc5otvnugkv6Ht0ArvTMinjeIE0piEEa90bxl1K ZDvsx/6K0o66CJdBvgM54wz7WN/wwMzt2n5/y90n8GbmaSMq4FAjMQ0xTCdMa+waZ2aw o5Tw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=sina.com); spf=pass (google.com: domain of linux-kernel+bounces-177476-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177476-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6a15f1d70e3si93909876d6.91.2024.05.13.03.54.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 03:54:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-177476-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=sina.com); spf=pass (google.com: domain of linux-kernel+bounces-177476-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-177476-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 6E9ED1C229EA for ; Mon, 13 May 2024 10:54:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 75D1314AD29; Mon, 13 May 2024 10:54:41 +0000 (UTC) Received: from mail78-59.sinamail.sina.com.cn (mail78-59.sinamail.sina.com.cn [219.142.78.59]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 169C114A614 for ; Mon, 13 May 2024 10:54:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=219.142.78.59 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715597681; cv=none; b=Ji6Dk3MlTRvOewKReZtYe0RLPFW+zFiLV0WZ5RPx1AuUYtWL/ysI/5INis9YlwWW3a//SHTX6/fSEBM/BAcGgFiW14LW59BFrv7CFgfRFnWw77VLLVPodnq5YA/EdMcSfsCU2Lfu7hc8RjapPzErLXb7BHKo+s463cI9+l+HI54= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715597681; c=relaxed/simple; bh=5oSpI+yEDAjstmktVw/EAv6DAdZsnilJtyVy9s9eXPg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=JFs2vyH37+17LdTRu/gnC7+NRG3ovRJDwJTUIfAXhVy0730FKjiLmqfK/XiDqwMcMmrDQXg3hSS4UREdp75oEmWZz/iSUbyD717WT927/4YNllEwuvzMnv4uX47ZdD7zsH9/zJfeV4FbviQBxj5ykTVVY3AjbT05Th5YDxmo5AY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sina.com; spf=pass smtp.mailfrom=sina.com; arc=none smtp.client-ip=219.142.78.59 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sina.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sina.com X-SMAIL-HELO: localhost.localdomain Received: from unknown (HELO localhost.localdomain)([113.88.50.17]) by sina.com (172.16.235.25) with ESMTP id 6641F15E0000393B; Mon, 13 May 2024 18:54:25 +0800 (CST) X-Sender: hdanton@sina.com X-Auth-ID: hdanton@sina.com Authentication-Results: sina.com; spf=none smtp.mailfrom=hdanton@sina.com; dkim=none header.i=none; dmarc=none action=none header.from=hdanton@sina.com X-SMAIL-MID: 45323634210360 X-SMAIL-UIID: 106C01B471954D5E8661512F8CB6D411-20240513-185425-1 From: Hillf Danton To: Sam Sun Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, axboe@kernel.dk, Tetsuo Handa , syzkaller-bugs@googlegroups.com, xrivendell7@gmail.com Subject: Re: [Linux kernel bug] INFO: task hung in blk_mq_get_tag Date: Mon, 13 May 2024 18:54:13 +0800 Message-Id: <20240513105413.2951-1-hdanton@sina.com> In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On Mon, 13 May 2024 10:38:34 +0800 Sam Sun > Dear developers and maintainers, > > We encountered a task hung in function blk_mq_get_tag. It was tested > against the latest upstream kernel which was compiled by clang 14. BTW make it clear if repro is available and if you could test patches in reply. Thanks for your report. See if the below low-hang pear is sweet, I mean see if it could survive your repro. --- x/block/blk-mq-tag.c +++ y/block/blk-mq-tag.c @@ -180,8 +180,10 @@ unsigned int blk_mq_get_tag(struct blk_m sbitmap_prepare_to_wait(bt, ws, &wait, TASK_UNINTERRUPTIBLE); tag = __blk_mq_get_tag(data, bt); - if (tag != BLK_MQ_NO_TAG) + if (tag != BLK_MQ_NO_TAG) { + sbitmap_finish_wait(bt, ws, &wait); break; + } bt_prev = bt; io_schedule(); @@ -208,8 +210,6 @@ unsigned int blk_mq_get_tag(struct blk_m ws = bt_wait_ptr(bt, data->hctx); } while (1); - sbitmap_finish_wait(bt, ws, &wait); - found_tag: /* * Give up this allocation if the hctx is inactive. The caller will --