From nobody Wed Dec 01 07:49:30 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 6156918A46D3; Wed, 1 Dec 2021 07:49:34 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J3rp60kCgz56X8; Wed, 1 Dec 2021 07:49:34 +0000 (UTC) (envelope-from avg@freebsd.org) Received: from [192.168.0.88] (unknown [195.64.148.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: avg/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 578F4E654; Wed, 1 Dec 2021 07:49:33 +0000 (UTC) (envelope-from avg@freebsd.org) Message-ID: <0b0a702b-4cc9-77ee-231e-6db8121af817@FreeBSD.org> Date: Wed, 1 Dec 2021 09:49:30 +0200 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.3.0 From: Andriy Gapon Subject: Re: git: 3d9d64aa1846 - main - kern_tc: unify timecounter to bintime delta conversion Content-Language: en-US To: Kyle Evans References: <202111301334.1AUDYJEU014078@gitrepo.freebsd.org> <69d4804d-1d94-7757-5c93-0d062f9c31c0@FreeBSD.org> Cc: src-committers@freebsd.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@freebsd.org In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638344974; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GbkPIgxqADIpzPCSj+qYIqrRMWfERCFpu4yDblwRDQY=; b=pz8+5mwwgoT8wngFaL9oOCSmOkdv42YCAzD59ouYvLZUh13lGseQCh8M7LseFAJ1EKOuhl YvTn0fEmoQDMwISiK6Tlpmy1V6HsOL6uOKPFOJOxjjHWv8RBv68gLWPFcAwCXLI2e+pAxq aV1DLToudMfoyz96Wh7sff4cYGJ4FT+zorF28AOEhICKJsuuLWC/bjf9tTd1L6PupZEXDc CN0O/UFiacbJrUmJUcRYpYlfV3iIppHztfFNLQm9d8LhIPC6eVHoYWXWohbOMuvc7quAO8 KBUV5Gm321h7IFQFY1Q8TMwYwSiDo+pIikQ7NlE5HMOSf0EKMk2nXoDxeOrycQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638344974; a=rsa-sha256; cv=none; b=VRcjqDXloaaLXc/G4oAP/b/nLTKgV8xKC7OIjlUoX41O8erlc/LLi+vZ6jtBicmoM/5DME ULQgG97Ra7k6O6fHAltlVsSEns2Ec5PbgO4D+GAXn1qEbUyra1QQdkGFkYZJIkx5ZeAawg cOsu/+MvYip2j8GdSYu/v5CRD0BEAzTnev8MdcluXAJJw6nX4XZiJz50AA8cjv5jFNg6ja 3FJQCGW62DQ8iBoQbmsad1X6o0pQwCa5B31WqTCwxz3E1syR9wImHrdskRAVxytXM01z1t sapGT+IBTrwxVlVIRSTcI5GmeT1JdvMPPZ8Dc63pwxk4bV3zP8HlgBCckyCzlQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N On 30/11/2021 23:35, Kyle Evans wrote: > On Tue, Nov 30, 2021 at 11:08 AM Andriy Gapon wrote: >> >> On 30/11/2021 18:14, Kyle Evans wrote: >>> I wonder if this helps explain the behavior we saw when enabling TSC >>> on VirtualBox guests. Threads doing small ~1 second or less sleeps >>> would start to miss their wakeups, so we'd consistently see, e.g., >>> shutdown issues after applying a high loading while we're waiting for >>> bufdaemon threads. >> >> It very well may be the case. >> The reason I arrived at this change is that we also sometimes saw the same >> problem but on VMWware. That prompted me to add some diagnostic code to >> sleepqueue to turn those missed wakeups into panics. >> >> As kib pointed out, mav recently made a change that would mask the problem as a >> side effect: >> https://cgit.FreeBSD.org/src/commit/?id=6df1359e5542f69179c142be1ea099d447e273d1 >> But I wanted to fix the root cause anyway. >> > > Ok, cool, thanks! > > I'll do some re-testing under VirtualBox and see if we can just revert > this entirely: https://cgit.freebsd.org/src/commit/sys/x86/x86/tsc.c?id=8cc15b0dfc2f3299 That would be an interesting test. Just a thought that there could be other problems with VirtualBox. When I debugged the problem with VMWare, changing timecounters did not help because, in hindsight, the issue was not specific to any particular one. So, perhaps the VirtualBox TSC wraps around too fast or can jump erratically, etc. -- Andriy Gapon