From owner-freebsd-virtualization@freebsd.org Thu Jun 8 12:35:27 2017 Return-Path: Delivered-To: freebsd-virtualization@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C397BBFE2CF for ; Thu, 8 Jun 2017 12:35:27 +0000 (UTC) (envelope-from akgupt3@gmail.com) Received: from mail-qt0-x231.google.com (mail-qt0-x231.google.com [IPv6:2607:f8b0:400d:c0d::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 765EC80362 for ; Thu, 8 Jun 2017 12:35:27 +0000 (UTC) (envelope-from akgupt3@gmail.com) Received: by mail-qt0-x231.google.com with SMTP id u19so39205558qta.3 for ; Thu, 08 Jun 2017 05:35:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=w5LapTuiPdJsdohz7hSh3eLyU6aSrKB+X8y8Vu0cqvQ=; b=k4e1W3tJ4Zg1vYjLVRX0nVo35A4Je9zC+DWip62vp4vtSaVVtkG6Mpbr18uEMtsbxI nQrzmag5TH+Jd79pWW8V1fCiM/67EuMuHh8PdFh4OWKEKmyPCK6sIT6vNpCpBbFeuOD6 ubbw30P0voyaBnqazI7u1lTYmJmNXIqqFgCpEvVlegQ1TSsvLlzr6JHqUe3IJodX0Dvc GPwQmF+cnl8uYyg93xGVUndvhdl9DoO5h6Y7sfU0aNxVqPE4pPiFwmwu9WOZeG8QIBJu TvPW8wjsq7hBrEyjOl4+JfCHSwA9UoQCNWsNuPw1gQ+C0m8vvIil+BP5qkjOmlqinoeU NNmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=w5LapTuiPdJsdohz7hSh3eLyU6aSrKB+X8y8Vu0cqvQ=; b=bfAUN7A+f4NG7fOLAI+evLVkZwdWBJcnnUfPVOWuRJyGxgayUBT5mMvlAe3dsHc+80 YWq81ckiDqTwkreaZxxyXO+1gSlEn1oDEH83aYFMWz+lfP96u+gHhfvorU3b4Qh22L3A 5yMoF0GdNrJkg7vTozGhcWhSBAtRb2cvzZcT6bNnxOUpjO3QKomn4JtMR7Nq2/bc7ybv E2nONtxlSYZR8IUVIytelI3wt8K08sj030/adC8kwJcTaaw4nVpqJbBdDSjkgvaz4TqO 9oRggkJ1paJYcchBDJaNbGPTrQiS1uJ+wF5jiT+NPvV/BUcJu9ZpwMrfMP7iDreJhsab DmYA== X-Gm-Message-State: AODbwcCIrT4hsr7BC0ynTal6u38bpda8hIqfoG2A+BVTzVSdVyXa8zh+ JWgBd6Z2Ge4yJmzcB78+Ew4MjdNaIOcR X-Received: by 10.200.35.28 with SMTP id a28mr45972288qta.169.1496925326601; Thu, 08 Jun 2017 05:35:26 -0700 (PDT) MIME-Version: 1.0 Received: by 10.12.156.75 with HTTP; Thu, 8 Jun 2017 05:35:26 -0700 (PDT) In-Reply-To: <59383F5C.8020801@omnilan.de> References: <59383F5C.8020801@omnilan.de> From: Anish Date: Thu, 8 Jun 2017 05:35:26 -0700 Message-ID: Subject: Re: PCIe passthrough really that expensive? To: Harry Schmalzbauer Cc: "freebsd-virtualization@freebsd.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Jun 2017 12:35:27 -0000 Hi Harry, >I thought I'd save these expensive VM_Exits by using the passthru path. Completely wrong, is it? It depends on which processor you are using. For example APICv was introduced in IvyBridge which enabled h/w assisted localAPIC rather than using s/w emulated, bhyve supports it on Intel processors. Intel Broadwell introduced PostedInterrupt which enabled interrupt to delivered to guest directly, bypassing hypervisor[2] for passthrough devices. Emulated devices interrupt will still go through hypervisor. You can verify capability using sysctl hw.vmm.vmx. What processor you are using for these performance benchmarking? Can you run a simple experiment, assign pptdev interrupts to core that's not running guest/vcpu? This will reduce #VMEXIT on vcpu which we know is expensive. Regards, Anish On Wed, Jun 7, 2017 at 11:01 AM, Harry Schmalzbauer wrote: > Hello, > > some might have noticed my numerous posts recently, mainly in > freebsd-net@, but all around the same story =E2=80=93 replacing ESXi. So = I hope > nobody minds if I ask for help again to alleviate some of my knowledge > deficiencies about PCIePassThrough. > As last resort for special VMs, I always used to have dedicated NICs via > PCIePassThrough. > But with bhyve (besides other undiscovered strange side effects) I don't > understand the results utilizing bhyve-passthru. > > Simple test: Copy iso image from NFSv4 mount via 1GbE (to null). > > Host, using if_em (hartwell): 4-8kirqs/s (8 @mtu 1500), system idle > ~99-100% > Passing this same hartwell devcie to the guest, running the identical > FreeBSD version like the host, I see 2x8kirqs/s, MTU independent, and > only 80%idle, while almost all cycles are spent in Sys (vmm). > Running the same guest in if_bridge(4)-vtnet(4) or vale(4)-vtnet(4) > deliver identical results: About 80% attainable throughput, only 80% > idle cycles. > > So interrupts triggerd by PCI devices, which are controlled via > bhyve-passthru, are as expensive as interrupts triggered by emulated > devices? > I thought I'd save these expensive VM_Exits by using the passthru path. > Completely wrong, is it? > > I haven't ever done authoritative ESXi measures, but I remember that > there was a significant saving using VMDirectPath. Big enough that I > never felt the need for measuring. Is there any implementation > difference? Some kind of intermediate interrupt moderation maybe? > > Thanks for any hints/links, > > -harry > _______________________________________________ > freebsd-virtualization@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization > To unsubscribe, send any mail to "freebsd-virtualization- > unsubscribe@freebsd.org"