From nobody Fri Oct 08 16:08:57 2021 X-Original-To: dev-commits-src-all@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 A43AB17E980F; Fri, 8 Oct 2021 16:08:58 +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 4HQtRG2BjHz4jW1; Fri, 8 Oct 2021 16:08:58 +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 C4445202C; Fri, 8 Oct 2021 16:08:57 +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 198G8vjw001910; Fri, 8 Oct 2021 16:08:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 198G8vlv001909; Fri, 8 Oct 2021 16:08:57 GMT (envelope-from git) Date: Fri, 8 Oct 2021 16:08:57 GMT Message-Id: <202110081608.198G8vlv001909@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: e70ed10f8f4d - stable/12 - EFI loader: Don't free bcache for DEVT_DISK devs List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: e70ed10f8f4d648ae69052aa805d36344ae75140 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=e70ed10f8f4d648ae69052aa805d36344ae75140 commit e70ed10f8f4d648ae69052aa805d36344ae75140 Author: Colin Percival AuthorDate: 2021-09-30 21:48:14 +0000 Commit: Kyle Evans CommitDate: 2021-10-08 08:04:57 +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. Reviewed by: imp, tsoome MFC after: 1 week 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 424df7d2e423..2afc96a45b10 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));