Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753387AbdGGD4f (ORCPT ); Thu, 6 Jul 2017 23:56:35 -0400 Received: from mail-oi0-f45.google.com ([209.85.218.45]:36635 "EHLO mail-oi0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752643AbdGGD4e (ORCPT ); Thu, 6 Jul 2017 23:56:34 -0400 MIME-Version: 1.0 In-Reply-To: <20170705085905.6558-4-juri.lelli@arm.com> References: <20170705085905.6558-1-juri.lelli@arm.com> <20170705085905.6558-4-juri.lelli@arm.com> From: Joel Fernandes Date: Thu, 6 Jul 2017 20:56:32 -0700 Message-ID: Subject: Re: [RFC PATCH v1 3/8] sched/cpufreq_schedutil: make worker kthread be SCHED_DEADLINE To: Juri Lelli Cc: Peter Zijlstra , Ingo Molnar , "Rafael J. Wysocki" , Viresh Kumar , LKML , Linux PM , Thomas Gleixner , Vincent Guittot , Steven Rostedt , luca.abeni@santannapisa.it, claudio@evidence.eu.com, Tommaso Cucinotta , bristot@redhat.com, mathieu.poirier@linaro.org, Todd Kjos , Andres Oportus , Morten Rasmussen , Dietmar Eggemann , Patrick Bellasi , Ingo Molnar , "Rafael J . Wysocki" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2657 Lines: 66 Hi Juri, On Wed, Jul 5, 2017 at 1:59 AM, Juri Lelli wrote: > Worker kthread needs to be able to change frequency for all other > threads. > > Make it special, just under STOP class. > > Signed-off-by: Juri Lelli > Cc: Peter Zijlstra > Cc: Ingo Molnar > Cc: Rafael J. Wysocki > Cc: Viresh Kumar > Cc: Luca Abeni > Cc: Claudio Scordino > --- > Changes from RFCv0: > > - use a high bit of sched_flags and don't expose the new flag to > userspace (also add derisory comments) (Peter) > --- > include/linux/sched.h | 1 + > kernel/sched/core.c | 15 +++++++++++++-- > kernel/sched/cpufreq_schedutil.c | 15 ++++++++++++--- > kernel/sched/deadline.c | 13 +++++++++++++ > kernel/sched/sched.h | 20 +++++++++++++++++++- > 5 files changed, 58 insertions(+), 6 deletions(-) > > diff --git a/include/linux/sched.h b/include/linux/sched.h > index 1f0f427e0292..0ba767fdedae 100644 > --- a/include/linux/sched.h > +++ b/include/linux/sched.h > @@ -1359,6 +1359,7 @@ extern int idle_cpu(int cpu); > extern int sched_setscheduler(struct task_struct *, int, const struct sched_param *); > extern int sched_setscheduler_nocheck(struct task_struct *, int, const struct sched_param *); > extern int sched_setattr(struct task_struct *, const struct sched_attr *); > +extern int sched_setattr_nocheck(struct task_struct *, const struct sched_attr *); > extern struct task_struct *idle_task(int cpu); > > /** > diff --git a/kernel/sched/core.c b/kernel/sched/core.c > index 5186797908dc..0e40c7ff2bf4 100644 > --- a/kernel/sched/core.c > +++ b/kernel/sched/core.c > @@ -3998,7 +3998,9 @@ static int __sched_setscheduler(struct task_struct *p, > } > > if (attr->sched_flags & > - ~(SCHED_FLAG_RESET_ON_FORK | SCHED_FLAG_RECLAIM)) > + ~(SCHED_FLAG_RESET_ON_FORK | > + SCHED_FLAG_RECLAIM | > + SCHED_FLAG_SPECIAL)) > return -EINVAL; I was thinking if its better to name SCHED_FLAG_SPECIAL something more descriptive than "special", since it will not be clear looking at other parts of the code that this is used for the frequency scaling thread or that its a DL task. I was thinking since this flag is specifically setup for the sugov thread frequency scaling purpose, a better flag name than SPECIAL might be SCHED_FLAG_DL_FREQ_SCALE or SCHED_FLAG_FREQ_SCALE. But I am Ok with whatever makes sense to do here. Thanks, Regards, -Joel