From owner-soc-status@FreeBSD.ORG Sun Jun 1 19:55:50 2014 Return-Path: Delivered-To: soc-status@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C3DE83D4 for ; Sun, 1 Jun 2014 19:55:50 +0000 (UTC) Received: from mail-qg0-x22c.google.com (mail-qg0-x22c.google.com [IPv6:2607:f8b0:400d:c04::22c]) (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 880402B5B for ; Sun, 1 Jun 2014 19:55:50 +0000 (UTC) Received: by mail-qg0-f44.google.com with SMTP id i50so9537741qgf.31 for ; Sun, 01 Jun 2014 12:55:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=9pdCdko4BZ5Hq1MrvOBi3veZz7INQMuGnPxN8KKpPq0=; b=nukOHKsyymmxoD7UNyqiyjabVx7sV+B5SgzlAIdb4vs7VYn6/f8QljuF0hL5hadtj4 p7BHGQKQuMtzanPQBULVf4iVqdlKr+9OlUSISSMGzIKUxPdt6Hu1Qc6qWZbT9sPo6ku7 8ZeS2JQEXmlbOT1GuKsLr+Q3SkTpwd/N3vD9PArcrvWPQqL3dRT4aCWAKs/CVBTiF+Qz s2AqW50cl1pw4rWoctk1u5ZvMnnxYZMyahH81tjyM+XhduF8DuC/CrvT6QMyOykN2/WC AQ0Uuqhh2O4FiclKd/345Qkc4SLVXQR+nNBwtFXphm1kOBeXsUXpiZgtK7W7AlnwRezP T1rg== MIME-Version: 1.0 X-Received: by 10.140.102.161 with SMTP id w30mr40730802qge.108.1401652549733; Sun, 01 Jun 2014 12:55:49 -0700 (PDT) Received: by 10.140.47.68 with HTTP; Sun, 1 Jun 2014 12:55:49 -0700 (PDT) In-Reply-To: References: Date: Sun, 1 Jun 2014 22:55:49 +0300 Message-ID: Subject: Re: [GSOC] bhyve instruction caching From: Mihai Carabas To: soc-status@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: soc-status@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Summer of Code Status Reports and Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jun 2014 19:55:50 -0000 Hi, I will continue my status report inline. > > I will come next week with some feedback on some strategies for > caching efficiently the instructions and probably some implementation > details. The cached instruction is identified by the "struct vm*" (basically is the virtual machine ID), the CR3 value (address of the pagetable) and the IP (instruction pointer) of the instruction. All these are inserted in a new structure named "struct vie_cached". After a discussion with Neel I've decided to create a hashtable which will only use the "struct vm*" as a key. The reason is simple: if one virtual machine is trashing the instruction cache we don't want this to affect/slow down other virtual machines (one hashtable entry is guarded by a rmlock to guarantee exclusive access). A hashtable entry will point to a list of "struct vie_cached*" entries. To calculate the key of the hashtable based on the "struct vm" pointer I've used the jenkins hash [1] These days I've started a discussion with Neel about some microbenchmarking mechanisms. I will come with some more details next week. Thanks, Mihai [1] /usr/src/sys/libkern/jenkins_hash.c