From owner-svn-src-all@freebsd.org Tue Jun 23 21:44:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F410833A7A8; Tue, 23 Jun 2020 21:44:00 +0000 (UTC) (envelope-from mckusick@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49s0Ch6JTTz4C8V; Tue, 23 Jun 2020 21:44:00 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D393726A7A; Tue, 23 Jun 2020 21:44:00 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05NLi0Vn046626; Tue, 23 Jun 2020 21:44:00 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05NLi0tN046625; Tue, 23 Jun 2020 21:44:00 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <202006232144.05NLi0tN046625@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Tue, 23 Jun 2020 21:44:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362561 - head/sys/geom/journal X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sys/geom/journal X-SVN-Commit-Revision: 362561 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Jun 2020 21:44:01 -0000 Author: mckusick Date: Tue Jun 23 21:44:00 2020 New Revision: 362561 URL: https://svnweb.freebsd.org/changeset/base/362561 Log: Optimize g_journal's superblock update by noting that the summary information is neither read nor written so it need not be written out when updating the superblock. PR: 247425 Sponsored by: Netflix Modified: head/sys/geom/journal/g_journal_ufs.c Modified: head/sys/geom/journal/g_journal_ufs.c ============================================================================== --- head/sys/geom/journal/g_journal_ufs.c Tue Jun 23 21:37:12 2020 (r362560) +++ head/sys/geom/journal/g_journal_ufs.c Tue Jun 23 21:44:00 2020 (r362561) @@ -68,7 +68,6 @@ g_journal_ufs_clean(struct mount *mp) static void g_journal_ufs_dirty(struct g_consumer *cp) { - struct fs_summary_info *fs_si; struct fs *fs; int error; @@ -81,15 +80,18 @@ g_journal_ufs_dirty(struct g_consumer *cp) ("g_journal_ufs_dirty: non-NULL fs %p\n", fs)); return; } + /* + * Do not use or change summary information, so free it now + * to avoid unnecessarily writing it back out in ffs_sbput(). + */ + g_free(fs->fs_csp); + g_free(fs->fs_si); + fs->fs_si = NULL; + GJ_DEBUG(0, "clean=%d flags=0x%x", fs->fs_clean, fs->fs_flags); fs->fs_clean = 0; fs->fs_flags |= FS_NEEDSFSCK | FS_UNCLEAN; - fs_si = fs->fs_si; - fs->fs_si = NULL; error = ffs_sbput(cp, fs, fs->fs_sblockloc, g_use_g_write_data); - fs->fs_si = fs_si; - g_free(fs->fs_csp); - g_free(fs->fs_si); g_free(fs); if (error != 0) { GJ_DEBUG(0, "Cannot mark file system %s as dirty "