Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 09 Mar 2021 15:37:44 +0900 (JST)
From:      Yasuhiro Kimura <yasu@utahime.org>
To:        freebsd-current@freebsd.org
Subject:   Re: Waiting for bufdaemon
Message-ID:  <20210309.153744.777333655764248949.yasu@utahime.org>
In-Reply-To: <CACNAnaHDTeDmNWXTSU4TzF9C_CUpT_3Vr3GgmhjSqWaGWtjXBg@mail.gmail.com>
References:  <20210309.005732.1808108188909983665.yasu@utahime.org> <20210309.015021.2131122829257392547.yasu@utahime.org> <CACNAnaHDTeDmNWXTSU4TzF9C_CUpT_3Vr3GgmhjSqWaGWtjXBg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
From: Kyle Evans <kevans@freebsd.org>
Subject: Re: Waiting for bufdaemon
Date: Mon, 8 Mar 2021 11:07:23 -0600

> I've tried tracking down exactly what the problem is that causes the
> symptoms we're seeing, but no luck so far. I'm eyeballing the
> following patch which partially reverts kib's 84eaf2ccc6aa05 ("x86:
> stop punishing VMs with low priority for TSC timecounter") and only
> punishes VirtualBox guests.
> 
> diff --git a/sys/x86/x86/tsc.c b/sys/x86/x86/tsc.c
> index 68fc57e6ea7..6f25360a67c 100644
> --- a/sys/x86/x86/tsc.c
> +++ b/sys/x86/x86/tsc.c
> @@ -501,7 +501,12 @@ test_tsc(int adj_max_count)
>         uint64_t *data, *tsc;
>         u_int i, size, adj;
> 
> -       if ((!smp_tsc && !tsc_is_invariant) || vm_guest)
> +       /*
> +        * Misbehavior of TSC under VirtualBox has been observed.  In
> +        * particular, threads doing small (~1 second) sleeps may miss their
> +        * wakeup and hang around in sleep state, causing hangs on shutdown.
> +        */
> +       if ((!smp_tsc && !tsc_is_invariant) || vm_guest == VM_GUEST_VBOX)
>                 return (-100);
>         size = (mp_maxid + 1) * 3;
>         data = malloc(sizeof(*data) * size * N, M_TEMP, M_WAITOK);

After updating to 6ffdaa5f2d4, I confirmed timeout of bufdaemon
dosen't happen even if I don't set kern.timecounter.hardware at all in
loader.conf.

Thank you for fixing the problem.

---
Yasuhiro Kimura



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20210309.153744.777333655764248949.yasu>