Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3502746rwa; Tue, 23 Aug 2022 05:58:13 -0700 (PDT) X-Google-Smtp-Source: AA6agR6XD9yjIrbpuO2YrCm0pxQZ4w3IQKj6mhBTBqQt8z9F7aGnKt/VcXNW8jaT7Xf4FW2wDFdI X-Received: by 2002:a65:4205:0:b0:429:b155:4945 with SMTP id c5-20020a654205000000b00429b1554945mr20994287pgq.572.1661259492813; Tue, 23 Aug 2022 05:58:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661259492; cv=none; d=google.com; s=arc-20160816; b=bGnmu/Lheqa8Dn3tk7GKWaFppnti6dnRl2IRqReYHUtvAgdHw9A9kxWvpC+MoS9N0n pXRMbQpSrYUCpBuNSsBM1lSd0NTgKTFMfAtTkhcnV/xHA9I3KhgDgu3B6NVN64IvMgTh 3Crug1cpTYNzPO6UEa9JZrsm6+dvFqSOXpK0wRlBpPJk0wexRvoSqldjTRAg0sTtg9HS jBWQxYzBcPIRmGNcn/TI2QKhcSl05CPbCHwE+CpnbCfEWDRavwChmCSA2sDrg6bFq/LU jSSNM8+ChpHivsdPBxZny6ZQ/3HEYCxeut2i9rkcMeddtJe5ZchzID9/dugimQSo7Uu2 d1AA== 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=vGrt4brLYBCON2IhYcSAc6aQKYeWuxWN9RUzC1VEWTk=; b=LLqbj+ibcMUd5eE7ncxkVZG8yGBvfVpQ4XHTVQirTcIq+2RbgIbh2v6UnAMR/oF9kW Fg3qjZvME8/XJhmeAGlr+UZWDjB1OQ2qXjvwFjrUBcI8HZc6A1IBbP4CYLFueEdBypUt 2hE87pLPi/CqldW71JbR5lWoAaP2qW0iXLRXrWqavuDJuwq1u7eizp7RzT0bxSTsB9oJ u8dX/FWkdu6SuubPQBjwfCoSPRt8knm23eD788Q8ycpMbTi1yk2WLo7kPjE/QAa49SON R9PUWNVE7Ze3sZvYTRi/TvWHYK+4W9lcKd7SRqvWE3rQUAsgSpLsrXQ5D5JiTazK0BlE SKEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fDB5FNBW; 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 p1-20020a170902ebc100b00172ee0652e3si5182063plg.283.2022.08.23.05.58.01; Tue, 23 Aug 2022 05:58:12 -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=fDB5FNBW; 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 S1359778AbiHWMGn (ORCPT + 99 others); Tue, 23 Aug 2022 08:06:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1359436AbiHWMBd (ORCPT ); Tue, 23 Aug 2022 08:01:33 -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 E16AED9E87; Tue, 23 Aug 2022 02:35:46 -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 F079061484; Tue, 23 Aug 2022 09:35:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E67DFC433D6; Tue, 23 Aug 2022 09:35:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661247337; bh=EYVjw1q+dpeO/mjOC3orZPoHYiNWoXIRtQLqP1kf+8w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fDB5FNBWqqZSUbzW0CmVlx1OPoG13sbT2lZNxj4LLtX/zBm04ztyBphDr3cLGTkAV lly3+FL+YXt1yhpPziErwniaisFIvOTU1019njlQo/2Hlg7qZ3UOr9LsrJXz0/rUHF e0jPGXWWVgc4tPRMtLdwHnfshu2pxLIDMx1cDZg4= 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.4 365/389] nvmet-tcp: fix lockdep complaint on nvmet_tcp_wq flush during queue teardown Date: Tue, 23 Aug 2022 10:27:23 +0200 Message-Id: <20220823080130.791698452@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080115.331990024@linuxfoundation.org> References: <20220823080115.331990024@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 4341c7244662..e9512d077b8a 100644 --- a/drivers/nvme/target/tcp.c +++ b/drivers/nvme/target/tcp.c @@ -1762,7 +1762,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