From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936914AbdEWSwr (ORCPT ); Tue, 23 May 2017 14:52:47 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:49903 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762718AbdEWSwn (ORCPT ); Tue, 23 May 2017 14:52:43 -0400 Date: Tue, 23 May 2017 20:52:22 +0200 From: Peter Zijlstra To: Juri Lelli Cc: mingo@redhat.com, rjw@rjwysocki.net, viresh.kumar@linaro.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, tglx@linutronix.de, vincent.guittot@linaro.org, rostedt@goodmis.org, luca.abeni@santannapisa.it, claudio@evidence.eu.com, tommaso.cucinotta@santannapisa.it, bristot@redhat.com, mathieu.poirier@linaro.org, tkjos@android.com, joelaf@google.com, andresoportus@google.com, morten.rasmussen@arm.com, dietmar.eggemann@arm.com, patrick.bellasi@arm.com, Ingo Molnar , "Rafael J . Wysocki" Subject: Re: [PATCH RFC 3/8] sched/cpufreq_schedutil: make worker kthread be SCHED_DEADLINE Message-ID: <20170523185222.sewatquohs3vuped@hirez.programming.kicks-ass.net> References: <20170523085351.18586-1-juri.lelli@arm.com> <20170523085351.18586-4-juri.lelli@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170523085351.18586-4-juri.lelli@arm.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 23, 2017 at 09:53:46AM +0100, Juri Lelli wrote: > diff --git a/include/uapi/linux/sched.h b/include/uapi/linux/sched.h > index e2a6c7b3510b..72723859ef74 100644 > --- a/include/uapi/linux/sched.h > +++ b/include/uapi/linux/sched.h > @@ -48,5 +48,6 @@ > */ > #define SCHED_FLAG_RESET_ON_FORK 0x01 > #define SCHED_FLAG_RECLAIM 0x02 > +#define SCHED_FLAG_SPECIAL 0x04 > > #endif /* _UAPI_LINUX_SCHED_H */ > diff --git a/kernel/sched/core.c b/kernel/sched/core.c > index 7fc2011c3ce7..ba57e2ef9aef 100644 > @@ -4205,7 +4212,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; > > /* Could we pretty please not expose this gruesome hack to userspace? So if you stick it in attr->sched_flags, use a high bit and don't put it in a uapi header. Also make the flags check explicitly fail on it when @user. Such that only _nocheck() (and thus kernel) callers have access to it. Also, there's not nearly enough warnings and other derisory comments near it.