Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp445678ybk; Wed, 20 May 2020 03:45:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxBXtCERHDOUIjRmql8xKVhBhwqdB7WlFjxS7RhZAI72H6y5c8JtO2QlDADCpfViMXKHJQf X-Received: by 2002:a17:907:6f7:: with SMTP id yh23mr3030230ejb.517.1589971510197; Wed, 20 May 2020 03:45:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589971510; cv=none; d=google.com; s=arc-20160816; b=1ADWdirQqvtDkpfWZxJvnCHS8nZqnnl3CIkU+w6dQVBSqyPXF4x6IB/5vp99AXbsPr qMNPGUlkgeuHz/MhW9iHU1vsnuMrVkAR/VNH5N5tFW/0HzQC2lRmSsRxrdgkgVCFNUiG MF/3GKnGIr5MpPQLYQXZANLObYbVWIkLAyDvW6ROpWNZdLMCdsZtWTWwRsYyoPVl0X8q RdDaVwQQYFyw3Ae84UJat+oR+Ax9YdNaTruahmS8ZrQRlV0p4mwfgaTq3MUhkRT9CJB8 XvyGIRhuwcvImTQr7iCYatEfy4IB8SqeQoWw8hTiqpauPtjJxniVZEIRj2/9iUJ5whHG hcgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Vu4oMQkSuoGOXfFHpOqFu4wgCH5lCjTUemxJNi8wieQ=; b=puKCMxVkpeclw67otpbjaO961wa6MixSiv5WmpLh05D4HHVIAiZ7ChcctfbH7jqpjw DqGNj1sY8y7PZ3F86oVHABQ0fC8b59/23VnE2w0q5j5l5yHcxhOvxgzsqIkpaVco8t1S j4XT29gGD4pUY83xbHO33VxbYbIpIXTu8BwTDhC/Oj9B5DGT0mSJX0F8G1pUzVwOB9t0 GDNoGFMe/3H9B7gMtF5bDmootwxBRsOkuK1W0JdHu/L87xzeg5ACf7QBHZOtLN9vaD2C y0ySMHDlXdIQ2vtpz37u0b+eMjxGtounlLJiYYM6ODzruBnf0eLbKUIHi7TTbGkJcRJC bDmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UhlRLXYY; 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 t2si1511154ejx.348.2020.05.20.03.44.46; Wed, 20 May 2020 03:45:10 -0700 (PDT) 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=UhlRLXYY; 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 S1726566AbgETKlR (ORCPT + 99 others); Wed, 20 May 2020 06:41:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726403AbgETKlR (ORCPT ); Wed, 20 May 2020 06:41:17 -0400 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FE97C061A0E for ; Wed, 20 May 2020 03:41:12 -0700 (PDT) Received: by mail-pg1-x542.google.com with SMTP id u35so1237672pgk.6 for ; Wed, 20 May 2020 03:41:12 -0700 (PDT) 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=Vu4oMQkSuoGOXfFHpOqFu4wgCH5lCjTUemxJNi8wieQ=; b=UhlRLXYYEATpth6j1TeIipbgC/1L2D7NAaUOXXURlOHPJLah1s/8sUAoOVUDVuS01c A3qQfCauN38n/MizGoFoUKQ8dcXZLgyGaJJS0iSq4GnK9Ppx9ZqHnvcmoypUiw6WJ+KP syH9nZTcYVzfQJb9CNNxUcsuelHIm6RyxF78uPDIdTjwEVGUPOdqdoWpwCKe6peFWs7z ANAcLGlyaQhg1Jy/Nbbq12ZAFILiKn8/1g1gDk0vmmoZhbVZqLyd9iGsUY1DidR3lwci 19Dwm7b+ku5B+5xT6WRw+LKqfaXJAH9W7EQuWKFEtCNXewO9mX+0TOkZqaOqbc59iYtB Rw/Q== 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=Vu4oMQkSuoGOXfFHpOqFu4wgCH5lCjTUemxJNi8wieQ=; b=d9Z26TF6uYr2HQ+rWc79sRLqboKSRLYDJ/+so09VHbc1iIWn+f8qaCeIRK/fTkdY6q kAnIcZPijrEm8ELIifyCpdlyoS13t25VQF8sJF1Ax01jX3CyYm7uQJiMqCDe5tUSjzYX 7U6DIMVxA9Fxy0T1pFmBtjrGtzYGaucxX3wJ4pfNFj7LEcwPDECvkT0m4knnt1qCLPur q/LlTRFek2tLOeY/APg5fBa0R5PHgcYxWEWLBjgxm3JeDNqBrwyAtkNzQe+MTj4tCK+S QgYnID3I1Rcmg1oRP5OOHbkzN2TcdTGo7nEzuZHsIqkwEnYjfxb8Hf3JO1fC/1Fpxblm PYqg== X-Gm-Message-State: AOAM530pEtxOd4EZ9bApbSLZiZfb5ZlnLaH/VnAzuxFI0UowjJywdxWa xnLEWJZEWtvTuzeMLf6NXaMkog== X-Received: by 2002:a63:5864:: with SMTP id i36mr3454636pgm.231.1589971271703; Wed, 20 May 2020 03:41:11 -0700 (PDT) Received: from localhost ([122.167.130.103]) by smtp.gmail.com with ESMTPSA id d20sm1710031pgl.72.2020.05.20.03.41.10 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 May 2020 03:41:10 -0700 (PDT) Date: Wed, 20 May 2020 16:11:09 +0530 From: Viresh Kumar To: "Rafael J. Wysocki" Cc: Xiongfeng Wang , "Rafael J. Wysocki" , Souvik Chakravarty , Thanu.Rangarajan@arm.com, Sudeep Holla , Hanjun Guo , John Garry , Jonathan Cameron , Linux PM , Linux Kernel Mailing List Subject: Re: [RFC PATCH v3 1/2] cpufreq: change '.set_boost' to act on only one policy Message-ID: <20200520104109.b7vrp7stnyopmwr6@vireshk-i7> References: <1589888489-13828-1-git-send-email-wangxiongfeng2@huawei.com> <1589888489-13828-2-git-send-email-wangxiongfeng2@huawei.com> <20200520045911.amww3nm3e7cezcbf@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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 20-05-20, 12:36, Rafael J. Wysocki wrote: > On Wed, May 20, 2020 at 6:59 AM Viresh Kumar wrote: > > > > On 19-05-20, 19:41, Xiongfeng Wang wrote: > > > Macro 'for_each_active_policy()' is defined internally. To avoid some > > > cpufreq driver needing this macro to iterate over all the policies in > > > '.set_boost' callback, we redefine '.set_boost' to act on only one > > > policy and pass the policy as an argument. > > > 'cpufreq_boost_trigger_state()' iterate over all the policies to set > > > boost for the system. This is preparation for adding SW BOOST support > > > for CPPC. > > > > > > Signed-off-by: Xiongfeng Wang > > > --- > > > drivers/cpufreq/acpi-cpufreq.c | 4 ++-- > > > drivers/cpufreq/cpufreq.c | 53 +++++++++++++++++++++--------------------- > > > include/linux/cpufreq.h | 2 +- > > > 3 files changed, 30 insertions(+), 29 deletions(-) > > > > > > diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c > > > index 289e8ce..b0a9eb5 100644 > > > --- a/drivers/cpufreq/acpi-cpufreq.c > > > +++ b/drivers/cpufreq/acpi-cpufreq.c > > > @@ -126,7 +126,7 @@ static void boost_set_msr_each(void *p_en) > > > boost_set_msr(enable); > > > } > > > > > > -static int set_boost(int val) > > > +static int set_boost(struct cpufreq_policy *policy, int val) > > > { > > > get_online_cpus(); > > > on_each_cpu(boost_set_msr_each, (void *)(long)val, 1); > > > > I think (Rafael can confirm), that you need to update this as well. You don't > > need to run for each cpu now, but for each CPU in the policy. > > Right, the caller will iterate over policies. > > Accordingly, the CPU hotplug locking needs to go to the caller too. Hmm, why is that required ? Can't we call boost_set_msr_each() for all CPUs of a policy under the locks ? And then let the next call take the lock again ? I thought we don't want a CPU to disappear while we are trying to run boost_set_msr_each() for it (or miss one that just got added) and that should work with the locks being there in this routine. -- viresh