Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753166AbdDKSXX convert rfc822-to-8bit (ORCPT ); Tue, 11 Apr 2017 14:23:23 -0400 Received: from mx2.suse.de ([195.135.220.15]:44092 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752984AbdDKSXW (ORCPT ); Tue, 11 Apr 2017 14:23:22 -0400 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: [PATCH v6] kvm: better MWAIT emulation for guests From: Alexander Graf X-Mailer: iPhone Mail (14E304) In-Reply-To: Date: Tue, 11 Apr 2017 20:23:18 +0200 Cc: kvm list , =?utf-8?Q?Radim_Kr=C4=8Dm=C3=A1=C5=99?= , "Michael S. Tsirkin" , LKML , "Gabriel L. Somlo" , Paolo Bonzini , Jonathan Corbet , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , the arch/x86 maintainers , Joerg Roedel , linux-doc@vger.kernel.org, qemu-devel@nongnu.org Content-Transfer-Encoding: 8BIT Message-Id: <4622E361-52AB-40F2-9915-45C48F0DBCD2@suse.de> References: <1491911135-216950-1-git-send-email-agraf@suse.de> To: Jim Mattson Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 752 Lines: 18 > Am 11.04.2017 um 19:10 schrieb Jim Mattson : > > This might be more useful if it could be dynamically toggled on and > off, depending on system load. What would trapping mwait (currently) buy you? As it stands today, before this patch, mwait is simply implemented as a nop, so enabling the trap just means you're wasting as much cpu time, but never send the pCPU idle. With this patch, the CPU at least has the chance to go idle. Keep in mind that this patch does *not* advertise the mwait cpuid feature bit to the guest. What you're referring to I guess is actual mwait emulation. That is indeed more useful, but a bigger patch than this and needs some more thought on how to properly cache the monitor'ed pages. Alex