mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH][plugsched 16/28] make rt_task private
@ 2004-10-30 14:39 Con Kolivas
  0 siblings, 0 replies; only message in thread
From: Con Kolivas @ 2004-10-30 14:39 UTC (permalink / raw)
  To: linux
  Cc: Andrew Morton, Ingo Molnar, Peter Williams,
	William Lee Irwin III, Alexander Nyberg, Nick Piggin


[-- Attachment #1.1: Type: text/plain, Size: 22 bytes --]

make rt_task private


[-- Attachment #1.2: privatise_rt_task.diff --]
[-- Type: text/x-patch, Size: 2637 bytes --]

Scheduler designs may not identify real time tasks by their priority so
privatise the rt_task macro as a function.

Signed-off-by: Con Kolivas <kernel@kolivas.org>

Index: linux-2.6.10-rc1-mm2-plugsched1/include/linux/sched.h
===================================================================
--- linux-2.6.10-rc1-mm2-plugsched1.orig/include/linux/sched.h	2004-10-29 21:47:46.780525066 +1000
+++ linux-2.6.10-rc1-mm2-plugsched1/include/linux/sched.h	2004-10-29 21:47:49.047171325 +1000
@@ -345,7 +345,7 @@ struct signal_struct {
 
 #define MAX_PRIO		(MAX_RT_PRIO + 40)
 
-#define rt_task(p)		(unlikely((p)->prio < MAX_RT_PRIO))
+extern int rt_task(task_t *p);
 
 /*
  * Some day this will be a full-fledged user tracking system..
Index: linux-2.6.10-rc1-mm2-plugsched1/include/linux/scheduler.h
===================================================================
--- linux-2.6.10-rc1-mm2-plugsched1.orig/include/linux/scheduler.h	2004-10-29 21:47:15.473410961 +1000
+++ linux-2.6.10-rc1-mm2-plugsched1/include/linux/scheduler.h	2004-10-29 21:47:49.048171169 +1000
@@ -1,5 +1,6 @@
 struct sched_drv
 {
+	int (*rt_task)(task_t *);
 	void (*wait_for_completion)(struct completion *);
 	void (*io_schedule)(void);
 	long (*io_schedule_timeout)(long);
Index: linux-2.6.10-rc1-mm2-plugsched1/kernel/sched.c
===================================================================
--- linux-2.6.10-rc1-mm2-plugsched1.orig/kernel/sched.c	2004-10-29 21:47:38.395833609 +1000
+++ linux-2.6.10-rc1-mm2-plugsched1/kernel/sched.c	2004-10-29 21:47:49.050170857 +1000
@@ -292,6 +292,11 @@ static DEFINE_PER_CPU(struct runqueue, r
 #define task_rq(p)		cpu_rq(task_cpu(p))
 #define cpu_curr(cpu)		(cpu_rq(cpu)->curr)
 
+static int ingo_rt_task(task_t *p)
+{
+	return (unlikely((p)->prio < MAX_RT_PRIO));
+}
+
 /*
  * Default context-switch locking:
  */
@@ -4139,6 +4144,7 @@ void destroy_sched_domain_sysctl()
 #endif
 
 struct sched_drv ingo_sched_drv = {
+	.rt_task		= ingo_rt_task,
 	.wait_for_completion	= ingo_wait_for_completion,
 	.io_schedule		= ingo_io_schedule,
 	.io_schedule_timeout	= ingo_io_schedule_timeout,
Index: linux-2.6.10-rc1-mm2-plugsched1/kernel/scheduler.c
===================================================================
--- linux-2.6.10-rc1-mm2-plugsched1.orig/kernel/scheduler.c	2004-10-29 21:47:15.477410337 +1000
+++ linux-2.6.10-rc1-mm2-plugsched1/kernel/scheduler.c	2004-10-29 21:47:49.051170701 +1000
@@ -921,6 +921,11 @@ unsigned long nr_iowait(void)
 	return scheduler->nr_iowait();
 }
 
+int rt_task(task_t *task)
+{
+	return scheduler->rt_task(task);
+}
+
 int idle_cpu(int cpu)
 {
 	return scheduler->idle_cpu(cpu);


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 256 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-10-30 15:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-30 14:39 [PATCH][plugsched 16/28] make rt_task private Con Kolivas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome