From patchwork Mon Jul 23 21:16:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Isaku Yamahata X-Patchwork-Id: 10541035 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2D996112E for ; Mon, 23 Jul 2018 21:17:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1E0B7284E9 for ; Mon, 23 Jul 2018 21:17:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1230828501; Mon, 23 Jul 2018 21:17:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BEB65284E9 for ; Mon, 23 Jul 2018 21:17:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388142AbeGWWUZ (ORCPT ); Mon, 23 Jul 2018 18:20:25 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:44057 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388105AbeGWWUZ (ORCPT ); Mon, 23 Jul 2018 18:20:25 -0400 Received: by mail-pg1-f194.google.com with SMTP id r1-v6so1244681pgp.11 for ; Mon, 23 Jul 2018 14:17:22 -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=uQUYOfA9xmC1ngzxvi/kN00VT/4wlwtUPL9aiMbfI2k=; b=q9L6/XK6EwrgfCsOmsPj+svFhh6uPhPa9LTXyal/wYn6UJJmJK6WSlwGHIT/ys6sP6 7x+cqsCmmnZ+X4+K4GplbYmZua0pJjrdmd78j8Jywz/NwpG5yxruNRFRgtHuujU3pwKD xpXqD7eA1wK7VcGfaiGATBmssdkhcbnvZvngcZ/m0KmYfnM4n/8GavqqutB7Um7sgHfC kZ5jTGumKrZj+nBk3H0FxpO2c0JVn20t13QjfWbhPDffYKvKsRp0XETe3YNnoZeUA6js y8M8ztPA/Y6yXN/jtqrkfMNruRt04baZbJm16GVSaj6DSh3STyR0jSmp79IpbKxTu74n DnsQ== 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=uQUYOfA9xmC1ngzxvi/kN00VT/4wlwtUPL9aiMbfI2k=; b=jztwTt/dGgr0IQDsRy/r5POVceCYQ6bggGlg7rt0glI3mzJm6DdaUS1+vcdnA6fPip nvztvSjopjedsuCSZ9gxatt0dP7+wvzri1LIKjgb7BsqlthhGnbNLi7MCJp1Xh5JUE9H 014/GGR5m+UMkp5U8aWI3DFFOi9eL2bgRQnE9hxJkB+226mF7LS9hUWPmmU+gvuMmAfd 0Y0sQkV/EwhfPDVvIZX/D3OJWx7v1KVfu64DrmLQgOEJwlLh81D/LpNMGj6a7qLkgbyc 9aU/CVOkWHbbd5hLbgZGyFADh9iUEPlqUZbfXdJ9H6cN462mv+8QrpNyTTI3z3lmvsf1 4bqQ== X-Gm-Message-State: AOUpUlFlbOP7c3h+mCjmfNuCuUL0j2PZfT1tKU+9v8xSf76Ts5u8h2zU 89bwIWkrFnL5PYSpF49OgQrmRLHX X-Google-Smtp-Source: AAOMgpfnb93/fQ0RJ1cqitJxVXL4ltftWhXKEfNfDdajWXB6bakchcCqXLZvy1PMHvZsXbvUqjIAeQ== X-Received: by 2002:a63:8648:: with SMTP id x69-v6mr13702126pgd.172.1532380641465; Mon, 23 Jul 2018 14:17:21 -0700 (PDT) Received: from localhost ([192.55.54.58]) by smtp.gmail.com with ESMTPSA id d132-v6sm24564592pgc.93.2018.07.23.14.17.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 23 Jul 2018 14:17:20 -0700 (PDT) From: Isaku Yamahata To: kvm@vger.kernel.org Cc: pbonzini@redhat.com, rkrcmar@redhat.com, isaku.yamahata@gmail.com Subject: [RFC PATCH 0/3] kvm/x86/vmx optimize tsc deadline emulation latency Date: Mon, 23 Jul 2018 14:16:59 -0700 Message-Id: X-Mailer: git-send-email 2.14.1 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Optimize latency of TSC deadline emulation by skipping various KVM related checks when opssible. i.e. On VMExit for tsc deadline timer emulation, handle it and VMEnter immidiately without checking various kvm stuff when possible. The result can be measured by cyclic test in guest and ftracing local timer interrupt entry(irq_vectors:local_timer_exit). On local machine, average latency can be reduced by tens of microseconds. Isaku Yamahata (3): kvm/x86: remove KVM_REQ_PENDING_TIMER x86/kvm/vmx: opitmize tsc dealine timer emulation x86/kvm/vmx: module parameter to enable/disable fast exit handler arch/x86/kvm/lapic.c | 18 +---- arch/x86/kvm/lapic.h | 16 ++++ arch/x86/kvm/vmx.c | 157 +++++++++++++++++++++++++++++++++++++++ arch/x86/kvm/x86.c | 21 ++---- include/linux/kvm_host.h | 2 +- 5 files changed, 181 insertions(+), 33 deletions(-)