Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1681607rwb; Sun, 14 Aug 2022 09:24:28 -0700 (PDT) X-Google-Smtp-Source: AA6agR5CxQqKd2Pne9DaDJr2GqOGBB/RO5KOAZMb2QjbxDGSsjgdhEshxBBnAuaoKBdx66tkbRAo X-Received: by 2002:a17:90b:1b0c:b0:1f5:1041:a4f3 with SMTP id nu12-20020a17090b1b0c00b001f51041a4f3mr24217358pjb.234.1660494268166; Sun, 14 Aug 2022 09:24:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660494268; cv=none; d=google.com; s=arc-20160816; b=Xz3mkRA2XgmPg0CmG78nOwjGQiIQxYAl/4HZ+og77dLJz6InlgMt7OY+LQTHroLHjQ xs/zPsQUNTZnI2Gv8EbG2s3Vduvx3uP/4LhgW58VMr5HDUNhkbUSvdW1D/q28Hg09rNE mqWjqs/0B2gTaiSlTTF0E5sWkm06dTQ9Q/Gfy+cy21iE2LRgrhjBqHcAK/EK10xbVtWo RH4L/aUUi2wxwZIkawj9pT7zoCNUBCA8ZlmkHvYMXs8pXjo/uwhAAhy8O/Q97MIEfKxL IKFVacROg4IKu4zH5Qc32m3MrqUXjgwjog7FxgKnIUEOpvmunA31wwLDTUfjHEekGR18 uWvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=m8drF7oZ59tKuvJXuKhImnxaTT1zMM4Md5PYicK99Q8=; b=advGa1oiWG6hNmyDSL6NGqzxR6MFbXEnso5mqRoLg61+3weNgbIGY+4Oe0HxmeP+GV b7iiM9DGc/LKvNwRBrhzzV8i6eF040+PoU6ddaeEAKIZJpyNDYWhem9472GnH28OZS02 3hljG0KB7uV0yTTr17siyPnKhKwcbXBcJEwzV9CtPxdu94BC4ISj8dAKgmxuXfFgyWJQ MfPUcyHvobtGYguwlDANO5HqiRxWLj0h5+XhpZEza4gg1XwIOiHvtWrOfvlzVVzOMX1m 3iMqzoywGcjBVDmuYJAAJW6INF4IiYQ/3zD9vpAUEBadk39hAGxQo2AMkFQRFKqMxnhu YJ4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QlE2wIst; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g22-20020aa796b6000000b0052ee53596efsi3853441pfk.50.2022.08.14.09.24.17; Sun, 14 Aug 2022 09:24:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=QlE2wIst; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240773AbiHNPeh (ORCPT + 99 others); Sun, 14 Aug 2022 11:34:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240712AbiHNPd6 (ORCPT ); Sun, 14 Aug 2022 11:33:58 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A5A1DE80; Sun, 14 Aug 2022 08:30:37 -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 ams.source.kernel.org (Postfix) with ESMTPS id 12F94B80B79; Sun, 14 Aug 2022 15:30:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D2487C433C1; Sun, 14 Aug 2022 15:30:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1660491019; bh=BK6B3gdawsyew22CcsT952m5T51Qwd2OmaLNJ6Zjx3M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QlE2wIst/YeTlrrlxAvbThZ4Ql29+toyS9gBy0KnYswDj0V9OkLCJWVZjG4gjwxvY KuCQl+yds3SM0py1HwsuTP9wGSmZZeJ1B6bzAK+SUlgo73jfDRUosPletR3DYz0hCb fhjj2zUr/I4Nq5IcZ4k8NGIDi0pvBukKmoFLdaK08HOhjC8yCpkMt6SIV3+edrfjW/ km6wN72JZarEEFPiViCngfqkjgXwulgn7ZR99FZPEJIBCok1My2DLbycavVrJY7TyR M3G+O7FbUE1qIPsdff7oHurjUICg/Br3CuaEffVvIEzMFnqMa024Hl3++Q3wyAj39z Gj5cF2EkBJTnA== 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.19 60/64] nvmet-tcp: fix lockdep complaint on nvmet_tcp_wq flush during queue teardown Date: Sun, 14 Aug 2022 11:24:33 -0400 Message-Id: <20220814152437.2374207-60-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220814152437.2374207-1-sashal@kernel.org> References: <20220814152437.2374207-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 0a9542599ad1..dc3b4dc8fe08 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.35.1