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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5D9D8C43334 for ; Mon, 25 Jul 2022 05:42:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=ikqa6bXUd901/K7WiIcvFY45E0YCO4xc9MyzeyrWT1k=; b=I/KSc8ZboD98uC4jRCVulX188c uscH6LnUZp5vO0Rewv1jCGLq8qMdOvK9a/zPyvg4TvsNUDJDE4+21fTebTCx9awC1oTyxFj57jYUF yOgWs0+sAGRZrevPlPSOlTCTpRxz7bxoT2wGt1bixJVJ7DSZhKVeM6THzG906JYB+O3JY2kyYQ4Gc bnmtFkeV3Kvq4PYGxTcc7wL94WeJt/PQJ7sYR2XMhNzGh1CtQigT7TT/orWDSN4WOjcP6eWH5KXmN yc+DD/RBuvVaFgbjFumbRm1miHC/TWXpns0PMbEh7oS3OehoXKvxVGf4U9uCromMD7kAUojA8gRFD dJ077fdQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oFqr4-004cia-Uv; Mon, 25 Jul 2022 05:42:10 +0000 Received: from hotelhilton-1.munich-airport.com ([91.228.175.36] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1oFqr3-004ch0-VI; Mon, 25 Jul 2022 05:42:10 +0000 From: Christoph Hellwig To: sagi@grimberg.me, kbusch@kernel.org Cc: linux-nvme@lists.infradead.org, Yi Zhang Subject: [PATCH 1/2] nvmet-tcp: fix lockdep complaint on nvmet_tcp_wq flush during queue teardown Date: Mon, 25 Jul 2022 07:42:05 +0200 Message-Id: <20220725054206.2558965-1-hch@lst.de> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: linux-nvme@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-nvme" Errors-To: linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org From: Sagi Grimberg 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 --- 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 0a9542599ad1c..dc3b4dc8fe08b 100644 --- a/drivers/nvme/target/tcp.c +++ b/drivers/nvme/target/tcp.c @@ -1839,7 +1839,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.30.2