From owner-freebsd-current@freebsd.org Tue Dec 10 16:06:34 2019 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 B61CE1DD27C for ; Tue, 10 Dec 2019 16:06:34 +0000 (UTC) (envelope-from eric@vangyzen.net) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [199.48.133.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47XQ0n6mZNz3Jff for ; Tue, 10 Dec 2019 16:06:33 +0000 (UTC) (envelope-from eric@vangyzen.net) Received: from cerise.vangyzen.net (unknown [70.97.188.230]) by smtp.vangyzen.net (Postfix) with ESMTPSA id 56CEA564D6; Tue, 10 Dec 2019 10:06:27 -0600 (CST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3601.0.10\)) Subject: Re: dtrace not working on bhyve VM without invariant_tsc From: Eric van Gyzen In-Reply-To: Date: Tue, 10 Dec 2019 10:06:26 -0600 Cc: FreeBSD Current Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Ryan Stone X-Mailer: Apple Mail (2.3601.0.10) X-Rspamd-Queue-Id: 47XQ0n6mZNz3Jff X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of eric@vangyzen.net designates 199.48.133.146 as permitted sender) smtp.mailfrom=eric@vangyzen.net X-Spamd-Result: default: False [-5.01 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+a]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[vangyzen.net]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; IP_SCORE(-3.21)[ip: (-8.41), ipnet: 199.48.132.0/22(-3.75), asn: 36236(-3.84), country: US(-0.05)]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:36236, ipnet:199.48.132.0/22, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.29 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, 10 Dec 2019 16:06:34 -0000 > On Dec 9, 2019, at 8:27 PM, Ryan Stone wrote: >=20 > I have a bhyve VM guest on my laptop where dtrace just constantly > aborts whenever I try to use it: >=20 > [rstone@ebpf dtrace]sudo dtrace -s fdcopy.d > Assertion failed: (buf->dtbd_timestamp >=3D first_timestamp), file > = /usr/home/rstone/git/bsd-worktree/ebpf-import/cddl/contrib/opensolaris/lib= /libdtrace/common/dt_consume.c, > line 3026. > Abort trap >=20 > I believe that the problem is caused by dtrace unconditionally using > rdtsc() to implement dtrace_gethrtime(), assuming that the values will > be stable for a given CPU. The VM's vcpus seem to be getting migrated > frequently. >=20 > Should dtrace instead be using the system timecounter? That should > stand a much better chance of being monotonically increasing. I=E2=80=99ve seen TSC issues with OneFS under bhyve on certain CPUs. = Pinning the VM to CPUs 1-N (i.e. avoiding CPU 0) worked around it. You = might try that as a workaround. Eric=