Project

General

Profile

Bug #9501

bootadm update-archive -nvC does more ZFS work than required

Added by Andy Fiddaman about 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
cmd - userland programs
Start date:
2018-04-25
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:

Description

svc:/system/boot-archive:default runs bootadm -nvC during boot to check if the boot archive needs updating and allows 60 seconds for completion by default.

On a system with many ZFS filesystems, this service has been observed to time out during boot as ioctl(x, ZFS_IOC_POOL_STATS, 0xxxxxxxxx) takes over 2 minutes to complete - although it does complete successfully. Once the system is running, the command completes quickly.

bootadm does not need to call this ioctl at all when checking the boot archive; reversing the order of tests to avoid calling is_be() unless necessary significantly reduces the work that has to be done.

diff --git a/usr/src/cmd/boot/bootadm/bootadm.c b/usr/src/cmd/boot/bootadm/bootadm.c
index c45e7a5bda..1da65932b2 100644
--- a/usr/src/cmd/boot/bootadm/bootadm.c
+++ b/usr/src/cmd/boot/bootadm/bootadm.c
@@ -4075,7 +4075,7 @@ update_archive(char *root, char *opt)
        /*
         * Never update non-BE root in update_all
         */
-       if (!is_be(root) && bam_update_all)
+       if (bam_update_all && !is_be(root))
                return (BAM_SUCCESS);
        /*
         * root must belong to a boot archive based OS,

r151026# dtrace -Fn 'fbt:zfs::{@ = count();}' -c 'bootadm update-archive -nvC'
          1612870
r151026# dtrace -Fn 'fbt:zfs::{@ = count();}' -c '/tmp/bootadm update-archive -nvC'
           612300

History

#1

Updated by Andy Fiddaman about 1 year ago

  • Subject changed from bootadm -nvC does more ZFS work than required to bootadm update-archive -nvC does more ZFS work than required
#2

Updated by Electric Monk about 1 year ago

  • Status changed from New to Closed
  • % Done changed from 80 to 100

git commit 5850749aaf781e7f284cedc8429eb16adf367802

commit  5850749aaf781e7f284cedc8429eb16adf367802
Author: Andy Fiddaman <omnios@citrus-it.co.uk>
Date:   2018-04-25T17:53:53.000Z

    9501 bootadm update-archive -nvC does more ZFS work than required
    Reviewed by: Andrew Stormont <andyjstormont@gmail.com>
    Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
    Reviewed by: Igor Kozhukhov <igor@dilos.org>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom PDF