Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp481975rdb; Tue, 19 Sep 2023 00:53:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGuVM19kfUYd28o+zSW3aPSwO5jfmjB1t+Bs51eLLeMcf+u5C+OkTLrPBjFLs1cRDK2pe77 X-Received: by 2002:a05:6a20:4410:b0:132:79da:385a with SMTP id ce16-20020a056a20441000b0013279da385amr11835832pzb.23.1695110016255; Tue, 19 Sep 2023 00:53:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695110016; cv=none; d=google.com; s=arc-20160816; b=LemNyyBoljCu1DfHprJcuBIx9jswf/5gqN5iGCGB8KYsXtlnPvN402IiKeceLn/9sY 90o3qZtcYsqrprC/QTLih+4cpjf85uCrbwOcxkxxlDy2Ip7APlVLE5wi3Sl1TXhFN12i o2wRZYZ7sdisfxuyTTxf5eAayT8jSqSSe1jLIuyxbW0XP4AuY48GAJPHhPox3J0w37LF VRSMibEZBbjdtYWEqf4JwlbAmusqRnBjowN3B6G0rTv5QBRPhI4qHgnXmkwne16COmhT w8Ernbz9CYdAVYv3OJy9aGqHOvyvhmENvzf7hyMFdR/W26eu5ufS5i+aXe+CYNHG8U1+ iMEg== 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=mShkljOiKl2+VWxBuT+qnGubS3dek/PQzUR9+sTlNyk=; fh=FMQdFiwypfWqC0rbFGdWOs4sw/Y69mZ7Ik0MApBphGY=; b=o6E7TIH0jeMnew4Yg9OKC50+jcElVZdaWQdTQVUgBL+vhcQR4nUohHSFHdMJPoijuF qafYD77a9M1ZjHF1DgKLIamabOoH3ntz5OkQfV/3vYFF+cJmHNXEwCU3gtY0VBbwMwFy i3NYJ7hUiiqD5o4aPMTGM7Kj962yPpFZvRboN+xD+SidWp6iLHDEENSANf/njO/BvIkU 8UrbYEq9J297OoatKsdxx9pmZANC6+Abeoceig7K+9paRBMydyJL1BStZ+Q9RV3DOTF2 oduKhcrrHJV2Ml4m3slS5YG2bOailKlo/wM40KtyTg+TcKAWCozYGt1nHb/5BHSgiXVd T/rw== 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:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id pi10-20020a17090b1e4a00b002632a1243dbsi11942193pjb.104.2023.09.19.00.53.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 00:53:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id A808681A5ACB; Tue, 19 Sep 2023 00:50:06 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230387AbjISHuE (ORCPT + 99 others); Tue, 19 Sep 2023 03:50:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229699AbjISHuD (ORCPT ); Tue, 19 Sep 2023 03:50:03 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 66921FC; Tue, 19 Sep 2023 00:49:57 -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 448081FB; Tue, 19 Sep 2023 00:50:34 -0700 (PDT) Received: from [10.57.92.124] (unknown [10.57.92.124]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 47D083F59C; Tue, 19 Sep 2023 00:49:55 -0700 (PDT) Message-ID: Date: Tue, 19 Sep 2023 09:49:45 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.0 Subject: Re: [PATCH] cpufreq: Rebuild sched-domains when removing cpufreq driver Content-Language: en-US To: Dietmar Eggemann , 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: Pierre Gondois In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.2 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email 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 (lipwig.vger.email [0.0.0.0]); Tue, 19 Sep 2023 00:50:06 -0700 (PDT) On 9/19/23 01:03, Dietmar Eggemann wrote: > 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? Yes exact, removing a cpufreq driver (e.g. `rmmod cppc_cpufreq.ko`) goes through: cpufreq_remove_dev() \-__cpufreq_offline() so the path you mentioned is not used in this case. Regards, Pierre