Received: by 10.223.164.202 with SMTP id h10csp1169645wrb; Thu, 9 Nov 2017 23:06:07 -0800 (PST) X-Google-Smtp-Source: ABhQp+RxmOWVs+WgkQXdiUtJmG6R9mHYgcyB+6rRdNFHvFLc2tU8MtOAhBNHFMwF1CeJtFzj9F1O X-Received: by 10.101.90.133 with SMTP id c5mr3106405pgt.441.1510297567620; Thu, 09 Nov 2017 23:06:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510297567; cv=none; d=google.com; s=arc-20160816; b=W+beCMMWRYOJ+AyR9DjpahxPGV+FIpbfxQ4DCTX4GlQSsD8rgjQDY6s/3WJby0NYyA BuWd5Uiwb34tdgkrAaAkDszKEYEEeGJDsGzpI6VC0yoYQPeiPh4M7oUYWzxY0HUB6Y1O UE43NkJwj7JtR+M5+Akh6GmCjD725z2y+TMyav//WDeOa2STUQ9Zh3LvHGbCoQUVjoSW nT4WA2PW4c/VhnkpobQZNWK0aBDEF1QYWCib1L38fH+FEYu7JuVLK1K1vF5PJ9Zwl1sc zXIYvjPos5ayPFrXNHAltblVfnR/OjvcnX8nYOSYRcdYzaR4nI1Yy3GzivBkqio0puQD 7Deg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=3UN7PWoTYpF2vP9aQom9L0Q3QkSG7XE+X5yhaUPBQzw=; b=snhJIallUECYinBCeRWYBHp0bgBqJmYAXw0V/9j6PYzjWM6GjFYgX5FJ6F+8I3yhne O42KGHlzfKShkjdL1s+Oxk8hWb3NMGDDNVPHo3gUN97pnPX2GKzqJQHYPCgoDo4PWz4a 9WCO+T8t1cCEA9AKNBKo5C5L3GqONTO/sn8YVK+zj3kFyMjtte/LjY5bX26KGG61gzO6 I29x1KKQpyqPyApMI6eFhCOcct9M3UCkIiCOey0/eQxW9nhW5kNXUGgnuO/KGph0P6xL 5z89jrFWtWL4VzeRyqbYgL6WiSgRiFsonVGS+UKxf2YVYZaCgH+/nBl5S7Ljt5K1rWd4 Y7VA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PMOSjCL6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g7si8484964pln.421.2017.11.09.23.05.56; Thu, 09 Nov 2017 23:06:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PMOSjCL6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755367AbdKJHFF (ORCPT + 83 others); Fri, 10 Nov 2017 02:05:05 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:50752 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751424AbdKJHFD (ORCPT ); Fri, 10 Nov 2017 02:05:03 -0500 Received: by mail-pf0-f196.google.com with SMTP id u70so1319408pfa.7; Thu, 09 Nov 2017 23:05:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=3UN7PWoTYpF2vP9aQom9L0Q3QkSG7XE+X5yhaUPBQzw=; b=PMOSjCL6JBOeUONY1ZuuHjhl1LYBDcNHI9HrEaEULN2RpIs8BC0Dj7PuPGY7RuS72h AwiMKRejGFQW9sI4Q7iWe3zr8BwtKfr/AgSwTWDpTapD+Bj/vj7lcFHbAiIeosvstQHq 4ykz8qZcqY40J36XV4ZID7PYwCM7dtiLR5vceKj3wL56aqgDULre0k6A4hfhEbxVnP9l GGj1LWfsC0zi0wo9N07fLQMLguTnNmJ55boTFC93zwPUYEC0V0XTBQkaYpDKPzsNDnQI Uf/AAHnFG/UVE3RAxYePKdPdIbsu14Nh/Wq4zQEsgXKmyt4xZWxWuxpm0jGPdzgQo2WB fVpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=3UN7PWoTYpF2vP9aQom9L0Q3QkSG7XE+X5yhaUPBQzw=; b=IyPtS+m+hwC4wCsaU+2t27lrO/89iCKwkjap3RP6I2erzKicbxcK7b3QGYAggtITlv fs/LsVN15QYWq7mVvTmU97pBA5xRV8MY1Z1UrcbWQR4HsvbTTlr908ULnPwF/0XjH2AK sTi9Hh8oGI7w2YvUK7RJ5PsaW1zNv1nPGVJA7zEu/0hyVzxvhZB7+MxrunR6puOsPfX0 T0N/TCVNS/l0wFP6afvIWkkQsJ1+gh7PyUN982PXgyCc7FNVQie8CX6OmmMgyY4mp+cI yZhDhD7kynzCOLZzDu3hU7LySsHNitAyTHBgh0ceNSgIdwGbO3f1Hd+QCm2phgPdU5DF /yTw== X-Gm-Message-State: AJaThX7rXFHWSGxIwLHtiDRN6uhKtqeK4RJ/AT0LyDsOWyJ6nI4kfyif 1vcfHkgKNEVk3asFNyeUHlaVPg== X-Received: by 10.99.113.72 with SMTP id b8mr2860238pgn.42.1510297502694; Thu, 09 Nov 2017 23:05:02 -0800 (PST) Received: from localhost ([203.205.141.123]) by smtp.gmail.com with ESMTPSA id q73sm18765888pfl.146.2017.11.09.23.05.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Nov 2017 23:05:02 -0800 (PST) From: Wanpeng Li X-Google-Original-From: Wanpeng Li To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Wanpeng Li Subject: [PATCH v2 0/4] KVM: Paravirt remote TLB flush Date: Thu, 9 Nov 2017 23:04:53 -0800 Message-Id: <1510297497-10063-1-git-send-email-wanpeng.li@hotmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remote flushing api's does a busy wait which is fine in bare-metal scenario. But with-in the guest, the vcpus might have been pre-empted or blocked. In this scenario, the initator vcpu would end up busy-waiting for a long amount of time. This patch set implements para-virt flush tlbs making sure that it does not wait for vcpus that are sleeping. And all the sleeping vcpus flush the tlb on guest enter. Idea was discussed here: https://lkml.org/lkml/2012/2/20/157 The best result is achieved when we're overcommiting the host by running multiple vCPUs on each pCPU. In this case PV tlb flush avoids touching vCPUs which are not scheduled and avoid the wait on the main CPU. In addition, thanks for commit 9e52fc2b50d ("x86/mm: Enable RCU based page table freeing (CONFIG_HAVE_RCU_TABLE_FREE=y)") Test on a Haswell i7 desktop 4 cores (2HT), so 8 pCPUs, running ebizzy in one linux guest. ebizzy -M vanilla optimized boost 8 vCPUs 10152 10083 -0.68% 16 vCPUs 1224 4866 297.5% 24 vCPUs 1109 3871 249% 32 vCPUs 1025 3375 229.3% Wanpeng Li (4): KVM: Add vCPU running/preempted state KVM: Add paravirt remote TLB flush KVM: X86: introduce invalidate_gpa argument to tlb flush KVM: Add flush_on_enter before guest enter Documentation/virtual/kvm/cpuid.txt | 10 ++++++++++ arch/x86/include/asm/kvm_host.h | 2 +- arch/x86/include/uapi/asm/kvm_para.h | 6 ++++++ arch/x86/kernel/kvm.c | 35 ++++++++++++++++++++++++++++++++++- arch/x86/kvm/cpuid.c | 3 ++- arch/x86/kvm/svm.c | 14 +++++++------- arch/x86/kvm/vmx.c | 21 +++++++++++---------- arch/x86/kvm/x86.c | 24 +++++++++++++++--------- 8 files changed, 86 insertions(+), 29 deletions(-) -- 2.7.4 From 1583471115333792996@xxx Wed Nov 08 04:35:33 +0000 2017 X-GM-THRID: 1583471115333792996 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread