From owner-freebsd-current@freebsd.org Tue Mar 9 06:38:39 2021 Return-Path: Delivered-To: freebsd-current@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 AAA0856B97A for ; Tue, 9 Mar 2021 06:38:39 +0000 (UTC) (envelope-from yasu@utahime.org) Received: from maybe.home.utahime.org (gate.home.utahime.org [183.180.29.210]) (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 mx1.freebsd.org (Postfix) with ESMTPS id 4DvlsV5bBzz4v7M for ; Tue, 9 Mar 2021 06:38:38 +0000 (UTC) (envelope-from yasu@utahime.org) Received: from eastasia.home.utahime.org (eastasia.home.utahime.org [192.168.174.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by maybe.home.utahime.org (Postfix) with ESMTPS id 989A82E315 for ; Tue, 9 Mar 2021 15:38:34 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=utahime.org; s=maybe2019112701; t=1615271914; bh=ucm/A9RkEozn5YNIcPLYszKbdLBNRAdZT1VyMpOXD20=; h=Date:To:Subject:From:In-Reply-To:References; b=xrKauRBsdyivdFD3yZdlcKQqyA6PD3WQoI+jrh55ueIl632GbHO4OYfP5Geu9mTwv SkDD4Qf/7xdxY5N8tclDUywNHjDhHX6NtHzhXHY9Jv8tSXUZOUt/is+VghCL5UDreL kWqNuAVFE/58eM5B6NfXDRrRCjcXc8X8h0oDhBdNmOTGDxUpkFjHt7rZwZ4IfUA2Kb fGZ/eeRHtZ/FFOya21Q5am7oYOZVQEybL7VRW7ElqEUF0OcM7t6vn683YfYBBKn0Og 69G80nfENOIsP2BRKm8Cp8xLoyzCsKS44syQ+NBELtT7LXgHoN4U6hRXBY6vWYBXU/ Pqfs7VkpN4tBw== Received: from localhost (rolling.home.utahime.org [192.168.174.11]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by eastasia.home.utahime.org (Postfix) with ESMTPSA id C78C431874; Tue, 9 Mar 2021 15:38:33 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.1 at eastasia.home.utahime.org Date: Tue, 09 Mar 2021 15:37:44 +0900 (JST) Message-Id: <20210309.153744.777333655764248949.yasu@utahime.org> To: freebsd-current@freebsd.org Subject: Re: Waiting for bufdaemon From: Yasuhiro Kimura In-Reply-To: References: <20210309.005732.1808108188909983665.yasu@utahime.org> <20210309.015021.2131122829257392547.yasu@utahime.org> X-Mailer: Mew version 6.8 on Emacs 27.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4DvlsV5bBzz4v7M X-Spamd-Bar: + Authentication-Results: mx1.freebsd.org; dkim=pass header.d=utahime.org header.s=maybe2019112701 header.b=xrKauRBs; dmarc=none; spf=pass (mx1.freebsd.org: domain of yasu@utahime.org designates 183.180.29.210 as permitted sender) smtp.mailfrom=yasu@utahime.org X-Spamd-Result: default: False [1.26 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+a:spf-authorized.utahime.org]; TO_DN_NONE(0.00)[]; HFILTER_HELO_IP_A(1.00)[maybe.home.utahime.org]; HFILTER_HELO_NORES_A_OR_MX(0.30)[maybe.home.utahime.org]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[utahime.org:+]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RBL_DBL_DONT_QUERY_IPS(0.00)[183.180.29.210:from]; ASN(0.00)[asn:2519, ipnet:183.180.0.0/16, country:JP]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[utahime.org:s=maybe2019112701]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[utahime.org]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; SPAMHAUS_ZRD(0.00)[183.180.29.210:from:127.0.2.255]; NEURAL_SPAM_SHORT(0.96)[0.957]; MID_CONTAINS_FROM(1.00)[]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-current] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Mar 2021 06:38:39 -0000 From: Kyle Evans 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