Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp3056372rwe; Mon, 29 Aug 2022 05:14:41 -0700 (PDT) X-Google-Smtp-Source: AA6agR6ekFRe+w5bCu4KnCnANjpM8nVXZVE2j+jXNivqm1yi7SBEXbKKycmqu87oU98QiP7op/WT X-Received: by 2002:a05:6a00:bd8:b0:537:ea87:45f3 with SMTP id x24-20020a056a000bd800b00537ea8745f3mr11496852pfu.55.1661775280945; Mon, 29 Aug 2022 05:14:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661775280; cv=none; d=google.com; s=arc-20160816; b=uGkfO/pdYbyF7HkfGdunCGeGRlmB69Oph71XkVZl82YLi4ZuY1D4EZLoZFM9hol6Wj xzyoOZr9kT/fCCVmz5QiAnff0Sfd2laTO0gznVJ/MCh7yUpxBXsyFWxhzg5nSYghOvi/ l/VqQnwIo+KaJ378owEc2tIkhu19fNDF1yoXuLFbCX/6BbaUJqt4qaVwhV6WgIo9C/o9 lh3uu35rjG9sucbnZWdiCwkJiBkoJEe3S2eTXf1lRnxWLqfDDVpU1CH3+/zPxq4MrsdM o3FHf/DtExI6gAce2+5141x4EngvRa7mq85zShx3ncANoJrcsA0O6+aJBjTU+hG0ntwW PuvQ== 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=94sXxDeciTT6bHyacIzk+0eLpGKfggkzDfP49ZkBjnc=; b=tBFQXlrTlMkKgHjIT6A40Tk0qhVchPlzoRjmmvfnmQLtaNV1xJp1yuJtvT6N9Qt7Bf oxoBZd/AlJgsTm+OIhmCPvlz3HPOI8mhszM045Q0/P8zrC/G2X7xv+tIrlm176rkXQWF HKcoIohAk9IJBYULql4g81QB5vHOo8TeHN6ZuTQ1GdEi3PTBVROpR9tOLGk6286YIx7g ha4xr6qoLiIgOKnDtPesspwn/bc0tMHbDY3de4Nwf5fKDEYRKqco0i2tlkhDeS+on+u8 LZjwzgC/YWb6MHd0pg+x9HnQ0G61k02UN+ItKBGCOiqTdzDrS6aWuPbzPDrxAPzHd98+ +GSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Z8X0S3jg; 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 x186-20020a6386c3000000b0042a46114c85si3543373pgd.514.2022.08.29.05.14.29; Mon, 29 Aug 2022 05:14:40 -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=Z8X0S3jg; 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 S232908AbiH2LnE (ORCPT + 99 others); Mon, 29 Aug 2022 07:43:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232881AbiH2Lmk (ORCPT ); Mon, 29 Aug 2022 07:42:40 -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 CE30783F13; Mon, 29 Aug 2022 04:26:19 -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 0B64E61239; Mon, 29 Aug 2022 11:19:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 01B57C433C1; Mon, 29 Aug 2022 11:19:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661771976; bh=igaDsgfaPIIrkWz0bd7Wrd2v/jVr1iT8zorHbcK2NPI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z8X0S3jg8OvJ+X1hR5TpftWVAhj2wh1NXT+lpqIrNLA0QSZ1crfjumhct+ibFyY1Z V/be3HPQ4myPdj3+M6mgK5khQpoatI7eg+32qKVywv/Ezwqv2Z4/qpUnGf0BwTDBG3 53tLgBC4vh2Zv8P5a447l8xg8TaI2ymrQu999Weg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Kelley , Saurabh Sengar , "Martin K. Petersen" Subject: [PATCH 5.19 152/158] scsi: storvsc: Remove WQ_MEM_RECLAIM from storvsc_error_wq Date: Mon, 29 Aug 2022 13:00:02 +0200 Message-Id: <20220829105815.486637627@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220829105808.828227973@linuxfoundation.org> References: <20220829105808.828227973@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=unavailable 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: Saurabh Sengar commit d957e7ffb2c72410bcc1a514153a46719255a5da upstream. storvsc_error_wq workqueue should not be marked as WQ_MEM_RECLAIM as it doesn't need to make forward progress under memory pressure. Marking this workqueue as WQ_MEM_RECLAIM may cause deadlock while flushing a non-WQ_MEM_RECLAIM workqueue. In the current state it causes the following warning: [ 14.506347] ------------[ cut here ]------------ [ 14.506354] workqueue: WQ_MEM_RECLAIM storvsc_error_wq_0:storvsc_remove_lun is flushing !WQ_MEM_RECLAIM events_freezable_power_:disk_events_workfn [ 14.506360] WARNING: CPU: 0 PID: 8 at <-snip->kernel/workqueue.c:2623 check_flush_dependency+0xb5/0x130 [ 14.506390] CPU: 0 PID: 8 Comm: kworker/u4:0 Not tainted 5.4.0-1086-azure #91~18.04.1-Ubuntu [ 14.506391] Hardware name: Microsoft Corporation Virtual Machine/Virtual Machine, BIOS Hyper-V UEFI Release v4.1 05/09/2022 [ 14.506393] Workqueue: storvsc_error_wq_0 storvsc_remove_lun [ 14.506395] RIP: 0010:check_flush_dependency+0xb5/0x130 <-snip-> [ 14.506408] Call Trace: [ 14.506412] __flush_work+0xf1/0x1c0 [ 14.506414] __cancel_work_timer+0x12f/0x1b0 [ 14.506417] ? kernfs_put+0xf0/0x190 [ 14.506418] cancel_delayed_work_sync+0x13/0x20 [ 14.506420] disk_block_events+0x78/0x80 [ 14.506421] del_gendisk+0x3d/0x2f0 [ 14.506423] sr_remove+0x28/0x70 [ 14.506427] device_release_driver_internal+0xef/0x1c0 [ 14.506428] device_release_driver+0x12/0x20 [ 14.506429] bus_remove_device+0xe1/0x150 [ 14.506431] device_del+0x167/0x380 [ 14.506432] __scsi_remove_device+0x11d/0x150 [ 14.506433] scsi_remove_device+0x26/0x40 [ 14.506434] storvsc_remove_lun+0x40/0x60 [ 14.506436] process_one_work+0x209/0x400 [ 14.506437] worker_thread+0x34/0x400 [ 14.506439] kthread+0x121/0x140 [ 14.506440] ? process_one_work+0x400/0x400 [ 14.506441] ? kthread_park+0x90/0x90 [ 14.506443] ret_from_fork+0x35/0x40 [ 14.506445] ---[ end trace 2d9633159fdc6ee7 ]--- Link: https://lore.kernel.org/r/1659628534-17539-1-git-send-email-ssengar@linux.microsoft.com Fixes: 436ad9413353 ("scsi: storvsc: Allow only one remove lun work item to be issued per lun") Reviewed-by: Michael Kelley Signed-off-by: Saurabh Sengar Signed-off-by: Martin K. Petersen Signed-off-by: Greg Kroah-Hartman --- drivers/scsi/storvsc_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/scsi/storvsc_drv.c +++ b/drivers/scsi/storvsc_drv.c @@ -2012,7 +2012,7 @@ static int storvsc_probe(struct hv_devic */ host_dev->handle_error_wq = alloc_ordered_workqueue("storvsc_error_wq_%d", - WQ_MEM_RECLAIM, + 0, host->host_no); if (!host_dev->handle_error_wq) { ret = -ENOMEM;