From patchwork Thu May 7 18:10:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Perret X-Patchwork-Id: 212100 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6095CC38A2A for ; Thu, 7 May 2020 18:10:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3A9982145D for ; Thu, 7 May 2020 18:10:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="ZhFfVBNH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728003AbgEGSKV (ORCPT ); Thu, 7 May 2020 14:10:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726864AbgEGSKU (ORCPT ); Thu, 7 May 2020 14:10:20 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5312AC05BD0A for ; Thu, 7 May 2020 11:10:20 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id z1so4234848ybm.5 for ; Thu, 07 May 2020 11:10:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=509wYnGQ2ll8bD7lPJSFtG4McPi0txJLxy0qvSv45Lo=; b=ZhFfVBNHUmUmHvR6RS1KKWKRBbqh0HTuUO7pHTeDUaozng1hAAZP9tIZ+8LZTZaau7 Z9IyHFYhb7tm2qWuEnfRILjVtXmrBUI68g930iuEC9carHiDuqJM0Q8hbwRfrYJOnMHr Mgiip6Sbjhz8csT4cQrv1o7W+McWrcFK2dCkrjLjttEyhQx5tBY2nv25d94p8HinQY69 bAq4kIJxs93uzLLprZ68fwclQpsOnpw9wzY5nEva6p8IaoAzV2FXlO1YO17homT1jj9v rUVm+1XOYjBQxScTdPenOUF48W1umyG+mIMEcfc8/IR/gUNAJXBdT9qI0TFZ+veEPlea yjwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=509wYnGQ2ll8bD7lPJSFtG4McPi0txJLxy0qvSv45Lo=; b=NGQrvWw4Pu+CZawj+GfRsRKRdB1a0IRXKaGZitbE8wtobWCeF4AEsb7Xh/E7GNOfPl hFkRd9Qkqte+wiuBHH/RNyBjy6gBSSd1cx4zF+/QyPLKUTUeWMHlSP4nqhzdh4xhjxxh 7MUXoVfCjCbP24nwsHpnAFprpUqeSb1lHQZolys4SxzObpEtSWQ5B/FrI2y5pLscD9zq 1Rz6fMHTDThcOq49+tZ1BHU/WWF935nGCNe3svCd06ZBne+l43HP8FXZ2rebH3dZlqwc A4JuQswyUKDJawtWV6v88b8FwX/bgGi1XRzgGZNkDIRWAsJ9IcIPIU2ZBd1rv02NYHzM 9OPg== X-Gm-Message-State: AGi0PuZ1cPKg++RIc9PIvUuz6e8xUUUT7x5Q9sQ2FqNeaNHXa5kw0kO/ /dcmmko3leWpS6sMYnNaKeTHz/BF5U4m X-Google-Smtp-Source: APiQypJlZZ0Nv+hjKxeI5eVTKF6u8iZstKbYl+urYr+Vc4mwMoSpMjoTwgcq1KFh3BK9+P30QwuTBkg0l1kn X-Received: by 2002:a25:bb49:: with SMTP id b9mr26834376ybk.172.1588875019348; Thu, 07 May 2020 11:10:19 -0700 (PDT) Date: Thu, 7 May 2020 19:10:00 +0100 In-Reply-To: <20200507181012.29791-1-qperret@google.com> Message-Id: <20200507181012.29791-3-qperret@google.com> Mime-Version: 1.0 References: <20200507181012.29791-1-qperret@google.com> X-Mailer: git-send-email 2.26.2.526.g744177e7f7-goog Subject: [PATCH 02/14] sched: cpufreq: Use sched_set_deadline() from sugov From: Quentin Perret To: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, sudeep.holla@arm.com, gregkh@linuxfoundation.org, rafael@kernel.org, viresh.kumar@linaro.org, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, mcgrof@kernel.org, keescook@chromium.org, yzaikin@google.com, fweisbec@gmail.com, tkjos@google.com, kernel-team@android.com, qperret@google.com Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org sched_set_deadline() is an exported symbol, use it instead of sched_setattr_nocheck() to elevate the sugov kthreads to DL. Signed-off-by: Quentin Perret --- kernel/sched/cpufreq_schedutil.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c index 7fbaee24c824..ebd5d30f0861 100644 --- a/kernel/sched/cpufreq_schedutil.c +++ b/kernel/sched/cpufreq_schedutil.c @@ -654,20 +654,6 @@ static void sugov_policy_free(struct sugov_policy *sg_policy) static int sugov_kthread_create(struct sugov_policy *sg_policy) { struct task_struct *thread; - struct sched_attr attr = { - .size = sizeof(struct sched_attr), - .sched_policy = SCHED_DEADLINE, - .sched_flags = SCHED_FLAG_SUGOV, - .sched_nice = 0, - .sched_priority = 0, - /* - * Fake (unused) bandwidth; workaround to "fix" - * priority inheritance. - */ - .sched_runtime = 1000000, - .sched_deadline = 10000000, - .sched_period = 10000000, - }; struct cpufreq_policy *policy = sg_policy->policy; int ret; @@ -685,7 +671,9 @@ static int sugov_kthread_create(struct sugov_policy *sg_policy) return PTR_ERR(thread); } - ret = sched_setattr_nocheck(thread, &attr); + /* Fake (unused) bandwidth; workaround to "fix" priority inheritance. */ + ret = sched_set_deadline(thread, 1000000, 10000000, 10000000, + SCHED_FLAG_SUGOV); if (ret) { kthread_stop(thread); pr_warn("%s: failed to set SCHED_DEADLINE\n", __func__); From patchwork Thu May 7 18:10:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Perret X-Patchwork-Id: 212094 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6513C38A24 for ; Thu, 7 May 2020 18:11:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9A63720870 for ; Thu, 7 May 2020 18:11:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="PGi9JzC7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726913AbgEGSKY (ORCPT ); Thu, 7 May 2020 14:10:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728073AbgEGSKX (ORCPT ); Thu, 7 May 2020 14:10:23 -0400 Received: from mail-qt1-x849.google.com (mail-qt1-x849.google.com [IPv6:2607:f8b0:4864:20::849]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8AFA9C05BD09 for ; Thu, 7 May 2020 11:10:22 -0700 (PDT) Received: by mail-qt1-x849.google.com with SMTP id d35so7690953qtc.20 for ; Thu, 07 May 2020 11:10:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=Vd0pNAUBaJ0yRt8OlUay21+ov1Ee3dhw97h0rn0JWzA=; b=PGi9JzC7BfRAuyN68vDloXznBqkKjDAhneADm5FudbrS4uv7r6kbQzRzv/pHSIZoMw NtiDu0RkmlxflfT2SJq0LixZXAcQCJ0qj22zqjD+SQpKVh58JFZ9ZS92Dsck3iDc+Dl7 s3E9uXSeRVa05+lLjb1M8OURbGdLy1lVqSgW0bQx5fm5Flhj7D4Xp8PdU5ruoSl271IE HLJqxU8UxYNeZ6vD+KZFXRx8oG3+OfDFxpzQc2MsMsff3wqOD4nuA4AWC0Y3DpRwKpsZ bJuEpiY+mf33+b06GwFin3o0YSJ9WV7xFkaUIqA1JzXutPno6QGi6l2lYmUIKC/Rr4X7 j/0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=Vd0pNAUBaJ0yRt8OlUay21+ov1Ee3dhw97h0rn0JWzA=; b=BuIP8/KRCYS34F7xfRMZiAT9gasJ9FjEuv5ghY3ww8Z3Ae80f3t3D3n62FzpIx00hR rv5iAwMpCsJkF3O8hCjTVOLpsyN8vkeIWwhAsQjngtreq30J1PO/UWffPbkatfwZs5AB dLfgeKp8tp0rF+Al+bJIyU8rIs5C3op2Olc0293GCBC3FQC4XR7joFoo/bGPvH2/KfAO LmBGlfvw38ThG4EO3XjePbqcptuGQ5cSiX7QbYbMDGl1GV/yy9QDj/pAfD4oxgk2XtXE CkLEfXbx6k8Ra7k4TE1sOScmuBzZPCHiipEx1T+HZl06Z/W8Opa5+8l1JwgglOq3TDku RvEQ== X-Gm-Message-State: AGi0Pua+qTm8sZ/zTKDcPu5AInSBbEuzRDlodGj6YKqRul3+dVbxPjEJ oQ/Q/9m+2zBfThFZ+P4NHchBd+g0ZUT+ X-Google-Smtp-Source: APiQypJ4asbJxd94fD3uQEhG1rWXpEeC3AokhHXEV9JcZ9jvjhTmwjtKJgFl4//ydqHlMQWqlkiT0Sn2NmAE X-Received: by 2002:a05:6214:158b:: with SMTP id m11mr14638091qvw.168.1588875021708; Thu, 07 May 2020 11:10:21 -0700 (PDT) Date: Thu, 7 May 2020 19:10:01 +0100 In-Reply-To: <20200507181012.29791-1-qperret@google.com> Message-Id: <20200507181012.29791-4-qperret@google.com> Mime-Version: 1.0 References: <20200507181012.29791-1-qperret@google.com> X-Mailer: git-send-email 2.26.2.526.g744177e7f7-goog Subject: [PATCH 03/14] sched: cpufreq: Introduce 'want_eas' governor flag From: Quentin Perret To: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, sudeep.holla@arm.com, gregkh@linuxfoundation.org, rafael@kernel.org, viresh.kumar@linaro.org, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, mcgrof@kernel.org, keescook@chromium.org, yzaikin@google.com, fweisbec@gmail.com, tkjos@google.com, kernel-team@android.com, qperret@google.com Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The EAS topology code requires the usage of schedutil on all CPUs of an rd to actually enable EAS balancing. However, the check implementing this references the schedutil_gov struct directly, which makes having schedutil as a module impractical. To prepare the ground for this modularization, introduce a new 'want_eas' flag in the cpufreq_governor struct, set it for schedutil only, and make sure to check it from the EAS topology code. Signed-off-by: Quentin Perret --- include/linux/cpufreq.h | 4 ++++ kernel/sched/cpufreq_schedutil.c | 5 ++++- kernel/sched/topology.c | 12 ++++++------ 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index f7240251a949..267cc3b624da 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -560,6 +560,10 @@ struct cpufreq_governor { bool dynamic_switching; struct list_head governor_list; struct module *owner; + +#ifdef CONFIG_ENERGY_MODEL + bool want_eas; +#endif /* CONFIG_ENERGY_MODEL */ }; /* Pass a target to the cpufreq driver */ diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c index ebd5d30f0861..c5e5045f7c81 100644 --- a/kernel/sched/cpufreq_schedutil.c +++ b/kernel/sched/cpufreq_schedutil.c @@ -888,6 +888,9 @@ struct cpufreq_governor schedutil_gov = { .start = sugov_start, .stop = sugov_stop, .limits = sugov_limits, +#ifdef CONFIG_ENERGY_MODEL + .want_eas = true, +#endif /* CONFIG_ENERGY_MODEL */ }; #ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL @@ -924,7 +927,7 @@ static DECLARE_WORK(rebuild_sd_work, rebuild_sd_workfn); void sched_cpufreq_governor_change(struct cpufreq_policy *policy, struct cpufreq_governor *old_gov) { - if (old_gov == &schedutil_gov || policy->governor == &schedutil_gov) { + if ((old_gov && old_gov->want_eas) || policy->governor->want_eas) { /* * When called from the cpufreq_register_driver() path, the * cpu_hotplug_lock is already held, so use a work item to diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c index 8344757bba6e..b905f2e8d9b2 100644 --- a/kernel/sched/topology.c +++ b/kernel/sched/topology.c @@ -319,7 +319,8 @@ static void sched_energy_set(bool has_eas) * 2. the SD_ASYM_CPUCAPACITY flag is set in the sched_domain hierarchy. * 3. no SMT is detected. * 4. the EM complexity is low enough to keep scheduling overheads low; - * 5. schedutil is driving the frequency of all CPUs of the rd; + * 5. an EAS-compatible CPUfreq governor (schedutil) is driving the frequency + * of all CPUs of the rd; * * The complexity of the Energy Model is defined as: * @@ -339,7 +340,6 @@ static void sched_energy_set(bool has_eas) */ #define EM_MAX_COMPLEXITY 2048 -extern struct cpufreq_governor schedutil_gov; static bool build_perf_domains(const struct cpumask *cpu_map) { int i, nr_pd = 0, nr_cs = 0, nr_cpus = cpumask_weight(cpu_map); @@ -347,7 +347,7 @@ static bool build_perf_domains(const struct cpumask *cpu_map) int cpu = cpumask_first(cpu_map); struct root_domain *rd = cpu_rq(cpu)->rd; struct cpufreq_policy *policy; - struct cpufreq_governor *gov; + bool want_eas; if (!sysctl_sched_energy_aware) goto free; @@ -377,11 +377,11 @@ static bool build_perf_domains(const struct cpumask *cpu_map) policy = cpufreq_cpu_get(i); if (!policy) goto free; - gov = policy->governor; + want_eas = policy->governor && policy->governor->want_eas; cpufreq_cpu_put(policy); - if (gov != &schedutil_gov) { + if (!want_eas) { if (rd->pd) - pr_warn("rd %*pbl: Disabling EAS, schedutil is mandatory\n", + pr_warn("rd %*pbl: Disabling EAS because of incompatible CPUFreq governor\n", cpumask_pr_args(cpu_map)); goto free; } From patchwork Thu May 7 18:10:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Perret X-Patchwork-Id: 212095 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF95EC38A24 for ; Thu, 7 May 2020 18:11:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A057F21473 for ; Thu, 7 May 2020 18:11:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="e0B6HuDQ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726761AbgEGSLO (ORCPT ); Thu, 7 May 2020 14:11:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728289AbgEGSK3 (ORCPT ); Thu, 7 May 2020 14:10:29 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1FD65C05BD43 for ; Thu, 7 May 2020 11:10:29 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id r14so7935864ybk.21 for ; Thu, 07 May 2020 11:10:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=8H2cxWc0TJkFq1FwnzU8BhlMDlLROEsVn8jQ63PO1YA=; b=e0B6HuDQFhjEiqKogDpB4FKzUc+1Dc5yC/vswLYEcVtDTUxUF+EebiB+Cc9J824OQs RHMC3zH1dbpw8rXc96BMLodYXjsjhq/iL6S9yrv9krOI2qjgV8bkOqbR5k6Y3nkMqEca zMbpy+PyilGMtP3Mexgi9bk3qNVRPHlEDtwyw+broZ/rkGpWZsFi+KhpXcTyOiir4g3e cKMsSunv87LNlGijr/lhKEAstYnvmmaTSOHAGEC3FRDPWnxqIu2U79KpfZJRjjtRTYHr sPQhmCCM9dUl6ZppLJLe8CKNIZE+or72DPVnWjlqbzcNapTLTPMNJim0aCsiIzNRDOTE hKJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=8H2cxWc0TJkFq1FwnzU8BhlMDlLROEsVn8jQ63PO1YA=; b=NLwbZkqAXIfRkb3tUoirQh+CQ2qaG+GgdrY4UYD2FZBKwQJb9qCTTEQCQSCB4GkKdR RR/NqU4dagfGSr1wQlodzdBu57lJ1pfs96s8yF+jfuduCRR89tI+RjpEdAwbdjnKNPO0 GymzHb7+wKTvqee38XQpdfvIL8uwlSCiwFUx5tqwQCq0WY+VS1Ti4wLYZ7a3x1bIHZmJ pgDAzwubDoDRfZSqKpu8zOjPPFjKINCiPhwpBlCSaKUDAH6HQ7jMapxoGDAjqNck46o5 I97L3J1jE1j+GHIrpnqyeH102qkyGbPsXNNWTFrTidwreobaxu7uZ6b0UJjQeX9tnCNl kAqQ== X-Gm-Message-State: AGi0PuYjSZb26my9S4zUhIRudk3Q6hNOdzOg2Yre/2ZRiSfA25Dy3dWK IGZVnsn97kpPvssDYYC+nww9kDZim5H2 X-Google-Smtp-Source: APiQypL5FceGu1rlwwmqFHesyQwSxJJabs9h5OpeREfdyyMJo/uIVD6Sh4CrmCFa5su+iSIK8etzgG3RTlxV X-Received: by 2002:a25:d80f:: with SMTP id p15mr24245303ybg.379.1588875028303; Thu, 07 May 2020 11:10:28 -0700 (PDT) Date: Thu, 7 May 2020 19:10:04 +0100 In-Reply-To: <20200507181012.29791-1-qperret@google.com> Message-Id: <20200507181012.29791-7-qperret@google.com> Mime-Version: 1.0 References: <20200507181012.29791-1-qperret@google.com> X-Mailer: git-send-email 2.26.2.526.g744177e7f7-goog Subject: [PATCH 06/14] arch_topology: Export cpu_scale per-cpu array From: Quentin Perret To: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, sudeep.holla@arm.com, gregkh@linuxfoundation.org, rafael@kernel.org, viresh.kumar@linaro.org, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, mcgrof@kernel.org, keescook@chromium.org, yzaikin@google.com, fweisbec@gmail.com, tkjos@google.com, kernel-team@android.com, qperret@google.com Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org It will be needed by schedutil once modularized, export it. Signed-off-by: Quentin Perret --- drivers/base/arch_topology.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c index 4d0a0038b476..b1f0c272da67 100644 --- a/drivers/base/arch_topology.c +++ b/drivers/base/arch_topology.c @@ -48,6 +48,7 @@ void arch_set_freq_scale(struct cpumask *cpus, unsigned long cur_freq, } DEFINE_PER_CPU(unsigned long, cpu_scale) = SCHED_CAPACITY_SCALE; +EXPORT_SYMBOL_GPL(cpu_scale); void topology_set_cpu_scale(unsigned int cpu, unsigned long capacity) { From patchwork Thu May 7 18:10:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Perret X-Patchwork-Id: 212096 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5386EC38A24 for ; Thu, 7 May 2020 18:11:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2A61020870 for ; Thu, 7 May 2020 18:11:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="ge96F09X" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728355AbgEGSKe (ORCPT ); Thu, 7 May 2020 14:10:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728279AbgEGSKd (ORCPT ); Thu, 7 May 2020 14:10:33 -0400 Received: from mail-qt1-x849.google.com (mail-qt1-x849.google.com [IPv6:2607:f8b0:4864:20::849]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 502C2C05BD43 for ; Thu, 7 May 2020 11:10:33 -0700 (PDT) Received: by mail-qt1-x849.google.com with SMTP id v18so7681672qtq.22 for ; Thu, 07 May 2020 11:10:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=9OhNNPOR5bOJXqrXgYTR/z4ZLcIw94c7qBlgw12zehM=; b=ge96F09XdFsFsB5dYM9NSm1hEwRKTOm6LHBDxv4p756JWp8TiB91WkCmvrH5GpJ7ID R1VU3A76KGfuijtfRH6+xrVKU0ddCaeLZF07G8RQYkl68nCxyTdIXIQfY4W8gRGhbCod azIuW5jjVQqpdZInIkwMQBSRaUjl5Tu+cNcP1+KoCyvyGrxIzqKulY0Gn7TkwjziZ94Z BtRbwdywx5zzFJCVKWdH20zAP5GXCNqJLhSfhYgDYP5/Mm28PlWHVX30Ju4SOsih1iTY 7kpSk4677XwaHJJbNtMj+FUeOaemVnGoLjxIK5A4BsQxJR1aZ0j9uqW/oOpFjoP7CYkq VN1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=9OhNNPOR5bOJXqrXgYTR/z4ZLcIw94c7qBlgw12zehM=; b=EN/SaTlmYGcl+httFDxTdGR1JI6DrXXsvTiJAOjOF9UOPjrGdq9Hw+v212KF8u4MCe LKPlt2YT0ywI8YZhBH/4H33RmP48DR/x4kUdYRF7i4+9+bo+4n/QyEAj0WM7l32+7yew ZDRxgrbT2fEYqzOZpngjNqNSvdgv7BQAGMUcGJE9hxfOTiX4ohz8UO4er1C3Y/AI9Uyw 7AlwPmCTtckT+rusM5G0s9Ch1JPOiBxZSAplbgPttUki9+5J07aRRSFDwrQazxvHURN7 hRoQNTyfCym/QHalkduLqewdLc3ZgZV92LN6vKtaroVQBTt1Cn752EeqILjV2iUbesCn LNag== X-Gm-Message-State: AGi0Pub+pL+HW173tqu0mgXNVnmgqYn2NWPBk1PhlhXYVS8ac3M2KIkG myD26XtfhTSCAF18rfzpwcllhFL9+46Z X-Google-Smtp-Source: APiQypIiwLV5BbE0n5CUQvk0QJA7FNWdGbxWcAUCqDJsE+LSuluk52+DrvUSh3DwGlH7tJ6FU4zi3lidRXSp X-Received: by 2002:a0c:f50a:: with SMTP id j10mr13910437qvm.172.1588875032506; Thu, 07 May 2020 11:10:32 -0700 (PDT) Date: Thu, 7 May 2020 19:10:06 +0100 In-Reply-To: <20200507181012.29791-1-qperret@google.com> Message-Id: <20200507181012.29791-9-qperret@google.com> Mime-Version: 1.0 References: <20200507181012.29791-1-qperret@google.com> X-Mailer: git-send-email 2.26.2.526.g744177e7f7-goog Subject: [PATCH 08/14] sched/core: Export runqueues per-cpu array From: Quentin Perret To: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, sudeep.holla@arm.com, gregkh@linuxfoundation.org, rafael@kernel.org, viresh.kumar@linaro.org, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, mcgrof@kernel.org, keescook@chromium.org, yzaikin@google.com, fweisbec@gmail.com, tkjos@google.com, kernel-team@android.com, qperret@google.com Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org It will be needed by schedutil once modularized, export it. Signed-off-by: Quentin Perret --- This is only needed for cpu_rq() -> cpu_bw_dl() in schedutil, so there is probably an alternative if exporting this isn't desirable. --- kernel/sched/core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index dbaf3f63df22..537eb45b4274 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -36,6 +36,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(pelt_se_tp); EXPORT_TRACEPOINT_SYMBOL_GPL(sched_overutilized_tp); DEFINE_PER_CPU_SHARED_ALIGNED(struct rq, runqueues); +EXPORT_SYMBOL_GPL(runqueues); #if defined(CONFIG_SCHED_DEBUG) && defined(CONFIG_JUMP_LABEL) /* From patchwork Thu May 7 18:10:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Perret X-Patchwork-Id: 212097 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4FE46C47257 for ; Thu, 7 May 2020 18:11:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2E47A21473 for ; Thu, 7 May 2020 18:11:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="cEOQlfEV" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728148AbgEGSLI (ORCPT ); Thu, 7 May 2020 14:11:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728410AbgEGSKh (ORCPT ); Thu, 7 May 2020 14:10:37 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FA20C05BD43 for ; Thu, 7 May 2020 11:10:37 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id s8so7933814ybj.9 for ; Thu, 07 May 2020 11:10:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=4lcduyr6+J6gjW9QNJps5OFAxCiY2gXgkQhtQfZmlTA=; b=cEOQlfEVMyYdUWmraiQv6868nByrpJRpaaymVgBwUTg6wEdgwdIVUponU3hyLSlvTp 5fiab1SKPl//PLD9mpej/wjBU00SMNMDS/A6fS41QZb3XHBzUwGFrYDzviO9ErMIFElp LwjjpHOlYW87TavxsSdPCcg22n61ccvSbxkoFAZDeYUmjLjjj4SVs55GP1gwTD4sufrO 1E+2tAPiEMo1TUE9sizh8TCAFsd4mfShxMp1rSgIjvOIDptPPsdc8eHYXWVvI/Knbn3T e3CUlcs//sah/3XJ5uIYx6vHAdrtdPm6R0cTeDtF/EcwT6CcWJezEkkN2nUm9CU5LFel gO6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=4lcduyr6+J6gjW9QNJps5OFAxCiY2gXgkQhtQfZmlTA=; b=rxyE+tLSMDZiEqvN9IhCmJleoPyVFqe29pYGDPVFBMopYWmMsSjMkgrDxNxXSlFDRT Db6o46cchhXkyT0+YwuBqkd2rZoK3FLlEOk4H7g8zcKoyMLGLF0+wVMiIEE5u2Ia6kya Q0gne3wnZl4SA2GuoBUXiF6Iw6E11UyqMRbkE6Jm0Xn1aaPh6w6xxm4KTS1tRVjDzyLD qn4IDn8XIPB9szg5iO526uMD5fiIY3Z+GZqSyoeR+41U4p2G93ItKYHc3V/B+6fbb+wG PRKZXWX2HA3H/z1+T+zn/8TouPleXVVRsm1r0Og8LWaurTUBMwxB1pHD/rMcYVmo7nwt XgWg== X-Gm-Message-State: AGi0PubP1dgduL+cfGMjaFcE/aZCpxXzqEtkVuKXFUnzr4qlM09oe5EK XXjM0e8pH+p3NchJFuMduq5JpI9ynlAv X-Google-Smtp-Source: APiQypJPdsp8s/0FJ9HkF1hHrjGbTTy5ACV7cG92EmYwZKI6DWKFrz6S0o0PVs9GwAJo3DvMiOded7dIskOr X-Received: by 2002:a5b:707:: with SMTP id g7mr13422225ybq.489.1588875036707; Thu, 07 May 2020 11:10:36 -0700 (PDT) Date: Thu, 7 May 2020 19:10:08 +0100 In-Reply-To: <20200507181012.29791-1-qperret@google.com> Message-Id: <20200507181012.29791-11-qperret@google.com> Mime-Version: 1.0 References: <20200507181012.29791-1-qperret@google.com> X-Mailer: git-send-email 2.26.2.526.g744177e7f7-goog Subject: [PATCH 10/14] sched/fair: Export cpu_util_freq() From: Quentin Perret To: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, sudeep.holla@arm.com, gregkh@linuxfoundation.org, rafael@kernel.org, viresh.kumar@linaro.org, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, mcgrof@kernel.org, keescook@chromium.org, yzaikin@google.com, fweisbec@gmail.com, tkjos@google.com, kernel-team@android.com, qperret@google.com Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org It will be needed by schedutil once modularized, export it. Signed-off-by: Quentin Perret --- kernel/sched/fair.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index dadf0a060abe..b7b43aeff969 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -6488,6 +6488,7 @@ unsigned long cpu_util_freq(int cpu, unsigned long max) { return aggregate_cpu_util(cpu, cpu_util(cpu), max, FREQUENCY_UTIL, NULL); } +EXPORT_SYMBOL_GPL(cpu_util_freq); /* * Predicts what cpu_util(@cpu) would return if @p was migrated (and enqueued) From patchwork Thu May 7 18:10:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Perret X-Patchwork-Id: 212099 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT, USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EDFB5C38A2A for ; Thu, 7 May 2020 18:10:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C0AA72145D for ; Thu, 7 May 2020 18:10:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Hsq7csMm" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728465AbgEGSKm (ORCPT ); Thu, 7 May 2020 14:10:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727117AbgEGSKl (ORCPT ); Thu, 7 May 2020 14:10:41 -0400 Received: from mail-qt1-x84a.google.com (mail-qt1-x84a.google.com [IPv6:2607:f8b0:4864:20::84a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9B61C05BD43 for ; Thu, 7 May 2020 11:10:39 -0700 (PDT) Received: by mail-qt1-x84a.google.com with SMTP id g8so8148945qtq.2 for ; Thu, 07 May 2020 11:10:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=zZWvTUfx/wRuyyDcQxDeif3qbH8vMyyGM38ys5fdFsY=; b=Hsq7csMm3aKxHXFy3vU5SjedQTdFGmje4EFFn7pUNQI+7Tt5gipsk3gojrKeqv0oZA zKJmEc4qjOnoV2Poo1wux8oWp7druRmTRThDjQx0nXRmvka5WsF9eIK05U+G5BZ5kwA9 7QtfLulqPmZBLYbI0vKZu/6D5HO6i4g2a6I7enOxrKuX3hdzh9btnYC61l0lBlUK9g6G nIOYbvEzOurFENmE7JQ0pSeNgQ5IUaGVHwya8NGk1H3C8O8Gh3pvyYFCxt45XHtnr/q4 xHM22KlaIb+SQa38QzZsQOlVjsp4CDU+E/SvPDegyt/YmQrsmOX/1Q6cfHLV37HoscxQ DBqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=zZWvTUfx/wRuyyDcQxDeif3qbH8vMyyGM38ys5fdFsY=; b=hRTUNlQyTSUqIMx4bZ79d23KgqeinRXb8eOE7UuN1AoF3WJuHYADk5zpK6466jz+9j FEsDi+RI6ajpJQ1X2NuQnj+dlaXgSkwwrCaSh0+iUhKcVE/nuxLnAtiTqnmBSAhEYyrO a549GaDsiqKqvAFf7jqXM6z6eEwXdN2v+ZEA90TjFyMCbvZt3psauqGE9oKKHRFtwcix JI7zwW0/+aJs+ecAl7hojaIpfm3Rz0LdvuRmOSXaWeimukpcG7YLT8u5g5KCcDui87QF XMH9+DjgZmVqnkKYYyxgHLyKY24HYOUG42lBzLx00C6PO4I/ovN7NqLj+ldFUjZedwBq PxPQ== X-Gm-Message-State: AGi0PuYIMEsYtaAXEu31NkqiQj5O6XZqxOpRu71i48kEKGwt6SuKQ65f 4jVKGCSxupjfJzu2UHqAgzgBxWgvyENe X-Google-Smtp-Source: APiQypLtVxYcoBCGLT2opMHxryNuYGnQnZvm1aIxlatafdQirXZzAlFCc71e959iGzwoL9cFGjpKT/1CxlGY X-Received: by 2002:a0c:facb:: with SMTP id p11mr14758771qvo.17.1588875038848; Thu, 07 May 2020 11:10:38 -0700 (PDT) Date: Thu, 7 May 2020 19:10:09 +0100 In-Reply-To: <20200507181012.29791-1-qperret@google.com> Message-Id: <20200507181012.29791-12-qperret@google.com> Mime-Version: 1.0 References: <20200507181012.29791-1-qperret@google.com> X-Mailer: git-send-email 2.26.2.526.g744177e7f7-goog Subject: [PATCH 11/14] tick/sched: Export tick_nohz_get_idle_calls_cpu From: Quentin Perret To: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, sudeep.holla@arm.com, gregkh@linuxfoundation.org, rafael@kernel.org, viresh.kumar@linaro.org, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, mcgrof@kernel.org, keescook@chromium.org, yzaikin@google.com, fweisbec@gmail.com, tkjos@google.com, kernel-team@android.com, qperret@google.com Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org It will be needed by schedutil once modularized, export it. Signed-off-by: Quentin Perret --- kernel/time/tick-sched.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 3e2dc9b8858c..3b1050cabb58 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -1122,6 +1122,7 @@ unsigned long tick_nohz_get_idle_calls_cpu(int cpu) return ts->idle_calls; } +EXPORT_SYMBOL_GPL(tick_nohz_get_idle_calls_cpu); /** * tick_nohz_get_idle_calls - return the current idle calls counter value From patchwork Thu May 7 18:10:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Perret X-Patchwork-Id: 212098 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08A9FC54E49 for ; Thu, 7 May 2020 18:11:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D3E2F216FD for ; Thu, 7 May 2020 18:11:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="OJ5DdgiC" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728229AbgEGSKw (ORCPT ); Thu, 7 May 2020 14:10:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728487AbgEGSKr (ORCPT ); Thu, 7 May 2020 14:10:47 -0400 Received: from mail-qv1-xf4a.google.com (mail-qv1-xf4a.google.com [IPv6:2607:f8b0:4864:20::f4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18C53C05BD09 for ; Thu, 7 May 2020 11:10:46 -0700 (PDT) Received: by mail-qv1-xf4a.google.com with SMTP id d4so6641747qva.16 for ; Thu, 07 May 2020 11:10:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=tQJRWNXZ73jupkckFeVqSyiJPuHFNUXk3losPzo+jg0=; b=OJ5DdgiCF2sqkpLYesteMXNORwEGKDR0Y0KA0Y5rnVPYA7hNXSv1oL/MShKoOyUxtV ry7nKG2JXxTPRL9bLbxFdeT9Y2YqTlL4Fei31TaPiPOjMOkdUPfTils+SnDcvYFhfDJQ jjCzkIM36yfW/s841TyY6iK9sscitEH4sJ4DlMMBcV5YAQU5KOKQLO1T6Aa31KbeLycu LgOLgeWtLfvKc7O1SaUqq8AjMtDmYgxHFLOcjWdmib1seFPbUx4qpqmtUeU2/m1tBGXO m3ec7zNB0QRGtS6NtlA9VDThwYF7JCq4VENLUDeG20hKDR8IlSt+VL8f+ePs8xq03gJ3 LoJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=tQJRWNXZ73jupkckFeVqSyiJPuHFNUXk3losPzo+jg0=; b=QhXUSHTfdMBm7Sf516YbyA/EEgbtfVbot0aoujQQgPq7tkvPwDYnMpuLY1ZIe/SclK YEuqzs+ZCJH/gWIIQVH03Pq6Ge2+5FvlUOMIHFlYnLhFBBeP/B8OhRjNBH8gn7H+314i 2oBaJ1YVRIGAbpuhmPxZqfB1J3K7vCkWucbUYU8/bq6v9/KBhnYbkhwuIK3kxNDDEPQb 2VQOiSuBd7DfngtRQ4qzILVxxcark97GEaoJlDccR99HNoMfzCK+I+9cyfW2seeN87MV +G2ao43iuaBTdkTy3USFK3M8xB4fVmU7QPZ0Fe7B9JCrsA9N+eCCkt28C+Xa2F3jvZG3 f/mA== X-Gm-Message-State: AGi0PuaXbwF6r35NN4AVxQx9KzX+OLWwqQ1lQZtBcmZESpGwx53RrzG0 ITi3tfBbp5rORJYcw8hynuuIhx9712jz X-Google-Smtp-Source: APiQypLWF74i2ubQ61UdlGU8XHa46X4VRO8h//dR1bpYaMIS2zPs03r4Fxjeh4NMjh22GrvVAsE+nhm84qFL X-Received: by 2002:ad4:58eb:: with SMTP id di11mr14503909qvb.39.1588875045240; Thu, 07 May 2020 11:10:45 -0700 (PDT) Date: Thu, 7 May 2020 19:10:12 +0100 In-Reply-To: <20200507181012.29791-1-qperret@google.com> Message-Id: <20200507181012.29791-15-qperret@google.com> Mime-Version: 1.0 References: <20200507181012.29791-1-qperret@google.com> X-Mailer: git-send-email 2.26.2.526.g744177e7f7-goog Subject: [PATCH 14/14] sched: cpufreq: Modularize schedutil From: Quentin Perret To: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com, sudeep.holla@arm.com, gregkh@linuxfoundation.org, rafael@kernel.org, viresh.kumar@linaro.org, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, mcgrof@kernel.org, keescook@chromium.org, yzaikin@google.com, fweisbec@gmail.com, tkjos@google.com, kernel-team@android.com, qperret@google.com Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Now that all requirements to modularize schedutil are met, make the Kconfig option tristate and add the missing MODULE_*() declarations in cpufreq_schedutil.c. Signed-off-by: Quentin Perret --- drivers/cpufreq/Kconfig | 2 +- kernel/sched/cpufreq_schedutil.c | 15 ++++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/cpufreq/Kconfig b/drivers/cpufreq/Kconfig index c3e6bd59e920..49942f422a57 100644 --- a/drivers/cpufreq/Kconfig +++ b/drivers/cpufreq/Kconfig @@ -185,7 +185,7 @@ config CPU_FREQ_GOV_CONSERVATIVE If in doubt, say N. config CPU_FREQ_GOV_SCHEDUTIL - bool "'schedutil' cpufreq policy governor" + tristate "'schedutil' cpufreq policy governor" depends on CPU_FREQ && SMP select CPU_FREQ_GOV_ATTR_SET select IRQ_WORK diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c index aeb04cc5b740..ea2778422efd 100644 --- a/kernel/sched/cpufreq_schedutil.c +++ b/kernel/sched/cpufreq_schedutil.c @@ -786,15 +786,20 @@ struct cpufreq_governor schedutil_gov = { #endif /* CONFIG_ENERGY_MODEL */ }; +static int __init sugov_register(void) +{ + return cpufreq_register_governor(&schedutil_gov); +} + #ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_SCHEDUTIL struct cpufreq_governor *cpufreq_default_governor(void) { return &schedutil_gov; } +core_initcall(sugov_register); +#else +module_init(sugov_register); #endif -static int __init sugov_register(void) -{ - return cpufreq_register_governor(&schedutil_gov); -} -core_initcall(sugov_register); +MODULE_LICENSE("GPL v2"); +MODULE_DESCRIPTION("Schedutil CPUFreq Governor");