From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B9DE3C3F6B0 for ; Sun, 14 Aug 2022 15:47:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241604AbiHNPrk (ORCPT ); Sun, 14 Aug 2022 11:47:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241609AbiHNPpx (ORCPT ); Sun, 14 Aug 2022 11:45:53 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F3DF9582; Sun, 14 Aug 2022 08:34:28 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8B99D60DCC; Sun, 14 Aug 2022 15:34:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 091EBC433D6; Sun, 14 Aug 2022 15:34:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1660491267; bh=okJOAwiVkcqXe9Psl92GGX87dAbkBAg+7UOYMgzJ/PA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=paExZJJb3ANlT8RN/jvzMOFD5NPP8PhXFp//1oRe5jQxhzKp3OGo6d93L8NofTkG3 EyZj/roeBATj+YRqqWGozurACvBFGAORmPizooKsx3KAxgXW+zYQJF5biC31qOuWRP dyAgIZWkt4tlgdM1ubvqLvZz7e1sTvj46my6kalS7ha/8FPVHY6o1d5k8TjBa+qUMo f3oVd0WkiyGRkmnbslJyRFttRO2Mg+WJ3sYjMr6DBuqVILlyJF+HmEZA99WGQudtCo gGa5prOU6aggx92iuKERUU14PdZu2b/nIbS9hJNH/4YHWF6H8WS3oEPCq/SAOdqEgA kNhHRC7EsMc4g== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Sagi Grimberg , Yi Zhang , Christoph Hellwig , Jens Axboe , Sasha Levin , kch@nvidia.com, linux-nvme@lists.infradead.org Subject: [PATCH AUTOSEL 5.15 43/46] nvmet-tcp: fix lockdep complaint on nvmet_tcp_wq flush during queue teardown Date: Sun, 14 Aug 2022 11:32:44 -0400 Message-Id: <20220814153247.2378312-43-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220814153247.2378312-1-sashal@kernel.org> References: <20220814153247.2378312-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Sagi Grimberg [ Upstream commit 533d2e8b4d5e4c89772a0adce913525fb86cbbee ] We probably need nvmet_tcp_wq to have MEM_RECLAIM as we are sending/receiving for the socket from works on this workqueue. Also this eliminates lockdep complaints: -- [ 6174.010200] workqueue: WQ_MEM_RECLAIM nvmet-wq:nvmet_tcp_release_queue_work [nvmet_tcp] is flushing !WQ_MEM_RECLAIM nvmet_tcp_wq:nvmet_tcp_io_work [nvmet_tcp] [ 6174.010216] WARNING: CPU: 20 PID: 14456 at kernel/workqueue.c:2628 check_flush_dependency+0x110/0x14c Reported-by: Yi Zhang Signed-off-by: Sagi Grimberg Signed-off-by: Christoph Hellwig Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- drivers/nvme/target/tcp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c index f592e5f7f5f3..889c5433c94d 100644 --- a/drivers/nvme/target/tcp.c +++ b/drivers/nvme/target/tcp.c @@ -1834,7 +1834,8 @@ static int __init nvmet_tcp_init(void) { int ret; - nvmet_tcp_wq = alloc_workqueue("nvmet_tcp_wq", WQ_HIGHPRI, 0); + nvmet_tcp_wq = alloc_workqueue("nvmet_tcp_wq", + WQ_MEM_RECLAIM | WQ_HIGHPRI, 0); if (!nvmet_tcp_wq) return -ENOMEM; -- 2.35.1