Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp304081rdb; Mon, 18 Sep 2023 16:06:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGp8p8yLSDsPVdYQdcsX3PMSnQ+iozzcBdYd1/d6bSPiHP5gB/jJnkp/98EWB/oX9po9F9c X-Received: by 2002:a05:6a00:1ac6:b0:68b:4e07:133f with SMTP id f6-20020a056a001ac600b0068b4e07133fmr11261642pfv.7.1695078409804; Mon, 18 Sep 2023 16:06:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695078409; cv=none; d=google.com; s=arc-20160816; b=Ye81Qw2WfcULa32CFg5lyNwqPt8m+s95wuaj6ceirpjFRIw74ZpjgYw4pUmOsiGuou rnKF54jGNP9iyEC/8p7wV8DleDVrkWvHANMDoibPtXJHD7D+GR4eQTbIfovsrnGn34b7 a3ZMc6VR8Pk0/BWg/kEgo3/xkoG9micIVPupmql3b3sXtY0ajFQAggdOG0i3gRf/CT6c Rxif43LJl07UgFb9rciZnoz3mXGt++9Tl6GKlVv7iT7FSDDZnCNWIFsCZHm9pKCMufti HK0erMK68DlpmTHvCDFavvWl80/YqJsswloq2D9qPAPxAOv/g3Gap3JizX2DiNZT2M9Q lqaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=1hlKNnFoMVXO91HCTsOChuIiy9MQ2Z8kf6aYAI8BEus=; fh=hf8SBMf4pzKA3Bxl3Fa7rEMeHnT0XjuCF5Sftt7PdSs=; b=vI01rCMSjJcC4R07MsvBOBLE+iQ7NcaXgmmVEN2DB4e7PVfOZaW7KvDITQPYsIxiIa XnijHA1mV7pyhQoit5gGlTTbEl83ntL1p4OdIS8QoIqoayyPcHqpui8+iL9VqVpAHAwg O8VfLbk/6vSG/7g4ThQZ5Jj+uIhr/E7xT/cavR/7C4/5MAefvQmw+/GUFBFzT0t++pU2 Jew8QfDpiQhfpuXB5trAo/aPYmQbw2c/WOunIyxx3zOsHS6kBJuKJGoQCyZErjqarLsn EtA+BCj4W/9qNidWCF0eFWDFst/uwRyiarmWh+/W+0zOOkWf+jKmq0bH5DyxSNGejoQc 7kTg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id ct8-20020a056a000f8800b0068a54522bb0si8640300pfb.144.2023.09.18.16.06.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 16:06:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 915498348DA2; Mon, 18 Sep 2023 16:04:46 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230158AbjIRXEt (ORCPT + 99 others); Mon, 18 Sep 2023 19:04:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229680AbjIRXEs (ORCPT ); Mon, 18 Sep 2023 19:04:48 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DC38DB0; Mon, 18 Sep 2023 16:04:09 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 922DA1FB; Mon, 18 Sep 2023 16:04:46 -0700 (PDT) Received: from [192.168.178.6] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2FEAC3F5A1; Mon, 18 Sep 2023 16:04:08 -0700 (PDT) Message-ID: Date: Tue, 19 Sep 2023 01:03:52 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH] cpufreq: Rebuild sched-domains when removing cpufreq driver Content-Language: en-US To: Pierre Gondois , linux-kernel@vger.kernel.org Cc: Shrikanth Hegde , vschneid@redhat.com, "Rafael J. Wysocki" , Viresh Kumar , linux-pm@vger.kernel.org References: <20230918112937.493352-1-pierre.gondois@arm.com> From: Dietmar Eggemann In-Reply-To: <20230918112937.493352-1-pierre.gondois@arm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 18 Sep 2023 16:04:46 -0700 (PDT) On 18/09/2023 13:29, Pierre Gondois wrote: > The Energy Aware Scheduler (EAS) relies on the schedutil governor. > When moving to/from the schedutil governor, sched domains must be > rebuilt to allow re-evaluating the enablement conditions of EAS. > This is done through sched_cpufreq_governor_change(). > > Having a cpufreq governor assumes having a cpufreq driver running. > Inserting/removing a cpufreq driver should trigger a re-evaluation > of EAS enablement conditions, avoiding to see EAS enabled when > removing a running cpufreq driver. > > Add a sched_cpufreq_governor_change() call in cpufreq driver removal > path. Rebuilding SDs when inserting the driver is already covered by cpufreq_online() cpufreq_set_policy() sched_cpufreq_governor_change() if (old or new gov eq. schedutil) schedule_work(&rebuild_sd_work) So what's missing is only a sched_cpufreq_governor_change() call when removing the driver, right? > > Signed-off-by: Pierre Gondois > --- > drivers/cpufreq/cpufreq.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c > index 60ed89000e82..0a4979c34fd1 100644 > --- a/drivers/cpufreq/cpufreq.c > +++ b/drivers/cpufreq/cpufreq.c > @@ -1673,6 +1673,8 @@ static void __cpufreq_offline(unsigned int cpu, struct cpufreq_policy *policy) > cpufreq_driver->exit(policy); > policy->freq_table = NULL; > } > + > + sched_cpufreq_governor_change(policy, policy->governor); > } > > static int cpufreq_offline(unsigned int cpu)