From owner-freebsd-current@FreeBSD.ORG Thu Jan 22 01:06:47 2015 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 533E3637 for ; Thu, 22 Jan 2015 01:06:47 +0000 (UTC) Received: from mail-la0-f46.google.com (mail-la0-f46.google.com [209.85.215.46]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CD481B8E for ; Thu, 22 Jan 2015 01:06:46 +0000 (UTC) Received: by mail-la0-f46.google.com with SMTP id s18so22529712lam.5 for ; Wed, 21 Jan 2015 17:06:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=QLHUUh3vO4ncsxCsjMXuT6DjfPAQiJ0erU3SyayxbK0=; b=cqjQMCBMVwxjaD8QrouLYbkw6175M9pzukEtV4yD3WVOF6WwVsv9vRYTKBY0sWgVsY NyYCekqkraniK2Ys0zPIWpuLbD7MZEBO0KQNwACVGI1m+P70m+H0bcJdPp6qm20s4dlN TB6KTfz0+LiMWPDo9kaPQxWtn1BTtkFC1zZeCw9+h8VW+uUoynsPAzTvfqTXhP1HspSD lZg4Qli1nmNJMGttqW7H091K+PDmKV4lEk58RG4TcdMMMwmiCS8FhDh4BgvZM5bOCL1W fs1TlxNz/Wvu5Q4Br8j/++ox16f+IlvsEDW+AgE1c65IEnuV8H5EgMeYbm6JfyhldUBT zWRQ== X-Gm-Message-State: ALoCoQn3lottDpbXSRF/ybhmKX7hpugAjqMDVzTEaUH3qiojssKVU6ve33GpV93jVN9TtYF/0a0y X-Received: by 10.152.3.195 with SMTP id e3mr47529350lae.8.1421888804255; Wed, 21 Jan 2015 17:06:44 -0800 (PST) MIME-Version: 1.0 Received: by 10.112.201.226 with HTTP; Wed, 21 Jan 2015 17:06:22 -0800 (PST) X-Originating-IP: [67.198.113.68] In-Reply-To: <20150121211500.GA32478@server.rulingia.com> References: <20150121211500.GA32478@server.rulingia.com> From: Bryan Venteicher Date: Wed, 21 Jan 2015 19:06:22 -0600 Message-ID: Subject: Re: [CFT] Paravirtualized KVM clock To: Peter Jeremy Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: FreeBSD-current , "freebsd-arch@freebsd.org" X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 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: Thu, 22 Jan 2015 01:06:47 -0000 On Wed, Jan 21, 2015 at 3:15 PM, Peter Jeremy wrote: > On 2015-Jan-04 11:56:14 -0600, Bryan Venteicher < > bryanv@daemoninthecloset.org> wrote: > >For the last few weeks, I've been working on adding support for KVM clock > >in the projects/paravirt branch. Currently, a KVM VM guest will end up > >selecting either the HPET or ACPI as the timecounter source. > Unfortunately, > >this is very costly since every timecounter fetch causes a VM exit. KVM > >clock allows the guest to use the TSC instead; it is very similar to the > >existing Xen timer. > > A somewhat late response but have you looked at > > https://github.com/blitz/freebsd/commit/cdc5f872b3e48cc0dda031fc7d6bdedc65c3148f > I've been running this[*] on a Google Compute Engine instance for about 6 > months without problems. > > A goal of my work was to put a bit of infrastructure in place so FreeBSD can support pvops across a variety of hypervisors. KVMCLOCK happens to be about the easiest to implement, and has a decent performance win for many situations. I think that commit is broken on SMP guests: CPU_FOREACH() does not switch the current CPU, so it just keeps writing to the MSR on the BSP. [*] I had to patch out the test for KVM_FEATURE_CLOCKSOURCE_STABLE_BIT but > I think that's a GCE issue. > > -- > Peter Jeremy >