From: Alexander Graf Subject: Re: [PATCH v6] kvm: better MWAIT emulation for guests Date: Tue, 11 Apr 2017 20:23:18 +0200 Message-ID: <4622E361-52AB-40F2-9915-45C48F0DBCD2@suse.de> References: <1491911135-216950-1-git-send-email-agraf@suse.de> Mime-Version: 1.0 (1.0) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8BIT 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 To: Jim Mattson Return-path: In-Reply-To: Sender: linux-doc-owner@vger.kernel.org List-Id: kvm.vger.kernel.org > 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