Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3304524rwa; Tue, 23 Aug 2022 02:22:56 -0700 (PDT) X-Google-Smtp-Source: AA6agR7ILx6pxNz2xWc/1gPai1eTtfAfJivZ0ePMOpfWE1tY1YYWTeEx6wpvwddfqLH9+FMehVjE X-Received: by 2002:a17:903:124f:b0:172:5744:a97a with SMTP id u15-20020a170903124f00b001725744a97amr24101495plh.68.1661246576553; Tue, 23 Aug 2022 02:22:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661246576; cv=none; d=google.com; s=arc-20160816; b=I1tsK6WbuJunfesaq41WC+2WkBrx1HGGuBDHXaBhiJDMApimUfbDYt9Z+OVsmNVrDt Efaw5Mey2XEvEAv2cxIwt8SLVDbTCpmhwYyk4GsUWNtoxhRi6SohQnouw9VgrhaFo4XH dAN4xxgi88lRMt9HY18AvJnW8ljT5N7EEl02fAW/0PLn81iDUuU0YFe3SJqfEYoVAmax tYemup3qxLjl/PwNT0MwyhnMRlVus0z9qdN1zhHPBoU1H9+PGRt7NiKYnsDjDYv5ADlQ b0NcbL+YGE4PcFMhCRYDR1UL/VGqJLjoSVc2BktG1V/LeSTNWaY0Fv38NiSmh0l7vCK4 DN5g== 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=m8drF7oZ59tKuvJXuKhImnxaTT1zMM4Md5PYicK99Q8=; b=JA6YotFfnqcKUWp95B+C3LpHp0SvwukSvFl2zbpLPc8m0Vh5+QEJn0GyNQecydeeTj lSQ0GLnXrpT8IMqRKgYYmhDXY7FfsAAIBB4FfT78bDomqro0YUzT9+07JMnIQly6I5GV ooxzkcyfWacVdAQEt1CoGBa+FGeVGvwJ0nX/VP343EXzU3nq8620BnnxL5UwrNY2JuK/ r9GKyTadEjLdY9BEQOb2pBNf6WJ1eEuY2C6tPg+BjBVQF53NSJQYGrbYEabLz6Hr8l4i EqMAsTaNXVSHvLG1DWE6zpSAjuNmopJXCluW3eOHaigjmfEckjjbXLvCZ8D1E0CAwj3H SnXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=J6MejM7j; 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 h21-20020a63e155000000b00415d0947647si11054773pgk.184.2022.08.23.02.22.46; Tue, 23 Aug 2022 02:22:56 -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=J6MejM7j; 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 S239278AbiHWJSy (ORCPT + 99 others); Tue, 23 Aug 2022 05:18:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349995AbiHWJQ2 (ORCPT ); Tue, 23 Aug 2022 05:16:28 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7209883C9; Tue, 23 Aug 2022 01:32:41 -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 DB1E7B81C1C; Tue, 23 Aug 2022 08:32:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3312FC433C1; Tue, 23 Aug 2022 08:32:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661243551; bh=BK6B3gdawsyew22CcsT952m5T51Qwd2OmaLNJ6Zjx3M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J6MejM7jgw93ixrfhARvobBdOD2OBtFy8JRPwlgqrgfBKGFx7lpM6MCJW0AuIlj/H HL0Sql7VoZ737D06lU++nU6VsyzUXcfjREy1vekG2Wt8yYaXZ7P08t+BZjuGwH0sTM 3H+R7kiFHfslt3wTAsmNH9ASB7jlPexzUs5QzSWw= 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.19 313/365] nvmet-tcp: fix lockdep complaint on nvmet_tcp_wq flush during queue teardown Date: Tue, 23 Aug 2022 10:03:34 +0200 Message-Id: <20220823080131.281524707@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080118.128342613@linuxfoundation.org> References: <20220823080118.128342613@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 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