Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp2954435pxb; Sun, 8 Nov 2020 20:43:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJz9ECsPWA0sn66yeR/WGDXJsKMJSNwE8tKPRwDL0nSV4pgAc+oW9FfthpaqjPw1rMlVbDpV X-Received: by 2002:a17:906:814:: with SMTP id e20mr12997220ejd.514.1604896984079; Sun, 08 Nov 2020 20:43:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604896984; cv=none; d=google.com; s=arc-20160816; b=rnJK8AJghNfPQ0n2QRmxKV+GABkkX81wcrYKipazKbe4qUmT82lurliXrI2l4qTYo2 4wQ1GiRf6jho2YeRzF5bTqSVdaeAZM0eXXQOy7rXB+JB1bbBGvQ4GTFPC5GmIjFEjj2A jWXx0/Kw3IzWEugo8i2Rbaz9XLnwjY9SxzfH+twpOoawvS/bYomG5gHL0hmKfi/RT+uQ eEJPSIg07Q0MZF4PAjpno19N9qdifrd4z2HfDrZyPBBexDw6w3WYoTjxGgRslCibcnGN OW8M1SQclz7ewd49Tr0331SKdMwLzBSJ0aDM45p8PLQ4DSEAe6M9URFjq08rdNfdAvZP U/aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=jcFk/6OejFKlL0VZatZUqxcmH+heZ7DzTu7vp8WJaEQ=; b=MJ2eDIIxXkknYh1qQmFkGVi8CTnN/iLYtxx9BNE8U0ykRMR88/kMUq3Xg8ZJvjvI8Y IDd85mxqZP5cENkbub8z4j3rw4JKVOXlFBI+bAz3u4a3GRpBjgWgznbuMZZ8Gb0ZNF2T cqYSjau0PLZ4Lc+MVUcdcnM+E1Qd0Bhql4aw5C+MNWpub05hzYJNXiYYipld6hEexycF awWpZKz6+ZIJj7sMWw3/TaOdLo0+H2gB7zFfCJumgUQ3plRLit1tVN1cDrbk3rrRABP8 yfsS2FQWtMz5JNYiq4ED4NU90k0T+XoxsMg3WexRmyKHJKgwC8VSN3IPaWkPYeMPoHTJ +bTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xJ3qNvvX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p5si6329075ejf.528.2020.11.08.20.42.39; Sun, 08 Nov 2020 20:43:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xJ3qNvvX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729262AbgKIEjQ (ORCPT + 99 others); Sun, 8 Nov 2020 23:39:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728802AbgKIEjP (ORCPT ); Sun, 8 Nov 2020 23:39:15 -0500 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6B7BC0613D3 for ; Sun, 8 Nov 2020 20:39:15 -0800 (PST) Received: by mail-pf1-x441.google.com with SMTP id v12so6901799pfm.13 for ; Sun, 08 Nov 2020 20:39:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=jcFk/6OejFKlL0VZatZUqxcmH+heZ7DzTu7vp8WJaEQ=; b=xJ3qNvvXSqqSYWHG9AjgIondMGPCb0Zf/U44Hbf6JroDbgs97cWX9z6R3WRt2+rBSy f32WYgvCQ7MFheSVFJfp08+rXUROc+pekj3nPPPB1sLj0KCqb8K79VbhqSwjLCY1jEc1 vb+P5xB0fqZD/I+/ogNq7JQDgrGWSvTnoI2Ayn13GJ5yFB5hKuGTDT7cPYET/aflYrVg Qww5Q28HNa3EsP4CV/QP77cxQbGMdDKQKo6OfhFwLsrNJXOndSDma5vPxhZaXzoQq/Pg lJbztwS8r9I+5e52b/NJAODM1p3z2B3wUsYnTaHkdfEjCiIy+xphisAUPTmCw9vrstaY PIfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=jcFk/6OejFKlL0VZatZUqxcmH+heZ7DzTu7vp8WJaEQ=; b=OELrjZR/YyGWmCByU4DseCmg/UzW3Mt6XxZcizYhvdBkpQo9BFcuyCJQbi6TjC7NJ4 JPDLfltlCqOlp6x5F1x2vvDFLUakjph7XO2eahSVhPYRMWa4jdSAYlTCiG3ZiIXrm9em f8c5whXFj2SwaB7+lurZYkj/9rP+sIFVVeje/fbD23K19OUsYDy7cWeojkKH0vIVNfZu rv5Duass12o8L2Qgv3JhFcy6zp6BpLWJbf2fKUbvDEjXd6A+KYtIqtLrOIwEMKoKUBKE maNRgn/IxIHVhUD6iStjkbWiHmgXcazBz6NHvPHtajjupuiTEL3fjAcPoiBpVLIPD3GR mp+g== X-Gm-Message-State: AOAM530oOI5HKN5XuVZ2+w+jtkpKEk1VETpWdeg9J+d4LpVAQfF5eA9g k96Cgl4ywacvih3zRZRF092lWw== X-Received: by 2002:a63:381:: with SMTP id 123mr11974313pgd.112.1604896755123; Sun, 08 Nov 2020 20:39:15 -0800 (PST) Received: from localhost ([122.172.12.172]) by smtp.gmail.com with ESMTPSA id h3sm9452763pfo.170.2020.11.08.20.39.13 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 Nov 2020 20:39:14 -0800 (PST) Date: Mon, 9 Nov 2020 10:09:12 +0530 From: Viresh Kumar To: "Rafael J. Wysocki" Cc: "Rafael J. Wysocki" , Linux PM , Srinivas Pandruvada , Zhang Rui , LKML Subject: Re: [PATCH 1/2] cpufreq: Introduce target min and max frequency hints Message-ID: <20201109043912.7zvfhi42yhr7goy4@vireshk-i7> References: <7417968.Ghue05m4RV@kreacher> <2233690.N3OVLkotou@kreacher> <20201106100712.u336gbtblaxr2cit@vireshk-i7> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716-391-311a52 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06-11-20, 18:02, Rafael J. Wysocki wrote: > On Fri, Nov 6, 2020 at 11:07 AM Viresh Kumar wrote: > > > > On 05-11-20, 19:23, Rafael J. Wysocki wrote: > > > Index: linux-pm/include/linux/cpufreq.h > > > =================================================================== > > > --- linux-pm.orig/include/linux/cpufreq.h > > > +++ linux-pm/include/linux/cpufreq.h > > > @@ -63,6 +63,8 @@ struct cpufreq_policy { > > > > > > unsigned int min; /* in kHz */ > > > unsigned int max; /* in kHz */ > > > + unsigned int target_min; /* in kHz */ > > > + unsigned int target_max; /* in kHz */ > > > unsigned int cur; /* in kHz, only needed if cpufreq > > > * governors are used */ > > > unsigned int suspend_freq; /* freq to set during suspend */ > > > > Rafael, honestly speaking I didn't like this patch very much. > > So what's the concern, specifically? > > > We need to fix a very specific problem with the intel-pstate driver when it is > > used with powersave/performance governor to make sure the hard limits > > are enforced. And this is something which no one else may face as > > well. > > Well, I predict that the CPPC driver will face this problem too at one point. > > As well as any other driver which doesn't select OPPs directly for > that matter, at least to some extent (note that intel_pstate in the > "passive" mode without HWP has it too, but since there is no way to > enforce the target max in that case, it is not relevant). > > > What about doing something like this instead in the intel_pstate > > driver only to get this fixed ? > > > > if (!strcmp(policy->governor->name, "powersave") || > > !strcmp(policy->governor->name, "performance")) > > hard-limit-to-be-enforced; > > > > This would be a much simpler and contained approach IMHO. > > I obviously prefer to do it the way I did in this series, because it > is more general and it is based on the governor telling the driver > what is needed instead of the driver trying to figure out what the > governor is and guessing what may be needed because of that. > > But if you have a very specific technical concern regarding my > approach, I can do it the other way too. I was concerned about adding those fields in the policy structure, but I get that you want to do it in a more generic way. What about adding a field name "fixed" (or something else) in the governor's structure which tells us that the frequency is fixed and must be honored by the driver. -- viresh