From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9B99AC3A59F for ; Thu, 29 Aug 2019 14:39:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7751F233FF for ; Thu, 29 Aug 2019 14:39:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728249AbfH2Ojl (ORCPT ); Thu, 29 Aug 2019 10:39:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52689 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727899AbfH2Ojl (ORCPT ); Thu, 29 Aug 2019 10:39:41 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B31A820ABB; Thu, 29 Aug 2019 14:39:40 +0000 (UTC) Received: from amt.cnet (ovpn-112-4.gru2.redhat.com [10.97.112.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 724BB196B2; Thu, 29 Aug 2019 14:39:38 +0000 (UTC) Received: from amt.cnet (localhost [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id 6614A105140; Thu, 29 Aug 2019 11:39:11 -0300 (BRT) Received: (from marcelo@localhost) by amt.cnet (8.14.7/8.14.7/Submit) id x7TEd7P8014097; Thu, 29 Aug 2019 11:39:07 -0300 Date: Thu, 29 Aug 2019 11:39:06 -0300 From: Marcelo Tosatti To: Wanpeng Li Cc: "Rafael J. Wysocki" , Paolo Bonzini , "Rafael J. Wysocki" , LKML , kvm , Radim =?utf-8?B?S3LEjW3DocWZ?= , Linux PM , "Michael S. Tsirkin" Subject: Re: [PATCH] cpuidle-haltpoll: Enable kvm guest polling when dedicated physical CPUs are available Message-ID: <20190829143904.GA13983@amt.cnet> References: <20190826204045.GA24697@amt.cnet> <20190828143916.GA13725@amt.cnet> <20190829120422.GC4949@amt.cnet> <20190829125304.GA12214@amt.cnet> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190829125304.GA12214@amt.cnet> User-Agent: Mutt/1.5.21 (2010-09-15) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Thu, 29 Aug 2019 14:39:40 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 29, 2019 at 09:53:04AM -0300, Marcelo Tosatti wrote: > On Thu, Aug 29, 2019 at 08:16:41PM +0800, Wanpeng Li wrote: > > > Current situation regarding haltpoll driver is: > > > > > > overcommit group: haltpoll driver is not loaded by default, they are > > > happy. > > > > > > non overcommit group: boots without "realtime hints" flag, loads haltpoll driver, > > > happy. > > > > > > Situation with patch above: > > > > > > overcommit group: haltpoll driver is not loaded by default, they are > > > happy. > > > > > > non overcommit group: boots without "realtime hints" flag, haltpoll driver > > > cannot be loaded. > > > > non overcommit group, if they don't care latency/performance, they > > don't need to enable haltpoll, "realtime hints" etc. Otherwise, they > > should better tune. > > As mentioned before, "being overcommitted" is a property which is transitional. > > A static true/false scheme reflects this poorly. > > Therefore the OS should detect it and act accordingly. Hi Wanpeng Li, One suggestion for a dynamic "is overcommited" scheme: If the amount of stolen time, in the past record_steal_time window, is more than 20% of the time in that window, then mark system as overcommitted. Otherwise, clear it. Make that 20% configurable by as kvm module parameter. Use that info to enable/disable overcommit features. That should work, right?