Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Mar 2019 20:20:18 -0700 (PDT)
From:      "Rodney W. Grimes" <freebsd@gndrsh.dnsmgr.net>
To:        Mark Johnston <markj@freebsd.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r345359 - in head/sys/cddl/dev/dtrace: amd64 i386
Message-ID:  <201903210320.x2L3KIjc058579@gndrsh.dnsmgr.net>
In-Reply-To: <201903210252.x2L2qMSP022374@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
> Author: markj
> Date: Thu Mar 21 02:52:22 2019
> New Revision: 345359
> URL: https://svnweb.freebsd.org/changeset/base/345359
> 
> Log:
>   Don't attempt to measure TSC skew when running as a VM guest.
>   
>   It simply doesn't work in general since VCPUs may migrate between
>   physical cores.  The approach used to measure skew also doesn't
>   make much sense in a VM.

"May" is the important aspect here, and to my knowledge both
bhyve and Vmware provide a way to pin cpus there should be
a way for us to turn this back on if it is desired.  Sticking
it under the big knob vm_guest is probably not the most flexiable
solution.

Could we please have someway to force this back on?

>   
>   PR:		218452
>   MFC after:	2 weeks
>   Sponsored by:	The FreeBSD Foundation
> 
> Modified:
>   head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
>   head/sys/cddl/dev/dtrace/i386/dtrace_subr.c
> 
> Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
> ==============================================================================
> --- head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c	Thu Mar 21 01:16:37 2019	(r345358)
> +++ head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c	Thu Mar 21 02:52:22 2019	(r345359)
> @@ -319,6 +319,9 @@ dtrace_gethrtime_init(void *arg)
>  	int i;
>  #endif
>  
> +	if (vm_guest)
> +		return;
> +
>  	/* The current CPU is the reference one. */
>  	sched_pin();
>  	tsc_skew[curcpu] = 0;
> 
> Modified: head/sys/cddl/dev/dtrace/i386/dtrace_subr.c
> ==============================================================================
> --- head/sys/cddl/dev/dtrace/i386/dtrace_subr.c	Thu Mar 21 01:16:37 2019	(r345358)
> +++ head/sys/cddl/dev/dtrace/i386/dtrace_subr.c	Thu Mar 21 02:52:22 2019	(r345359)
> @@ -321,6 +321,9 @@ dtrace_gethrtime_init(void *arg)
>  	int i;
>  #endif
>  
> +	if (vm_guest)
> +		return;
> +
>  	/* The current CPU is the reference one. */
>  	sched_pin();
>  	tsc_skew[curcpu] = 0;
> 
> 

-- 
Rod Grimes                                                 rgrimes@freebsd.org



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