From nobody Wed Dec 29 23:06:28 2021 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 2AABD191FE9F; Wed, 29 Dec 2021 23:06:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JPRqB0XKxz3kHl; Wed, 29 Dec 2021 23:06:29 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D541F597B; Wed, 29 Dec 2021 23:06:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1BTN6SPB090337; Wed, 29 Dec 2021 23:06:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BTN6Sx9090336; Wed, 29 Dec 2021 23:06:28 GMT (envelope-from git) Date: Wed, 29 Dec 2021 23:06:28 GMT Message-Id: <202112292306.1BTN6Sx9090336@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: cdbcf636d3e0 - stable/13 - EFI loader: Don't free bcache for DEVT_DISK devs List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: cdbcf636d3e03f5f0565430b23fa5dff6defb6c6 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640819190; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TpLNeEscOfsaA++mav2MrUdll+JJjFE0GgxsiwSJe7U=; b=eVhqTvZ3coU71a1FlQVGCVYPDLPSPV5dEUk8ToaTjX/ucN93CkPucW1GCgCnz4cil/yDcp 7gTv9I9VdJjm4/loFcsWzmlFo/4RbMW+1zlsV0wy+toZpob7sEN7EW4PU23mFu8FFWvcFk FmJ4eqR4tfxk8uq5k7qy65DZm02Fpz/oyNE8UE8avplT/91H1ugalQNYiBKUHHhVPF4TJ4 fjLE4FGjYUszkATNUTZ+3tXVUr+BPx32WNHJosN6FfRN7WgwL53FO5NGaninu54otg6oiu Yt+6MqQVlEcaDb3MZQUo4HJedcKLnDWeq1Z45pnarOpo2QjNNXmODFI6O/ZSsw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640819190; a=rsa-sha256; cv=none; b=R6VhllH+sjfRyoEs23+HlwjptltQw6m1aji0xsr0yk78g4QnRUIU1TkzZJKKZ/YNikvKpA vEXn9BiL2TY1bRWnKF//CcsUvg250SZoLAQ0XNOLtdBDSOMX2saK6swyK3opegncXWmzZx bgUyajCMgCBxuqM/KimifK9AIaGnuCEIFBNv5ANhHtbEHXJHgPM3GfFG47eCsA/vQ6RdF2 jrJu8wgAaW6Y7Ewqt2dnVr0J958txbtp94K57/lmSYTP1Y8VHESlq5hthYhCcsKxhKImi/ mIHmHUzu5L8QmtvY0oSIiePpLulMcsJ0nHD7hd6lwMrI7hJ/cDAxuwCL8II23Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=cdbcf636d3e03f5f0565430b23fa5dff6defb6c6 commit cdbcf636d3e03f5f0565430b23fa5dff6defb6c6 Author: Colin Percival AuthorDate: 2021-09-30 21:48:14 +0000 Commit: Colin Percival CommitDate: 2021-12-29 22:53:19 +0000 EFI loader: Don't free bcache for DEVT_DISK devs Booting on an EC2 c5.xlarge instance, this reduces the number of I/Os performed from 609 to 432, reduces the total number of blocks read from 61963 to 60797, and reduces the time spent in the loader by 39 ms. Note that b4cb3fe0e39a allowed the bcache to be retained for most of the boot process, but relies on mounting filesystems; this commit allows the bcache to be retained at the start of the boot process, before the root filesystem has been located. Sponsored by: https://www.patreon.com/cperciva Differential Revision: https://reviews.freebsd.org/D32239 (cherry picked from commit ce73f768b76486b1562f207a6fc1cef87065418a) --- stand/efi/libefi/efipart.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/stand/efi/libefi/efipart.c b/stand/efi/libefi/efipart.c index aede28ef40c3..7807c17077a6 100644 --- a/stand/efi/libefi/efipart.c +++ b/stand/efi/libefi/efipart.c @@ -949,8 +949,10 @@ efipart_close(struct open_file *f) pd->pd_open--; if (pd->pd_open == 0) { pd->pd_blkio = NULL; - bcache_free(pd->pd_bcache); - pd->pd_bcache = NULL; + if (dev->dd.d_dev->dv_type != DEVT_DISK) { + bcache_free(pd->pd_bcache); + pd->pd_bcache = NULL; + } } if (dev->dd.d_dev->dv_type == DEVT_DISK) return (disk_close(dev));