Received: by 10.213.65.68 with SMTP id h4csp2014857imn; Thu, 5 Apr 2018 07:36:13 -0700 (PDT) X-Google-Smtp-Source: AIpwx48xBq+Cs7EWmDTuLpHzN5e0tx8MntqDIwgHscbxrYXO/2MtxfqTqitYI8ud0OOZVxPXpJ10 X-Received: by 2002:a17:902:1e3:: with SMTP id b90-v6mr23162531plb.155.1522938973032; Thu, 05 Apr 2018 07:36:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522938973; cv=none; d=google.com; s=arc-20160816; b=VdjT77Tkgl+hGlI4Jcx/HrwJPVGNTCJiphEaL8ca1EYSvT3f5bKqw7+lEp6+YVz9iq oE7Yx/YArgPc+5JE2I+71j4FxejqjsS5S7QFhxkquEHZfo9pSnWsbzIKWy9Mtk1edNff Q0JcOFcmcUvbsCeKqoAGP5tTrw/nU7M+V0kwupaqmzP6FZHrCVuIPUHJXuLa3WQSJ/6Y qxcIYJaSTaG6c5qjP4v9adrR4AQ/3Gl9irNoWtyGpjux+tix90+jRqNJ8zvctZuDw6gj jn/YvsTPcrANND6zVYZH822vEtPotI+YFG7DHws3wsOm2+pbRznFU6t6kh+cM4dtgJ9j CBxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:arc-authentication-results; bh=srN4XurR2jfL9T3hrPUJAgDjVM3PkTLxSI+R2eltVDw=; b=LIeWjSe3V+925nCqBl+BRKZUNSHRYB584pEQtcNSkkQNU7SgkvemG/VtIjKqAvCjDO nn0+S1faUNzrSDZOpvsmDJ6kt0tXAx4kNgQKAYHZyvf+plTcqpP43lsQIhTU/TVqubJi DI0VVdvi+KyaBHJWWGOM9lv6yaFRPl2Pt23N18o7LxegYU4mvQ4u5FK9kqlXjJ+fpTMp jV1IYMIwxYbu5y8yFZ7gZI7sWxW6RE0c8gHZE/8/T35BYI3EB42tTLVGX+x1MftYv/2r KPeRA48QfikUuwleRFQ6fVGsh8WbPdwNRhok45ReIPLlClLegvpTmRcE9tQC0L2uSMzV 0fcg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a1-v6si6070249plt.693.2018.04.05.07.35.59; Thu, 05 Apr 2018 07:36:13 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751519AbeDEOec (ORCPT + 99 others); Thu, 5 Apr 2018 10:34:32 -0400 Received: from www.llwyncelyn.cymru ([82.70.14.225]:50646 "EHLO fuzix.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751179AbeDEOe2 (ORCPT ); Thu, 5 Apr 2018 10:34:28 -0400 Received: from alans-desktop (82-70-14-226.dsl.in-addr.zen.co.uk [82.70.14.226]) by fuzix.org (8.15.2/8.15.2) with ESMTP id w35EY7QP013850; Thu, 5 Apr 2018 15:34:07 +0100 Date: Thu, 5 Apr 2018 15:34:06 +0100 From: Alan Cox To: Paul Menzel Cc: Hans de Goede , Tejun Heo , linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: Decrease boot time with AHCI drives? Message-ID: <20180405153343.7962a1f0@alans-desktop> In-Reply-To: References: Organization: Intel Corporation X-Mailer: Claws Mail 3.15.1-dirty (GTK+ 2.24.31; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > But more importantly, it takes roughly half a second to set up the > device. I understand, that the probing is part of AHCI(?), and in this > case the Crucial m4 SSD drive/firmware is especially slow. So, I assume > it will be hard to improve anything in the code to decrease the time. Probably. The OS basically waits for the device to flag read. It's not that slow (spinning rust can take several seconds, and historically up to 30) > So, is there a way to avoid doing the probing twice or at all? That You have to do it once. It's not probing that is slow. Your SSD is basically a single board computer pretending to be a disk. It's go to boot and load in and work out what the hell it's doing, what happened before it died and so on. Spinning rust is similar - in fact with a modern ATA disk plugged into a really old machine it's not uncommon that the disk has the most CPU power 8) Once you have completed the boot for that channel (so for SATA pretty much for that device) you could in theory pass the OS a flag saying 'is initialized, is present' and you'd be able to avoid a repeat reset/probe and just go on to re-issue identify and similar commands in order to re-obtain the configuration data of the drive. Those commands are fast on any hardware I've seen. This is known to work for straigt ATA - it's sort of what we do in the corner cases where we find an ATA class controller we don't support. AHCI is a bit more complex but the theory should hold. Alan