Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752530AbcDRGpj (ORCPT ); Mon, 18 Apr 2016 02:45:39 -0400 Received: from mail-oi0-f67.google.com ([209.85.218.67]:33979 "EHLO mail-oi0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752241AbcDRGo3 (ORCPT ); Mon, 18 Apr 2016 02:44:29 -0400 From: "Bill Huey (hui)" To: Peter Zijlstra , Steven Rostedt , Alessandro Zummo , linux-kernel@vger.kernel.org Cc: luca abeni , Juri Lelli , Mike Galbraith , Thomas Gleixner Subject: [PATCH RFC v2 09/12] Add priority support for the cyclic scheduler Date: Sun, 17 Apr 2016 23:44:11 -0700 Message-Id: <1460961854-3449-10-git-send-email-bill.huey@gmail.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1460961854-3449-1-git-send-email-bill.huey@gmail.com> References: <1460961854-3449-1-git-send-email-bill.huey@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1423 Lines: 52 Initial bits to prevent priority changing of cyclic scheduler tasks by only allow them to be SCHED_FIFO. Fairly hacky at this time and will need revisiting because of the security concerns. Affects task death handling since it uses an additional scheduler class hook for clean up at death. Must be SCHED_FIFO. Signed-off-by: Bill Huey (hui) --- kernel/sched/core.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 8b489fc..76634d3 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -87,6 +87,10 @@ #include "../workqueue_internal.h" #include "../smpboot.h" +#ifdef CONFIG_RTC_CYCLIC +#include "cyclic.h" +#endif + #define CREATE_TRACE_POINTS #include @@ -2092,6 +2096,10 @@ static void __sched_fork(unsigned long clone_flags, struct task_struct *p) memset(&p->se.statistics, 0, sizeof(p->se.statistics)); #endif +#ifdef CONFIG_RTC_CYCLIC + RB_CLEAR_NODE(&p->rt.rt_overrun.node); +#endif + RB_CLEAR_NODE(&p->dl.rb_node); init_dl_task_timer(&p->dl); __dl_clear_params(p); @@ -3899,6 +3907,11 @@ recheck: if (dl_policy(policy)) return -EPERM; +#ifdef CONFIG_RTC_CYCLIC + if (rt_overrun_policy(p, policy)) + return -EPERM; +#endif + /* * Treat SCHED_IDLE as nice 20. Only allow a switch to * SCHED_NORMAL if the RLIMIT_NICE would normally permit it. -- 2.5.0