From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751388AbdBXQ7x (ORCPT ); Fri, 24 Feb 2017 11:59:53 -0500 Received: from cloudserver094114.home.net.pl ([79.96.170.134]:64286 "EHLO cloudserver094114.home.net.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751219AbdBXQ7q (ORCPT ); Fri, 24 Feb 2017 11:59:46 -0500 From: "Rafael J. Wysocki" To: Paolo Bonzini Cc: Marcelo Tosatti , Radim Krcmar , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Viresh Kumar Subject: Re: [patch 0/3] KVM CPU frequency change hypercalls Date: Fri, 24 Feb 2017 17:54:39 +0100 Message-ID: <2057385.e9NFKoehOA@aspire.rjw.lan> User-Agent: KMail/4.14.10 (Linux/4.10.0+; KDE/4.14.9; x86_64; ; ) In-Reply-To: <2c739f77-22c6-c14c-c279-f2dd2445b2df@redhat.com> References: <20170202174755.946578704@redhat.com> <20170224130458.GA31610@amt.cnet> <2c739f77-22c6-c14c-c279-f2dd2445b2df@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Friday, February 24, 2017 04:34:52 PM Paolo Bonzini wrote: > > On 24/02/2017 14:04, Marcelo Tosatti wrote: > >>>>> Whats the current usecase, or forseeable future usecase, for save/restore > >>>>> across preemption again? (which would validate the broken by design > >>>>> claim). > >>>> Stop a guest that is using cpufreq, start a guest that is not using it. > >>>> The second guest's performance now depends on the state that the first > >>>> guest left in cpufreq. > >>> Nothing forbids the host to implement switching with the > >>> current hypercall interface: all you need is a scheduler > >>> hook. > >> Can it be done in vcpu_load/vcpu_put? But you still would have two > >> components (KVM and sysfs) potentially fighting over the frequency, and > >> that's still a bit ugly. > > > > Change the frequency at vcpu_load/vcpu_put? Yes: call into > > cpufreq-userspace. But there is no notion of "per-task frequency" on the > > Linux kernel (which was the starting point of this subthread). > > There isn't, but this patchset is providing a direct path from a task to > cpufreq-userspace. This is as close as you can get to a per-task frequency. > > > But if you configure all CPUs in the system as cpufreq-userspace, > > then some other (userspace program) has to decide the frequency > > for the other CPUs. > > > > Which agent would do that and why? Thats why i initially said "whats the > > usecase". > > You could just pin them at the highest non-TurboBoost frequency until a > guest runs. That's assuming that they are idle and, because of > isol_cpus/nohz_full, they would be almost always in deep C state anyway. Good discussion so far, but it should be happening on the linux-pm list. Would it be possible to repost the patches with a CC to linux-pm? Thanks, Rafael