Received: by 10.192.165.148 with SMTP id m20csp4134668imm; Tue, 8 May 2018 03:37:27 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoy3vGcwGi4DYUA1q2pSbzR1fJQfRLHqVVy0YIigDjup4SGpcux06V7oYscBXhNLp1gLxP4 X-Received: by 2002:a63:705d:: with SMTP id a29-v6mr32624042pgn.202.1525775847247; Tue, 08 May 2018 03:37:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525775847; cv=none; d=google.com; s=arc-20160816; b=Oh0ffgop1IdrghKX6n/CKmo+dVQjGw/0TjmieQLt24at7s6WE98SyG8YWjXSIVNIP1 WvaAwuReAJ+q1W3IggciVTMi1uIzPfDmo6txD/v9DIKXMsuUoLMs8wofSkNq7e206qgp /z0PveW7eGwQZdgFmApWoUN8Im2r7wg9q43kF4X1ALqToPNxBbaESrc6kTp1kTN9cZ4o hfz2/9WOQOMi0Jv4zfGCfaDmEND0BP2Ssppgo7w+CZf+QIIGQ1fOmVWMNM96giVmy0Gq etGiBJxQhXk/ccucIJvXTG107t364RtYH8XOdFmpcUPwpHnM8USbHzWtk3I9Gh6nfHbW lZXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=Q0EZLa/9QdtjrgMeXt7MuCsII+I72yQPE/AcGaOvRRQ=; b=PiZusl1F55+Mgd3L/9cGSBvqZOdCbfDLUCkMQb+O30DbSSFG/fdcpBKuy1YuZ/ET3N Wpuc0rLIvC9xXjo+fm1uqXV2Y5BMNK1du5uFY4KDFIeeZb77TnwLOKgw1WdYSugDJYbp DGtqyYHo+8sVm5smOwGvaYODIHfLSKLLOt0H4jhDfdz9Nu7LqoLdITHkW/322mAkrWZn JWeCqIz97yCwzhIf+2yikoj4GhGgLAS9mA1js2o00r8PIgo1KKxXSEj63imPmAXpRXvF gCCtPzxrvEChJtqCovXY08LY71Wjls++qdGSsMHf3eua/aZf/lBHCEQtPdzW7fxrJIs2 Fj7w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y67-v6si19161553pgb.35.2018.05.08.03.37.12; Tue, 08 May 2018 03:37:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754778AbeEHKhE (ORCPT + 99 others); Tue, 8 May 2018 06:37:04 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:55804 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754476AbeEHKhD (ORCPT ); Tue, 8 May 2018 06:37:03 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A5A631529; Tue, 8 May 2018 03:37:02 -0700 (PDT) Received: from [0.0.0.0] (e107985-lin.cambridge.arm.com [10.1.210.41]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2C1C83F592; Tue, 8 May 2018 03:36:59 -0700 (PDT) Subject: Re: [PATCH] Revert "cpufreq: schedutil: Don't restrict kthread to related_cpus unnecessarily" To: Viresh Kumar Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , Ingo Molnar , linux-pm@vger.kernel.org, Pavan Kondeti , "Rafael J . Wysocki" , Juri Lelli , Joel Fernandes , Patrick Bellasi , Quentin Perret References: <20180508073340.13114-1-dietmar.eggemann@arm.com> <20180508082242.bre6sjfvefhz6xc3@vireshk-i7> <8cf21b1a-ca6e-fed7-43c5-94c66ff5986b@arm.com> <20180508094526.ajyjrwytguhv4xpe@vireshk-i7> From: Dietmar Eggemann Message-ID: <7922d081-0bfb-0e55-7caf-ec9fb5d7bab0@arm.com> Date: Tue, 8 May 2018 12:36:58 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180508094526.ajyjrwytguhv4xpe@vireshk-i7> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/08/2018 11:45 AM, Viresh Kumar wrote: > On 08-05-18, 11:09, Dietmar Eggemann wrote: >> This would make sure that the kthreads are bound to the correct set of cpus >> for platforms with those cpufreq drivers (cpufreq-dt (h960), scmi-cpufreq, >> scpi-cpufreq) but it will also change the logic (e.g. >> sugov_should_update_freq() -> cpufreq_can_do_remote_dvfs()). > > Yeah, I misunderstood your patch a bit. So you are not disabling > remote updates but only limiting the CPUs where the kthread runs. Yes, remote updates are possible even if the sugov kthread is bound to the cpus of the policy. cross policy (cluster) remote callback example: ... migration/1-14 [001] enqueue_task_fair: this_cpu=1 cpu_of(rq)=7 migration/1-14 [001] sugov_update_shared: this_cpu=1 sg_cpu->cpu=7 sg_cpu->sg_policy->policy->related_cpus=4-7 sugov:4-1492 [004] sugov_work: this_cpu=4 sg_cpu->sg_policy->policy->related_cpus=4-7 ... cpu=1 updates cpu=7 remotely. This is independent from where the actual sugov kthread is running. > That still looks to be a big little specific problem to me right now > and I am not sure why should we specially handle these kthreads ? > Isn't the same true for any other threads/tasks in the kernel which > may end up running on big CPUs ? And this problem still occurs with > the EAS patches applied ? As I thought we may end up keeping such > small tasks on little cores then. Binding it to the cpus of the policy makes sense since if the OPP should be changed for these cpus it should be done on one of these cpus, making sure we don't disturb the others. EAS and big.LITTLE will profit from this, but potentially every system with multiple frequency domains. Binding them on to little cpus is an overhead to me which will gain us very little. Keeping the sugov threads to the cpus of the policy doesn't cost much and helps a lot. >> I'm still struggling to understand when a driver/platform should set >> dvfs_possible_from_any_cpu to true and what the actual benefit would be. > > Ideally it should be set by default for all ARM platforms at least > which have more than one cpufreq policy, as there is no hardware > limitation for changing frequency from other CPUs. If you look at the > commit logs of patches which added remote updates, you will see > interesting cases where this can be very useful. That's true but where is the benefit by doing so? (Multiple) per-cluster or per-cpu frequency domains, why should the sugov kthread run on a foreign cpu? > commit 674e75411fc2 ("sched: cpufreq: Allow remote cpufreq callbacks") IMHO, this describes the remote cpufreq callback functionality itself which works perfectly fine even if we leave the sugov ktrhead bound to the cpus of the policy.