Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3408777rwa; Tue, 23 Aug 2022 04:24:38 -0700 (PDT) X-Google-Smtp-Source: AA6agR5cgWFBs5mOEXYFVW+8rl9FCsub44wmoNqgRIEDdJeuZOfc87YfZSd2C8FBaX5vZwlFdPcb X-Received: by 2002:a17:90b:1811:b0:1fb:fcb:1dde with SMTP id lw17-20020a17090b181100b001fb0fcb1ddemr2917678pjb.25.1661253878042; Tue, 23 Aug 2022 04:24:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661253878; cv=none; d=google.com; s=arc-20160816; b=mUzSSRqc68oln46rDLkVWMlNQpLxlxkfqmllP1FiVc4TJ3m/jwJAGJXo+kjOVO8m8P I2FddDDYZRw9La2TizykKMddeXKnu0zzsZac6IRKGibrx0tTTU6ymVTrJomJNuJesHf5 DeDW1tvXTNB6GtXJWtHSlRrGLw3+BRhjdY0vkCw2ODcDDxs25iXbzI9Tz2xgtYn3PY/l vQbQAclqTjjPJksVWd5ODrYdDJIJxZV6sSoXQ3JEg1VOzbK7q/KjWfSmoIt+gqplvnTn cvEdnUVkBaItJ9EUciEFPFkC+HrWJgIgtT8LjLKycIGECzWDt6lpRqQ+ZvCUEfQtQ9Vu ExSw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=MZOhGJkXlSwJE8c8cr4cN74lGpDg76G6thzKplvvQTs=; b=AcrszlbEkZIZL1JuarGBt57NcoAjuiUUbvJSXgkx6npGnzev3QOuasSxx2IaNkSBFA f4qjTVvVDmkH6ajQPo19utcrgPR13TJya9rPP7WwjBxzrOGwmqrleos7P3mG1aQiL0VZ SJGzizc3q1FeDKu5IQCuBBylm+Q8+2YqHn8ylXtwAfajkgaPgB+V9ltU2FWb9LjXamlQ kic8+o5bnZvzF0GThp9QiJHqBHwEw7J1cwANZKuOV4wFhaBLoEBv+81DIyWp7lMmCowL BUz3K3hELhy71Jw8NN8I7OT7s1L60B2oECPGEuE6ZykAJ1I57iCYUjmPBoXD1fNqf9IS i+Fw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QTW3+Agf; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 142-20020a630394000000b004298f3fdcb6si16491665pgd.353.2022.08.23.04.24.26; Tue, 23 Aug 2022 04:24:38 -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=@linuxfoundation.org header.s=korg header.b=QTW3+Agf; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354842AbiHWK0e (ORCPT + 99 others); Tue, 23 Aug 2022 06:26:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353611AbiHWKLn (ORCPT ); Tue, 23 Aug 2022 06:11:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE49413E0D; Tue, 23 Aug 2022 01:57:43 -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 8A51361555; Tue, 23 Aug 2022 08:57:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 85A70C433D6; Tue, 23 Aug 2022 08:57:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661245063; bh=okJOAwiVkcqXe9Psl92GGX87dAbkBAg+7UOYMgzJ/PA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QTW3+AgfZXiw0/AtayonQoqMq7AGTJ/P7wFhi+FaEbtTIxSklqGdsDPmnn4S1DD6E T07hyRhgM5zEAKjeVYy8wasZz1eMKU+JqN8PvL1Qd62zMjGfN4E3tnV+FJqn5UJts4 QzXYiohpCUgWPq6WEtrjUTAQ6l/os+c4NsYJTh7I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yi Zhang , Sagi Grimberg , Christoph Hellwig , Jens Axboe , Sasha Levin Subject: [PATCH 5.15 202/244] nvmet-tcp: fix lockdep complaint on nvmet_tcp_wq flush during queue teardown Date: Tue, 23 Aug 2022 10:26:01 +0200 Message-Id: <20220823080106.233438629@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080059.091088642@linuxfoundation.org> References: <20220823080059.091088642@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 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 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