Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp139549rdb; Thu, 1 Feb 2024 04:42:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IG3zoN853SBv4uVAC0qkEuHjJR2MCn+C/tptRetGmGCmFuo/ELUcqCnmF100qSmuHbG/R2P X-Received: by 2002:a05:6358:1901:b0:178:7556:11e6 with SMTP id w1-20020a056358190100b00178755611e6mr4275788rwm.27.1706791327861; Thu, 01 Feb 2024 04:42:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706791327; cv=pass; d=google.com; s=arc-20160816; b=X63G2eaYljY65b8gNS3LoZbLP+Gg+D9QM3TZ662TCHE+1BJT9zKdCSak+HKF1BVhkr ULVguD9ZxhJpf8AbveFOWJCqRNtjazJJmKqFky4DKjfgyyjo3pZFvAl6B3wlTyXv4ol6 6iBYMw6Wc+OWc7vqCkB/aG0kXXZeW4qyY4WBxSxMxXQLvhLTukcw8goBHlw3hlgKsODR sUolWzaZMBwsoErzA5RuYxpfmQvCdfF4Ak+mg33cxE8EipbsQovbygUmLZxS6jTJtG4N HDEerDNSuJq+60WGL/iu8q4gB13/8wJ5r1xjafo8BBQkt2XZDDTBGCAVRRfi68/KPtfJ MJnA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature :dkim-signature:dkim-signature:dkim-signature; bh=mZAhmoimqX/LFqyFMVuwwM2dsHNWcXM1TVKD5f+E3iQ=; fh=KFb2ZMd+CKOc/TXbJPfHRDrOXf8hzCdwmAXIJ/ePboA=; b=Cyl1yf6kBGVnM8eFqzGhoVBBeJCN+450a8jjgoyAuVHQSrDsry/kzc5pXTEJCi7voZ WUKCBjT/WqHNCTiUeolplaB0VSGI1eCaMu3L+dsU5kAL6CTe9ThWhJ9kjaK5lo36WkhI IsbicyszXC7go0tFE/icsk/GSaHxHOYI9ujoXCUZePfE6egO+/vL2thjZaZU4yiuDTIx HzTEWwwFvYneoFtUwJAGd6UMuGvZVOVfOgJ2OUVIpsWHX9YMQL2vyyRi7C6viOj0td6j I15CHngNLSfPLmG2UVXD3YpG3SjAYU27aT+IPr5r4Zvn66TzzncbEMRmVp/+doon/aF7 QrzA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=TBsQMI8V; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=Oj6fHY44; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=Kt+M9LIW; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-48144-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48144-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de X-Forwarded-Encrypted: i=1; AJvYcCVuT4zUd1wnE3z0nj77yNfHFgIVHApRn01g79waQmk5xP/x+ObRguqSh5Of/FkNGfNFM89XP2KI1I2Qov91nwt/9GzG35f2N2KcKu1HUw== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id u65-20020a637944000000b005d8e3490d49si5719914pgc.407.2024.02.01.04.42.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 04:42:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-48144-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=TBsQMI8V; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=Oj6fHY44; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=Kt+M9LIW; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-48144-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48144-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 799272831BA for ; Thu, 1 Feb 2024 12:41:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EE8908663B; Thu, 1 Feb 2024 12:41:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="TBsQMI8V"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="SCM3kbqr"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="Oj6fHY44"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="Kt+M9LIW" Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 801DD53362 for ; Thu, 1 Feb 2024 12:41:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706791304; cv=none; b=ZpzVjSL5eZBUNUHPhaaQF1qttVzjDzM1WjwzhbXi6CFi4P6EMAqNo6ybhZR6PaPma7JnjOblaLJPO+4UMvh1FEGNPkwUVxI5x1Q71qcKpdrJ/plQG6EpUgda4VqgnZZfEEcyCuME3Lq7ssOYcieBGCfu5wCtjd7iK2ja/WZFf7E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706791304; c=relaxed/simple; bh=vzOwURaJGFGngjzlTNi14jTCw9s2QcCg9bsA4XtIG2Q=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=OL/x1a/MCOYOohlVUJwoPN9M4IRNs7EBUmJIhULtAr/B3ErBgbYi4poQvw7E2Gbtyccz2y2gqgm/KItcxTXbjNb57GsPbVgiNql/er7zFGRguMqkuo7HapzMwE7C3WlQAicpKTQYlOJ9fHSOEv3pT5dcJWEfYL04Jnbb9RQlA3k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=TBsQMI8V; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=SCM3kbqr; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=Oj6fHY44; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=Kt+M9LIW; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 9E4582213F; Thu, 1 Feb 2024 12:41:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1706791300; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mZAhmoimqX/LFqyFMVuwwM2dsHNWcXM1TVKD5f+E3iQ=; b=TBsQMI8V4yJ3FugvLlIWA4PWW77HxgUrYNypS1PgR+7ESl2drUJHP/vZlgopDhVdIEkXBb CkXHZZFbwTEMOB6cZfQpkDSMuHaq6H9NukwC6+x9BiL+Y6kNhBkbYjsHB1Jqgk07NLTSu8 h+PMo7XQZ4FYNhZ4w2mcpwvn99BHI6E= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1706791300; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mZAhmoimqX/LFqyFMVuwwM2dsHNWcXM1TVKD5f+E3iQ=; b=SCM3kbqr+J/ToX9ZTq6Hz/1GABTHlV3HR+EGhCvbq/EddrRYpPEZrqWIyAbJo6XD6izwOS ACrlnIj0zrml2EDw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1706791299; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mZAhmoimqX/LFqyFMVuwwM2dsHNWcXM1TVKD5f+E3iQ=; b=Oj6fHY44xm8f+RcRl402bUNPfwSKVGPi0J9AvH+6ey7OMm9eSgnpdyrerV4v2GYdgtHHZg 2quewS7HBGMq4vXtzGOws/UMBkREf+pdHNLDiZN+lStJZpJfPI+EEi2Shm6FPqYp45nafW GEHPeGGONUPLV7t5MdLLChuAHjqI9+I= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1706791299; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mZAhmoimqX/LFqyFMVuwwM2dsHNWcXM1TVKD5f+E3iQ=; b=Kt+M9LIW0v54SADgTAPOmLy0uhSjVCTxGaCWPNZAW8lGzdlY8/+sPAjF3L5VVGRJABPhuh ByKsBt6UBs5MRGAg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id E94B5139B1; Thu, 1 Feb 2024 12:41:37 +0000 (UTC) Received: from dovecot-director2.suse.de ([10.150.64.162]) by imap1.dmz-prg2.suse.org with ESMTPSA id lqUqLIGRu2XNOAAAD6G6ig (envelope-from ); Thu, 01 Feb 2024 12:41:37 +0000 Message-ID: <3da93cc3-80a9-4dbf-b6af-aa5fc6b35b33@suse.de> Date: Thu, 1 Feb 2024 13:41:35 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 01/12] nvme-fc: do not wait in vain when unloading module Content-Language: en-US To: Daniel Wagner , James Smart Cc: Keith Busch , Christoph Hellwig , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org References: <20240131085112.21668-1-dwagner@suse.de> <20240131085112.21668-2-dwagner@suse.de> From: Hannes Reinecke In-Reply-To: <20240131085112.21668-2-dwagner@suse.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Authentication-Results: smtp-out1.suse.de; none X-Spam-Level: X-Spam-Score: -4.29 X-Spamd-Result: default: False [-4.29 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; XM_UA_NO_VERSION(0.01)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; BAYES_HAM(-3.00)[100.00%]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCPT_COUNT_FIVE(0.00)[6]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Spam-Flag: NO On 1/31/24 09:51, Daniel Wagner wrote: > The module exit path has race between deleting all controllers and > freeing 'left over IDs'. To prevent double free a synchronization > between nvme_delete_ctrl and ida_destroy has been added by the initial > commit. > > There is some logic around trying to prevent from hanging forever in > wait_for_completion, though it does not handling all cases. E.g. > blktests is able to reproduce the situation where the module unload > hangs forever. > > If we completely rely on the cleanup code executed from the > nvme_delete_ctrl path, all IDs will be freed eventually. This makes > calling ida_destroy unnecessary. We only have to ensure that all > nvme_delete_ctrl code has been executed before we leave > nvme_fc_exit_module. This is done by flushing the nvme_delete_wq > workqueue. > > While at it, remove the unused nvme_fc_wq workqueue too. > > Reviewed-by: Christoph Hellwig > Signed-off-by: Daniel Wagner > --- > drivers/nvme/host/fc.c | 47 ++++++------------------------------------ > 1 file changed, 6 insertions(+), 41 deletions(-) > Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes Reinecke Kernel Storage Architect hare@suse.de +49 911 74053 688 SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), GF: Ivo Totev, Andrew McDonald, Werner Knoblich