Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp129541ybi; Wed, 29 May 2019 18:07:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqxkuAAOOyRv1XmgKGJ1mXSpZ4LeDcHbYW7T8PhHQRrye1VJTzaCCKy0tGKcxZ0lflxx9NYn X-Received: by 2002:a17:902:e83:: with SMTP id 3mr928196plx.120.1559178468458; Wed, 29 May 2019 18:07:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559178468; cv=none; d=google.com; s=arc-20160816; b=uNMDiOtaRPPAxfrdmUzHuQuGEInovbZxlT1+CEulVJmwuC+ol4J6NtHRPjOqB/eKsj a/1R06Ty7UUmxJCwZZCLGZYyJ9We6vAEK4JHNTy6aZLWlpZxlx4LTT9WmDmCDFmK7zYO RqcYG6q93qAxAFhVYjwy8vZClIWkBnU7G3180V6UgusEdRgqjkpSVB5Fe5G3Cq5CCxom MYN1k/E8HL4/lAEl+Lt/VmK9Spe2JNoHjLWAIpwiPtMS7j5kuVtb7ARkjvasPFZ+sUo6 Uu3x2msXEAzEd7SprEbv1yiz7xasf1wZzPNRBD1CtVL4VVs/BPDRhFI/FuRUoOtJDzHL xABQ== 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; bh=pyl/L4lftqre86x4sDXFC//cXdVYSHdszkBDIq0F9kA=; b=vJ9mXMxkS0lol18hwN0nZHlygSQKb/XPRn3EHS0aX3J+kvZVbreeO7cvQQ+cMT7ja6 vjeWbh2mcJCrXz/bOFuYcMwSsci0VPpCFt/0AIDU5KwUK5Ho5rF7DDFe+iSvXfOeMiKD /9sW9GNmpbN/7hdopWU0yz+7uFdhU+e+SdDPz6OphxyFrGWQMypVedNvwAnVDzU6vV32 a1J+M/1ZTLXTFoNWChaqGsBrfx2OPzcwD37oA540ra1GHSTwe/keS8dkN1zKPdtaW+Id 0zNBXuWla3zUtmDlB4Pe7nLzHvJu6n+sqoS6m6eynL2iZcb+Q7NpFBxWt4ZxfjCfr9Uj ejuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GTCRRX0F; 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=QUARANTINE 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 h5si1430854plt.232.2019.05.29.18.07.32; Wed, 29 May 2019 18:07:48 -0700 (PDT) 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=GTCRRX0F; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727378AbfE3BFT (ORCPT + 99 others); Wed, 29 May 2019 21:05:19 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:45335 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726718AbfE3BFT (ORCPT ); Wed, 29 May 2019 21:05:19 -0400 Received: by mail-pl1-f196.google.com with SMTP id x7so819483plr.12; Wed, 29 May 2019 18:05:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=pyl/L4lftqre86x4sDXFC//cXdVYSHdszkBDIq0F9kA=; b=GTCRRX0FPev8NT+YGJsHGcCdJCxG92nkcB8v64iqMk23Rjub8TZ98noOEp9km4gkGo uuf3oW7XL5QFgCpU531dAHkFlDOhFqNf6uyTY/wFPbLVyX+BoNZV98xnQ3oARRBdLgxO DrneOgK9Ld1Nsvma+2iTIDqo8cn7onzbJUYHy9XbL/6mN9u0z4n069XW/NMqp+rLNwr2 b21QtQPGxN9KswIMpKnidvm+Itg2ATLUeteHrgu3NVqJhDyS6CKD31kfzXbmf4oj6Sf+ QHaTnU5LaVEZhqIjQEnr9vHQGdvbGYIPrcSf0SEPqv/L6fR26G/wCgzXp7TS3HxkfTVG mA+A== 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=pyl/L4lftqre86x4sDXFC//cXdVYSHdszkBDIq0F9kA=; b=GSBZY5KMm4AHbkM2s/xFmD2KfgIUq+weIabNafW26CnfCPFAZ7rAlsPZI9mS/Hkcha npj0QpH5MhAwGcg1ch9Yjz/bGKo0kJAYpj68bzvMlchGEQK5ssYWrlylqLuJ4TCF+Tx1 kZFosP1AXyaqoFZNtSEdSxMy40Yd5Le6EEWK35mpFe5uwsLUQlvVHV7pHpJL8h7EgoI3 I1DwPN7w0kwTdtxWWQVEDC9l6LjLcnU8Su0ZKjB7cUs3oPfddp0hjmSy5zrQGQ5TkMdS uWNZ1IB9kqYNNT5BxZHHZL4mUyV4HWEWbCdPVevnd0yI7c6pCu8UW2lnsXcUknpery6I NNoQ== X-Gm-Message-State: APjAAAXyKQsmFmhHUnKnz7MDE1U10dBk4qO6XXRV4gOQWKGEphj0Rz2g OJvgezFXFYaoQaKj5Yy16b/BG3ZR X-Received: by 2002:a17:902:15c5:: with SMTP id a5mr974456plh.39.1559178318967; Wed, 29 May 2019 18:05:18 -0700 (PDT) Received: from localhost.localdomain ([203.205.141.123]) by smtp.googlemail.com with ESMTPSA id c76sm861965pfc.43.2019.05.29.18.05.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 May 2019 18:05:18 -0700 (PDT) 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?= Subject: [PATCH v3 0/3] KVM: Yield to IPI target if necessary Date: Thu, 30 May 2019 09:05:04 +0800 Message-Id: <1559178307-6835-1-git-send-email-wanpengli@tencent.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 The idea is from Xen, when sending a call-function IPI-many to vCPUs, yield if any of the IPI target vCPUs was preempted. 17% performance increasement of ebizzy benchmark can be observed in an over-subscribe environment. (w/ kvm-pv-tlb disabled, testing TLB flush call-function IPI-many since call-function is not easy to be trigged by userspace workload). v2 -> v3: * add bounds-check on dest_id v1 -> v2: * check map is not NULL * check map->phys_map[dest_id] is not NULL * make kvm_sched_yield static * change dest_id to unsinged long Wanpeng Li (3): KVM: X86: Yield to IPI target if necessary KVM: X86: Implement PV sched yield hypercall KVM: X86: Expose PV_SCHED_YIELD CPUID feature bit to guest Documentation/virtual/kvm/cpuid.txt | 4 ++++ Documentation/virtual/kvm/hypercalls.txt | 11 +++++++++++ arch/x86/include/uapi/asm/kvm_para.h | 1 + arch/x86/kernel/kvm.c | 21 +++++++++++++++++++++ arch/x86/kvm/cpuid.c | 3 ++- arch/x86/kvm/x86.c | 26 ++++++++++++++++++++++++++ include/uapi/linux/kvm_para.h | 1 + 7 files changed, 66 insertions(+), 1 deletion(-) -- 2.7.4