From owner-freebsd-arch@FreeBSD.ORG Thu Jan 22 01:06:47 2015 Return-Path: Delivered-To: freebsd-arch@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 409D9636 for ; Thu, 22 Jan 2015 01:06:47 +0000 (UTC) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com [209.85.217.176]) (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 DBCC6B8F for ; Thu, 22 Jan 2015 01:06:46 +0000 (UTC) Received: by mail-lb0-f176.google.com with SMTP id z12so21654891lbi.7 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=ezBwVGCAYGS/D8s1lSMnF4Ifv3E9E49D3bc+xGIp8tEV9V9ejvoR5VcKU4ghvo41pE jDGa+NcOwsZFVXh5DdXgoi1UWFsPpTtSDx1AVeqIAaOjMGdPXxQVhVp3juOZ7JS99bLv DI8Cc1RT1eMQMZ8RlJAgRs0ZcZEbP1GBHJ78c5nmw7O4vNRGo4YKvSxE8Ch1D/xww1F2 n64VdXStENeniVAA/mmm1srNZK7Mh+2tLVy9wLs+9NmNcPr8CkvwBDPVkjLR5amain7S m/XhS/Eq7zmceUrBixm2kjplT/MnA48om0p7Z3SVRzqlrp9N/IUJlS8dD1lctxqi3R85 WUsg== X-Gm-Message-State: ALoCoQkxAeLToFxFw9q6FVsfghFTFu1vt1B2fQB1GBCvPqjGLKpP539auEuCqVw6RaH+68hVhUG9 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-arch@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion related to FreeBSD architecture 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 >