Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1037717AbdDUKG5 (ORCPT ); Fri, 21 Apr 2017 06:06:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50388 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1037614AbdDUKGz (ORCPT ); Fri, 21 Apr 2017 06:06:55 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 70BAA98C26 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=pbonzini@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 70BAA98C26 Subject: Re: [PATCH v6] kvm: better MWAIT emulation for guests To: Alexander Graf , "Michael S. Tsirkin" References: <1491911135-216950-1-git-send-email-agraf@suse.de> <4622E361-52AB-40F2-9915-45C48F0DBCD2@suse.de> <204f274d-697d-f9c6-8719-9bf91105f8b9@suse.de> <20170412185249-mutt-send-email-mst@kernel.org> <03f26e4b-6355-602a-f817-2c1ab38de199@suse.de> Cc: Jim Mattson , kvm list , =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= , LKML , "Gabriel L. Somlo" , Jonathan Corbet , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , the arch/x86 maintainers , Joerg Roedel , linux-doc@vger.kernel.org, qemu-devel@nongnu.org From: Paolo Bonzini Message-ID: <78ccf88c-9316-d922-8d8d-99442e6ce618@redhat.com> Date: Fri, 21 Apr 2017 12:06:49 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <03f26e4b-6355-602a-f817-2c1ab38de199@suse.de> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 21 Apr 2017 10:06:54 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1285 Lines: 37 On 21/04/2017 12:05, Alexander Graf wrote: > > > On 21.04.17 12:02, Paolo Bonzini wrote: >> >> >> On 12/04/2017 18:29, Michael S. Tsirkin wrote: >>> I don't really agree we do not need the PV flag. mwait on kvm is >>> different from mwait on bare metal in that you are heavily penalized by >>> scheduler for polling unless you configure the host just so. >>> HLT lets you give up the host CPU if you know you won't need >>> it for a long time. >>> >>> So while many people can get by with monitor cpuid (those that isolate >>> host CPUs) and it's a valuable option to have, I think a PV flag is also >>> a valuable option and can be set for more configurations. >>> >>> Guest has an idle driver calling mwait on short waits and halt on longer >>> ones. I'm in fact testing an idle driver using such a PV flag and will >>> post when ready (after vacation ~3 weeks from now probably). >> >> For now I think I'm removing the PV flag, making this just an >> optimization of commit 87c00572ba05aa8c ("kvm: x86: emulate >> monitor and mwait instructions as nop"). >> >> We can add it for 4.13 together with the idle driver. > > I think that's a perfectly reasonable approach, yes. We can always add > the PV flag with the driver. > > Thanks a lot! Queuing the patch for 4.12. Paolo