From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0EA2B2555C for ; Thu, 4 Jan 2024 16:47:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GmUFVV+7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1113CC433C7; Thu, 4 Jan 2024 16:47:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704386859; bh=gUL3ydGH9gI1f05tOKDtRIs4ksaWn/LR5N9XebQaO1A=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=GmUFVV+7jEZvhSjq03hi0FLNJ85H8T6nqcxIvwlhNEJls+vxHNPopDZalFbP6Uo81 qPR6VobMUiIbrOgEkd27J59G2rbFxza+r0VWkux2Z7yB4YLeaEUvVXgraY4wvILYcf zpjVhyVt0L8x3rq44R4OW/VNZq0iaR668hl2VMbm8vXPM9aUTylTNEy5r9aKgVxWOq WQhkOngqIIeDJh+k2aryhU28WPQWfhhDseHzll2NRbm7zdmBjt1i3QXBpuH37iUHog w8+KjRy3K67WgWcVtLr5iGaqLNJEgb9mdxfH4aI/y4fGKxuemOdHHqKCImDzE/A+n7 5EWpxHeVv9sFQ== Date: Thu, 4 Jan 2024 09:47:36 -0700 From: Keith Busch To: Stuart Hayes Cc: linux-kernel@vger.kernel.org, Jens Axboe , Christoph Hellwig , Sagi Grimberg , linux-nvme@lists.infradead.org Subject: Re: [PATCH] nvme_core: scan namespaces asynchronously Message-ID: References: <20240104163826.10561-1-stuart.w.hayes@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240104163826.10561-1-stuart.w.hayes@gmail.com> On Thu, Jan 04, 2024 at 10:38:26AM -0600, Stuart Hayes wrote: > Currently NVME namespaces are scanned serially, so it can take a long time > for all of a controller's namespaces to become available, especially with a > slower (fabrics) interface with large number (~1000) of namespaces. > > Use async function calls to make namespace scanning happen in parallel, > and add a (boolean) module parameter "async_ns_scan" to enable this. Hm, we're not doing a whole lot of blocking IO to bring up a namespace, so I'm a little surprised it makes a noticable difference. How much time improvement are you observing by parallelizing the scan? Is there a tipping point in Number of Namespaces where inline scanning is better than asynchronous? And if it is a meaningful gain, let's not introduce another module parameter to disable it.