mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Bill Huey (hui)" <bill.huey@gmail.com>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Steven Rostedt <rostedt@goodmis.org>,
	Alessandro Zummo <a.zummo@towertech.it>,
	linux-kernel@vger.kernel.org
Cc: luca abeni <luca.abeni@unitn.it>, Juri Lelli <juri.lelli@arm.com>,
	Mike Galbraith <umgwanakikbuti@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: [PATCH RFC v2 09/12] Add priority support for the cyclic scheduler
Date: Sun, 17 Apr 2016 23:44:11 -0700	[thread overview]
Message-ID: <1460961854-3449-10-git-send-email-bill.huey@gmail.com> (raw)
In-Reply-To: <1460961854-3449-1-git-send-email-bill.huey@gmail.com>

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) <bill.huey@gmail.com>
---
 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 <trace/events/sched.h>
 
@@ -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

  parent reply	other threads:[~2016-04-18  6:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-18  6:44 [PATCH RFC v2 00/12] Cyclic Scheduler Against RTC Bill Huey (hui)
2016-04-18  6:44 ` [PATCH RFC v2 01/12] Kconfig change Bill Huey (hui)
2016-04-18  6:44 ` [PATCH RFC v2 02/12] Reroute rtc update irqs to the cyclic scheduler handler Bill Huey (hui)
2016-04-18  6:44 ` [PATCH RFC v2 03/12] Add cyclic support to rtc-dev.c Bill Huey (hui)
2016-04-18  6:44 ` [PATCH RFC v2 04/12] Anonymous struct initialization Bill Huey (hui)
2016-04-18  6:44 ` [PATCH RFC v2 05/12] Task tracking per file descriptor Bill Huey (hui)
2016-04-18  6:44 ` [PATCH RFC v2 06/12] Add anonymous struct to sched_rt_entity Bill Huey (hui)
2016-04-18  6:44 ` [PATCH RFC v2 07/12] kernel/userspace additions for addition ioctl() support for rtc Bill Huey (hui)
2016-04-18  6:44 ` [PATCH RFC v2 08/12] Compilation support Bill Huey (hui)
2016-04-18  6:44 ` Bill Huey (hui) [this message]
2016-04-18  6:44 ` [PATCH RFC v2 10/12] Export SCHED_FIFO/RT requeuing functions Bill Huey (hui)
2016-04-18  6:44 ` [PATCH RFC v2 11/12] Cyclic scheduler support Bill Huey (hui)
2016-04-18  6:44 ` [PATCH RFC v2 12/12] Cyclic/rtc documentation Bill Huey (hui)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1460961854-3449-10-git-send-email-bill.huey@gmail.com \
    --to=bill.huey@gmail.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=a.zummo@towertech.it \
    --cc=juri.lelli@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luca.abeni@unitn.it \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=umgwanakikbuti@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®