git: d4724934f2e4 - stable/13 - vfs_mountroot: Skip 'Root mount waiting' < 1 s

From: Colin Percival <cperciva_at_FreeBSD.org>
Date: Wed, 12 Jan 2022 19:30:59 UTC
The branch stable/13 has been updated by cperciva:

URL: https://cgit.FreeBSD.org/src/commit/?id=d4724934f2e41c850c0e714ebb89f888252b0ddd

commit d4724934f2e41c850c0e714ebb89f888252b0ddd
Author:     Colin Percival <cperciva@FreeBSD.org>
AuthorDate: 2021-12-20 15:17:25 +0000
Commit:     Colin Percival <cperciva@FreeBSD.org>
CommitDate: 2022-01-12 19:29:37 +0000

    vfs_mountroot: Skip 'Root mount waiting' < 1 s
    
    While the message is technically correct, it's not particularly
    helpful in the case where we're only waiting a few ms; this case
    occurs frequently on EC2 arm64 instances with CAM initialization
    racing to release its root hold before vfs_mountroot reaches this
    point.  Only print the message if we end up waiting for more than
    one second.
    
    Sponsored by:   https://www.patreon.com/cperciva
    Differential Revision:  https://reviews.freebsd.org/D33591
    
    (cherry picked from commit e6db5eb9ec7ba9edfc564fd5ade5fb40df9acebb)
---
 sys/kern/vfs_mountroot.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sys/kern/vfs_mountroot.c b/sys/kern/vfs_mountroot.c
index 9a3895b6f830..3ea9a7397d06 100644
--- a/sys/kern/vfs_mountroot.c
+++ b/sys/kern/vfs_mountroot.c
@@ -987,6 +987,7 @@ vfs_mountroot_wait(void)
 
 	curfail = 0;
 	lastfail.tv_sec = 0;
+	ppsratecheck(&lastfail, &curfail, 1);
 	while (1) {
 		g_waitidle();
 		mtx_lock(&root_holds_mtx);