Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp1485074ybf; Sun, 1 Mar 2020 10:33:29 -0800 (PST) X-Google-Smtp-Source: APXvYqynWkOhFtpbLTK8NVtxSHKJA171TPN/TiJykyyR99iAvUS86J7RLpYaP1mcis3AiJC/vKgm X-Received: by 2002:a54:4595:: with SMTP id z21mr9426589oib.136.1583087609682; Sun, 01 Mar 2020 10:33:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583087609; cv=none; d=google.com; s=arc-20160816; b=xLUgaCLLw6NMn6agJl0iIhxsbRICinTq/+W6EoX2qzAVZLnuHF9MdfO8b/lZ6QejnA WWvEmV9nvUNU41m58o2zm7Dr4e7XhFt2iGwMVRNtqd9eHUPEYZOYb1mDEyIaWnQA4v0/ WTAldHZ00gImDMSRH0IMoxqTCat2GAFRRPsu5CJOYv43njuB8ZaVPiU77eF1jGDQSitD YI+rI2rjXWt9/9F8TuEBphwhYc9s0DqoMPgMaX+w3NJpvkjPVIFZK1pqrgedlKKzMooY 7+d+zwBCUIcTjJSmcx6HIHdBgsr51pzRrfoSmX7TeGMDer8IaQMW9d+P8E0QUhg9TUwI i3Gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=EjTuQQNUCLJ/ARg4RtqYnS0QncUHGWRUZ9C348/7lAI=; b=I34LOffLKcHu9SDAcONsk4uHWxn0HtaogvocxpND1zPerVoM983Dn6WplTblKhFCnI TtDPOoZDQBMRqm4eRO95RZoFso9Ozx/lhKBPMRJBDvooVgysOk5OPW9fYLSxaxlHoOKl zmuwgs5itbUwYI4UgzHSKAU9B0dvt/R3cBP+5Tutr7QJQQ4R+QcECibY7PUWF/QUDBlu 6Ofggp/Ya8UQIRqnOCiQI/M7oWVaL3v4gHo7vmPBmGhUmuhQBKpAubX6CQbxk/k1Bgm9 L/u2YVYviIcXgYC4LDYPrDeDaS0Jd5P5Ta0gVCBkVLy5phyGmpk3qjmyPpM8QX6g+NhN WAXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="cUP/0V54"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j15si4526308oie.15.2020.03.01.10.33.15; Sun, 01 Mar 2020 10:33:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="cUP/0V54"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726621AbgCASce (ORCPT + 99 others); Sun, 1 Mar 2020 13:32:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:38254 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726418AbgCASce (ORCPT ); Sun, 1 Mar 2020 13:32:34 -0500 Received: from dhcp-10-100-145-180.wdl.wdc.com (unknown [199.255.45.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 72AA3246D4; Sun, 1 Mar 2020 18:32:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583087553; bh=GOHQ3umUBu5BEnrmOm6f0fS44zEn7yEiHI8nMTgJgTI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cUP/0V54kpu2sQ+h0/PxsiF63letvU+vcX8YvhJIhlLyFa44M9TTNaU0eSPy04KsB vOXG+adWcdipgEah2OrN6uIa9hkSGlim5iSEBGIlROsvEgtZ3Ic3ebBol9Hgw33WNg VsGjsZVBeKrIwLqE1QXLXo+7z8BpDrGlafKXZPkA= Date: Sun, 1 Mar 2020 10:32:31 -0800 From: Keith Busch To: Josh Triplett Cc: Jens Axboe , Christoph Hellwig , Sagi Grimberg , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] nvme: Check for readiness more quickly, to speed up boot time Message-ID: <20200301183231.GA544682@dhcp-10-100-145-180.wdl.wdc.com> References: <20200229025228.GA203607@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200229025228.GA203607@localhost> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 28, 2020 at 06:52:28PM -0800, Josh Triplett wrote: > @@ -2074,7 +2074,7 @@ static int nvme_wait_ready(struct nvme_ctrl *ctrl, u64 cap, bool enabled) > if ((csts & NVME_CSTS_RDY) == bit) > break; > > - msleep(100); > + usleep_range(1000, 2000); > if (fatal_signal_pending(current)) > return -EINTR; > if (time_after(jiffies, timeout)) { The key being this sleep schedules the task unlike udelay. It's neat you can boot where 100ms is considered a long time. This clearly helps when you've one nvme that becomes ready quickly, but what happens with many nvme's that are slow to ready? This change will end up polling the status of those 1000's of times, I wonder if there's a point where this frequent sleep/wake cycle initializing a whole lot of nvme devices in parallel may interfere with other init tasks. I doubt there's really an issue there, but thought it's worth considering what happens at the other end of the specturm. Anyway, the patch looks fine to me. Reviewed-by: Keith Busch