linux-hls-cvs Mailing List for Hierarchical Loadable Schedulers
Status: Pre-Alpha
Brought to you by:
lucabe
You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(7) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
|
Feb
(13) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
(14) |
Dec
(9) |
2004 |
Jan
|
Feb
|
Mar
|
Apr
(12) |
May
|
Jun
(2) |
Jul
(4) |
Aug
(4) |
Sep
|
Oct
(4) |
Nov
(4) |
Dec
|
2005 |
Jan
(4) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
(4) |
Apr
|
May
(2) |
Jun
(7) |
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2010 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
(2) |
Apr
(1) |
May
(1) |
Jun
(2) |
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
(1) |
Dec
(1) |
2014 |
Jan
|
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
(2) |
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2017 |
Jan
|
Feb
(1) |
Mar
|
Apr
(3) |
May
(2) |
Jun
(2) |
Jul
(3) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Perfect B. T. <no-...@fr...> - 2012-05-29 10:40:47
|
Watch this VIDEO: 7 Foods that reduce stubborn abdominal fat > [http://b65449ubqyzl9wekxfjfp-3v4e.hop.clickbank.net/] (Only visible for a short time.) Hope you can benefit from it... :-) Regards Andrew E-mail Disclaimer: The information transmitted is intended only for the person or entity to which it is addressed and may contain user account or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. Any information within this message is not necessarily the expressed view of the E-MAIL SENDER and the E-MAIL SENDER cannot be held liable in any way. The information, images, documents and views expressed in this e-mail are personal to the sender and do not expressly or implicitly represent official positions and policies. If you received this in error, please contact the sender and delete the material from any computer. Every effort has been made to accurately represent this product and it¹s potential. Your level of success in attaining the results claimed in our materials depends on your time and effort you devote to the programme. We cannot promise your success. Nor are we responsible for any of your actions. If you feel that this email represents UNCOLICITED BULK EMAIL please forward this email for review to Rep...@Sp.... Should you no longer wish to receive correspondence from this sender, please unsubscribe on this list here >[http://http://free-movie.co.za/int/unsubscribe.php?M=5217535&C=d9351138bdaa62ed2b60f15cf94489c1&L=40&N=193/] |
From: E. <ar...@gl...> - 2011-06-18 04:52:44
|
Enclosed please find our discount price for handmade portrait painting. If you are interested, please check the attachment. |
From: Robert K <koj...@ao...> - 2010-06-06 17:47:51
|
- This mail is a HTML mail. Not all elements could be shown in plain text mode. - To: lin...@li... Please do not be embarrass am seeking your help in order to receive the sum of 4.5million as result of surfeit profit we made. If you will be so kind enough to grant me the permission, I will be glad to give the details. I am ready to offer you 30% of the total amount for your input. If you are interested go ahead and provide me your full name/Address and your contact number. Regards Robert |
From: Luca A. <lu...@us...> - 2005-08-24 15:23:46
|
Update of /cvsroot/linux-hls/qosman/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26352/src Modified Files: clnt-us.c Log Message: Avoid setting a crazy value for the first "old (compressed) bandwidth"... Index: clnt-us.c =================================================================== RCS file: /cvsroot/linux-hls/qosman/src/clnt-us.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** clnt-us.c 9 Apr 2004 13:39:57 -0000 1.2 --- clnt-us.c 24 Aug 2005 15:23:38 -0000 1.3 *************** *** 122,126 **** struct sigaction sa; struct itimerval it; ! /* Remember: My ID is my PID... */ qtask_register(getpid(), USEC2BAND(q, period), w, period, drel, q); --- 122,138 ---- struct sigaction sa; struct itimerval it; ! ! sp.sched_size = sizeof(struct cbs_param); ! sp.sched_p = &cs; ! cs.signature = CBS_SIGNATURE; ! cs.max_budget = q; ! cs.period = drel; ! res = sched_setscheduler(getpid(), SCHED_CBS, &sp); ! if (res < 0) { ! cprintf("Cannot create the CPU reserve for task %s!!!\n", name); ! return NULLID; ! } ! ! /* Remember: My ID is my PID... */ qtask_register(getpid(), USEC2BAND(q, period), w, period, drel, q); *************** *** 158,173 **** } - /* Here, we must transform the child in a CBS guy */ - sp.sched_size = sizeof(struct cbs_param); - sp.sched_p = &cs; - cs.signature = CBS_SIGNATURE; - cs.max_budget = q; - cs.period = drel; - res = sched_setscheduler(pid, SCHED_CBS, &sp); - if (res < 0) { - cprintf("Cannot create the CPU reserve for task %s!!!\n", name); - return NULLID; - } - return pid; } --- 170,173 ---- |
From: Luca A. <lu...@us...> - 2005-08-24 10:59:28
|
Update of /cvsroot/linux-hls/qosman/demos In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32358 Modified Files: txtdemo.c Log Message: Improve the text demo... Now, it can run more than 1 task :) Index: txtdemo.c =================================================================== RCS file: /cvsroot/linux-hls/qosman/demos/txtdemo.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** txtdemo.c 9 Apr 2004 13:41:31 -0000 1.1 --- txtdemo.c 24 Aug 2005 10:59:21 -0000 1.2 *************** *** 19,22 **** --- 19,23 ---- DWORD times[10000]; int global; + static WINDOW *scr; static void exit_handler(int dummy) *************** *** 31,35 **** void tb(WORD i) { - WINDOW *scr; struct sigaction sa; int res; --- 32,35 ---- *************** *** 38,42 **** /* TODO: Init */ - scr = initscr(); sa.sa_handler = exit_handler; sigemptyset(&sa.sa_mask); --- 38,41 ---- *************** *** 110,113 **** --- 109,113 ---- char name[80]; int dummy; + int i, start, end; cprintf("Goin' to initialize the QoS Library..."); *************** *** 123,147 **** qman_feedback(&pidactions); ! t.wcet = Q0; ! t.per = T; ! t.reduce = T / TS; ! t.w = W; if (argc > 1) { ! t.arg = atoi(argv[1]); } else { ! t.arg = 0; } ! sprintf(name, "QDemo Task %d", t.arg); ! t.name = name; ! t.body = tb; ! t.model = MM_TASK; ! qt = qman_task(&t); ! if (qt == 0) { ! printf("QoS Task creation failed...\n"); ! exit(-1); } - - wait(&dummy); printf("Waited...\n"); --- 123,159 ---- qman_feedback(&pidactions); ! scr = initscr(); ! if (argc > 1) { ! start = atoi(argv[1]); } else { ! start = 0; } ! if (argc > 2) { ! end = atoi(argv[2]); ! } else { ! end = start + 1; ! } ! for (i = start; i < end; i++) { ! t.wcet = Q0; ! t.per = T; ! t.reduce = T / TS; ! t.w = W; ! t.arg = i; ! sprintf(name, "QDemo Task %d", t.arg); ! t.name = name; ! t.body = tb; ! t.model = MM_TASK; ! qt = qman_task(&t); ! if (qt == 0) { ! printf("QoS Task creation failed...\n"); ! ! exit(-1); ! } ! } ! for (i = start; i < end; i++) { ! wait(&dummy); } printf("Waited...\n"); |
From: Luca A. <lu...@us...> - 2005-01-22 12:06:36
|
Update of /cvsroot/linux-hls/hls/linux-2.6 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4892/linux-2.6 Modified Files: bottom.c hls_ctl.c init.c Log Message: 2.6 backend update... Still doesn't work, but it looks better ;-) Index: init.c =================================================================== RCS file: /cvsroot/linux-hls/hls/linux-2.6/init.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** init.c 2 Nov 2004 07:39:29 -0000 1.3 --- init.c 22 Jan 2005 12:06:24 -0000 1.4 *************** *** 88,97 **** do_each_thread(dummy, t) { #ifdef __FP_DEAMONS__ ! if (t->tty == NULL) { #ifdef VERBOSE hls_printk("Giving T%d the highest priority\n", t->pid); #endif t->policy = SCHED_FIFO; t->rt_priority = HLS_SCHEDULING_PRIORITY + 1; t->private_data = NULL; } else { --- 88,101 ---- do_each_thread(dummy, t) { #ifdef __FP_DEAMONS__ ! if (t->signal->tty == NULL) { #ifdef VERBOSE hls_printk("Giving T%d the highest priority\n", t->pid); #endif + #if 0 t->policy = SCHED_FIFO; t->rt_priority = HLS_SCHEDULING_PRIORITY + 1; + #else + gensched_dispatch(t, GENSCHED_ENABLE); + #endif t->private_data = NULL; } else { Index: bottom.c =================================================================== RCS file: /cvsroot/linux-hls/hls/linux-2.6/bottom.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** bottom.c 2 Nov 2004 07:39:29 -0000 1.3 --- bottom.c 22 Jan 2005 12:06:24 -0000 1.4 *************** *** 76,83 **** --- 76,85 ---- if (t != NULL) { sched_non_running = (t->state != TASK_RUNNING); + #if 0 /* Inactive tasks are SCHED_NORMAL! */ if(t->policy != SCHED_FIFO) { printk("HLS ERROR: Scheduling an HLS task with policy != SCHED_FIFO...\n"); hls_printk("HLS ERROR: Scheduling an HLS task with policy != SCHED_FIFO...\n"); } + #endif /* Yes... Schedule it. * The linux dispatcher will do the dirty work for us... Index: hls_ctl.c =================================================================== RCS file: /cvsroot/linux-hls/hls/linux-2.6/hls_ctl.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** hls_ctl.c 9 Oct 2004 10:26:56 -0000 1.2 --- hls_ctl.c 22 Jan 2005 12:06:24 -0000 1.3 *************** *** 210,223 **** /* We have to move to the new scheduler... */ ! #ifdef HLS_DEBUG ! hls_printk("hls_ctl: Moving to %s\n", target_sched->Name); ! #endif state = hls_thread_move(t, target_sched); if (state < 0) { return -EINVAL; } ! #ifdef HLS_DEBUG ! hls_printk(" ...and setting the parameters (Priority %d)!\n", hls_priority); ! #endif status = hls_setparam(th->vp, s_p, hls_priority); if (status == HLS_SUCCESS) { --- 210,219 ---- /* We have to move to the new scheduler... */ ! HLSDbgPrint (9, ("hls_ctl: Moving to %s\n", target_sched->Name)); state = hls_thread_move(t, target_sched); if (state < 0) { return -EINVAL; } ! HLSDbgPrint (9, (" ...and setting the parameters (Priority %d)!\n", hls_priority)); status = hls_setparam(th->vp, s_p, hls_priority); if (status == HLS_SUCCESS) { *************** *** 302,306 **** return -EFAULT; } - printk("Parse priority: %d\n", sched_p.sp.sched_priority); return sched_p.sp.sched_priority; --- 298,301 ---- *************** *** 335,339 **** int return_to_linux; - spin_lock_irqsave(&hls_lock, flags); p = find_process_by_pid(pid); if (p == NULL) { --- 330,333 ---- *************** *** 350,353 **** --- 344,348 ---- priority = HLS_DEFAULT_PRIORITY; #else + spin_lock_irqsave(&hls_lock, flags); HLSExitThreadHook(p); p->policy = SCHED_NORMAL; *************** *** 356,359 **** --- 351,355 ---- * No need to set s & sched_param */ + spin_unlock_irqrestore(&hls_lock, flags); return_to_linux = 1; #endif *************** *** 364,372 **** */ #ifdef NOLINUX_TASKS ! p->policy = SCHED_FIFO; p->rt_priority = HLS_IDLE_PRIORITY; HLSCreateThreadHook(p, p->state); #else ! printk("Policy %d != SCHED_HLS. Doing nothing... (already non-hls)\n", policy); #endif /* We do not need to call hls_ctl... --- 360,374 ---- */ #ifdef NOLINUX_TASKS ! spin_lock_irqsave(&hls_lock, flags); ! #if 0 ! p->policy = SCHED_FIFO; p->rt_priority = HLS_IDLE_PRIORITY; + #else + gensched_dispatch(p, GENSCHED_DISABLE); + #endif HLSCreateThreadHook(p, p->state); + spin_unlock_irqrestore(&hls_lock, flags); #else ! HLSDbgPrint (9, ("Policy %d != SCHED_HLS. Doing nothing... (already non-hls)\n", policy)); #endif /* We do not need to call hls_ctl... *************** *** 377,384 **** --- 379,392 ---- } else { if (p->private_data == NULL) { + spin_lock_irqsave(&hls_lock, flags); /* Transform in HLS */ + #if 0 p->policy = SCHED_FIFO; p->rt_priority = HLS_IDLE_PRIORITY; + #else + gensched_dispatch(p, GENSCHED_DISABLE); + #endif HLSCreateThreadHook(p, p->state); + spin_unlock_irqrestore(&hls_lock, flags); } /* Change scheduler to rt_sched */ *************** *** 394,399 **** if (return_to_linux >= 0) { - spin_unlock_irqrestore(&hls_lock, flags); - return return_to_linux; } --- 402,405 ---- *************** *** 402,407 **** sched_param = sp; if (priority < 0) { - spin_unlock_irqrestore(&hls_lock, flags); - return priority; } --- 408,411 ---- *************** *** 411,424 **** printk("HLS Error: %d has private_data = NULL???\n", p->pid); #ifdef NOLINUX_TASKS - spin_unlock_irqrestore(&hls_lock, flags); - return -EINVAL; #else p->policy = SCHED_FIFO; p->rt_priority = HLS_IDLE_PRIORITY; HLSCreateThreadHook(p, p->state); #endif } res = hls_ctl(p, s, sched_param, priority); --- 415,433 ---- printk("HLS Error: %d has private_data = NULL???\n", p->pid); #ifdef NOLINUX_TASKS return -EINVAL; #else + spin_lock_irqsave(&hls_lock, flags); + #if 0 p->policy = SCHED_FIFO; p->rt_priority = HLS_IDLE_PRIORITY; + #else + gensched_dispatch(p, GENSCHED_DISABLE); + #endif HLSCreateThreadHook(p, p->state); + spin_unlock_irqrestore(&hls_lock, flags); #endif } + spin_lock_irqsave(&hls_lock, flags); res = hls_ctl(p, s, sched_param, priority); |
From: Luca A. <lu...@us...> - 2005-01-22 12:06:35
|
Update of /cvsroot/linux-hls/hls/patches In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4892/patches Added Files: gensched2-2.6.8-1.patch Log Message: 2.6 backend update... Still doesn't work, but it looks better ;-) --- NEW FILE: gensched2-2.6.8-1.patch --- diff -urp kernel-source-2.6.8/Makefile gensched/kernel-source-2.6.8/Makefile --- kernel-source-2.6.8/Makefile 2004-09-13 05:28:07.000000000 +0200 +++ gensched/kernel-source-2.6.8/Makefile 2004-09-30 15:02:53.000000000 +0200 @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 6 SUBLEVEL = 8 -EXTRAVERSION = +EXTRAVERSION = -gensched NAME=Zonked Quokka # *DOCUMENTATION* diff -urp kernel-source-2.6.8/arch/i386/Kconfig gensched/kernel-source-2.6.8/arch/i386/Kconfig --- kernel-source-2.6.8/arch/i386/Kconfig 2004-09-13 05:28:07.000000000 +0200 +++ gensched/kernel-source-2.6.8/arch/i386/Kconfig 2004-09-30 15:02:33.000000000 +0200 @@ -540,6 +540,13 @@ config PREEMPT Say Y here if you are building a kernel for a desktop, embedded or real-time system. Say N if you are unsure. +#Added by Luca +config GENERIC_SCHEDULER + bool 'Generic Scheduler' + help + Gensched hooks, for implementing generic scheduling strategies in + modules... + config X86_UP_APIC bool "Local APIC support on uniprocessors" if !SMP depends on !(X86_VISWS || X86_VOYAGER) diff -urp kernel-source-2.6.8/arch/ppc/Kconfig gensched/kernel-source-2.6.8/arch/ppc/Kconfig --- kernel-source-2.6.8/arch/ppc/Kconfig 2004-08-14 07:38:08.000000000 +0200 +++ gensched/kernel-source-2.6.8/arch/ppc/Kconfig 2004-09-30 15:02:34.000000000 +0200 @@ -808,6 +808,13 @@ config PREEMPT Say Y here if you are building a kernel for a desktop, embedded or real-time system. Say N if you are unsure. +#Added by Luca +config GENERIC_SCHEDULER + bool 'Generic Scheduler' + help + Gensched hooks, for implementing generic scheduling strategies in + modules... + config HIGHMEM bool "High memory support" diff -urp kernel-source-2.6.8/include/linux/init_task.h gensched/kernel-source-2.6.8/include/linux/init_task.h --- kernel-source-2.6.8/include/linux/init_task.h 2004-08-14 07:36:16.000000000 +0200 +++ gensched/kernel-source-2.6.8/include/linux/init_task.h 2004-09-30 15:02:34.000000000 +0200 @@ -64,6 +64,12 @@ extern struct group_info init_groups; * INIT_TASK is used to set up the first task table, touch at * your own risk!. Base=0, limit=0x1fffff (=2MB) */ +#ifdef CONFIG_GENERIC_SCHEDULER +#define DATA_INIT .private_data = NULL, +#else +#define DATA_INIT +#endif /* CONFIG_GENERIC_SCHEDULER */ + #define INIT_TASK(tsk) \ { \ .state = 0, \ @@ -112,6 +118,7 @@ extern struct group_info init_groups; .proc_lock = SPIN_LOCK_UNLOCKED, \ .switch_lock = SPIN_LOCK_UNLOCKED, \ .journal_info = NULL, \ + DATA_INIT \ } diff -urp kernel-source-2.6.8/include/linux/sched.h gensched/kernel-source-2.6.8/include/linux/sched.h --- kernel-source-2.6.8/include/linux/sched.h 2004-08-14 07:36:16.000000000 +0200 +++ gensched/kernel-source-2.6.8/include/linux/sched.h 2004-10-04 22:01:48.000000000 +0200 @@ -527,6 +527,9 @@ struct task_struct { struct mempolicy *mempolicy; short il_next; /* could be shared with used_math */ #endif +#ifdef CONFIG_GENERIC_SCHEDULER + void *private_data; +#endif /* CONFIG_GENERIC_SCHEDULER */ }; static inline pid_t process_group(struct task_struct *tsk) @@ -1060,6 +1063,20 @@ extern void recalc_sigpending(void); extern void signal_wake_up(struct task_struct *t, int resume_stopped); +#ifdef CONFIG_GENERIC_SCHEDULER +extern void (*block_hook)(struct task_struct *tsk); +extern void (*unblock_hook)(struct task_struct *tsk); +extern void (*fork_hook)(struct task_struct *tsk); +extern void (*cleanup_hook)(struct task_struct *tsk); +extern int (*setsched_hook)(pid_t pid, int policy, struct sched_param *param); +extern int (*getsched_hook)(pid_t pid, struct sched_param *param); +void gensched_dispatch(struct task_struct *p, int state); +#define GENSCHED_ENABLE 0x10 +#define GENSCHED_DISABLE 0x20 +#define DISPATCH_PRIORITY (MAX_RT_PRIO - 1) +#define INACTIVE_PRIORITY 0 +#endif /* CONFIG_GENERIC_SCHEDULER */ + /* * Wrappers for p->thread_info->cpu access. No-op on UP. */ diff -urp kernel-source-2.6.8/kernel/exit.c gensched/kernel-source-2.6.8/kernel/exit.c --- kernel-source-2.6.8/kernel/exit.c 2004-08-14 07:37:40.000000000 +0200 +++ gensched/kernel-source-2.6.8/kernel/exit.c 2004-09-30 15:04:01.000000000 +0200 @@ -32,6 +32,11 @@ extern void sem_exit (void); extern struct task_struct *child_reaper; +#ifdef CONFIG_GENERIC_SCHEDULER +static void (*cleanup_hook)(struct task_struct *tsk); +EXPORT_SYMBOL_GPL(cleanup_hook); +#endif /* CONFIG_GENERIC_SCHEDULER */ + int getrusage(struct task_struct *, int, struct rusage __user *); static void __unhash_process(struct task_struct *p) @@ -821,6 +826,14 @@ asmlinkage NORET_TYPE void do_exit(long } acct_process(code); + +#ifdef CONFIG_GENERIC_SCHEDULER + /* Is this the correct place for this hook? */ + if (cleanup_hook != NULL) { + cleanup_hook(tsk); + } +#endif + __exit_mm(tsk); exit_sem(tsk); diff -urp kernel-source-2.6.8/kernel/fork.c gensched/kernel-source-2.6.8/kernel/fork.c --- kernel-source-2.6.8/kernel/fork.c 2004-08-14 07:36:16.000000000 +0200 +++ gensched/kernel-source-2.6.8/kernel/fork.c 2004-10-21 21:36:08.000000000 +0200 @@ -44,6 +44,12 @@ #include <asm/cacheflush.h> #include <asm/tlbflush.h> + +#ifdef CONFIG_GENERIC_SCHEDULER +static void (*fork_hook)(struct task_struct *tsk); +EXPORT_SYMBOL_GPL(fork_hook); +#endif /* CONFIG_GENERIC_SCHEDULER */ + /* The idle threads do not count.. * Protected by write_lock_irq(&tasklist_lock) */ @@ -1194,7 +1200,6 @@ long do_fork(unsigned long clone_flags, p->vfork_done = &vfork; init_completion(&vfork); } - if ((p->ptrace & PT_PTRACED) || (clone_flags & CLONE_STOPPED)) { /* * We'll start up with an immediate SIGSTOP. @@ -1229,6 +1234,13 @@ long do_fork(unsigned long clone_flags, put_cpu(); } ++total_forks; +#ifdef CONFIG_GENERIC_SCHEDULER + /*FIXME: Is this the right place? */ + p->private_data = NULL; + if (fork_hook != NULL) { + fork_hook(p); + } +#endif /* CONFIG_GENERIC_SCHEDULER */ if (unlikely (trace)) { current->ptrace_message = pid; diff -urp kernel-source-2.6.8/kernel/sched.c gensched/kernel-source-2.6.8/kernel/sched.c --- kernel-source-2.6.8/kernel/sched.c 2004-08-14 07:37:38.000000000 +0200 +++ gensched/kernel-source-2.6.8/kernel/sched.c 2005-01-10 23:21:58.000000000 +0100 @@ -44,6 +44,17 @@ #include <asm/unistd.h> +#ifdef CONFIG_GENERIC_SCHEDULER +static void (*block_hook)(struct task_struct *tsk); +static void (*unblock_hook)(struct task_struct *tsk); +static int (*setsched_hook)(pid_t pid, int policy, struct sched_param *param); +static int (*getsched_hook)(pid_t pid, struct sched_param *param); +EXPORT_SYMBOL_GPL(block_hook); +EXPORT_SYMBOL_GPL(unblock_hook); +EXPORT_SYMBOL_GPL(setsched_hook); +EXPORT_SYMBOL_GPL(getsched_hook); +#endif /* CONFIG_GENERIC_SCHEDULER */ + #ifdef CONFIG_NUMA #define cpu_to_node_mask(cpu) node_to_cpumask(cpu_to_node(cpu)) #else @@ -512,6 +523,11 @@ static void deactivate_task(struct task_ rq->nr_uninterruptible++; dequeue_task(p, p->array); p->array = NULL; +#ifdef CONFIG_GENERIC_SCHEDULER + if ((block_hook != NULL) && (p->private_data != NULL)) { + block_hook(p); + } +#endif /* CONFIG_GENERIC_SCHEDULER */ } /* @@ -844,6 +860,12 @@ out_activate: } success = 1; +#ifdef CONFIG_GENERIC_SCHEDULER + p->state = TASK_RUNNING; + if ((unblock_hook != NULL) && (p->private_data != NULL)) { + unblock_hook(p); + } +#endif /* CONFIG_GENERIC_SCHEDULER */ out_running: p->state = TASK_RUNNING; out: @@ -2812,6 +2834,17 @@ out_nounlock: asmlinkage long sys_sched_setscheduler(pid_t pid, int policy, struct sched_param __user *param) { +#ifdef CONFIG_GENERIC_SCHEDULER + /* FIXME: Move in setsched!!! */ + if (setsched_hook != NULL) { + int res; + + res = setsched_hook(pid, policy, param); + if (res <= 0) { + return res; + } + } +#endif return setscheduler(pid, policy, param); } @@ -2822,6 +2855,16 @@ asmlinkage long sys_sched_setscheduler(p */ asmlinkage long sys_sched_setparam(pid_t pid, struct sched_param __user *param) { +#ifdef CONFIG_GENERIC_SCHEDULER + if (setsched_hook != NULL) { + int res; + + res = setsched_hook(pid, -1, param); + if (res <= 0) { + return res; + } + } +#endif return setscheduler(pid, -1, param); } @@ -2862,6 +2905,17 @@ asmlinkage long sys_sched_getparam(pid_t int retval = -EINVAL; task_t *p; +#ifdef CONFIG_GENERIC_SCHEDULER + /* FIXME: Move down, and pass p, not pid!!! */ + if (getsched_hook != NULL) { + int res; + + res = getsched_hook(pid, param); + if (res <= 0) { + return res; + } + } +#endif if (!param || pid < 0) goto out_nounlock; @@ -3976,6 +4030,71 @@ void __init sched_init(void) enter_lazy_tlb(&init_mm, current); } +#ifdef CONFIG_GENERIC_SCHEDULER +void gensched_dispatch(struct task_struct *p, int state) +{ +/* runqueue_t *rq; */ + prio_array_t *array; + unsigned long flags; + int oldprio; + + read_lock_irqsave(&tasklist_lock, flags); +/* rq = task_rq_lock(p, &flags); */ + + array = p->array; + if (array) { + /* deactivate_task(p, task_rq(p));*/ + /* We cannot directly call deactivate_task, because it would call the deactivation hook... */ + /*nr_running_dec(task_rq(p));*/ + task_rq(p)->nr_running--; + if (p->state == TASK_UNINTERRUPTIBLE) + task_rq(p)->nr_uninterruptible++; + dequeue_task(p, p->array); + p->array = NULL; + } else if (state == GENSCHED_ENABLE) { + printk("ERROR!!! Trying to dispatch a non-active task?\n"); + BUG(); + } + oldprio = p->prio; + if (state == GENSCHED_ENABLE) { + if (p->rt_priority != INACTIVE_PRIORITY) { + printk("ERROR!!! Trying to dispatch a task with oldprio = %lu != %d?\n", + p->rt_priority, INACTIVE_PRIORITY); + BUG(); + } + __setscheduler(p, SCHED_FIFO, DISPATCH_PRIORITY); + } else { + p->static_prio = MAX_PRIO; + __setscheduler(p, SCHED_NORMAL /*SCHED_FIFO*/, INACTIVE_PRIORITY); + } + if (array) { + /* __activate_task(p, task_rq(p)); */ + enqueue_task(p, task_rq(p)->active); + /*nr_running_inc(task_rq(p));*/ + task_rq(p)->nr_running++; + if (task_running(task_rq(p), p)) { + if (p->prio > oldprio) { + resched_task(task_rq(p)->curr); + } else { +#if 0 + printk("ERROR!!! %d < %d?\n", p->prio, oldprio); + BUG(); /* Comment the BUG out... Can happen in convert_tasks() */ +#endif + } + } else if (p->prio < task_rq(p)->curr->prio) { +#if 0 + printk("ERROR [1]!!! %d < %d?\n", p->prio, task_rq(p)->curr->prio); +#endif + resched_task(task_rq(p)->curr); + } + } + +/* task_rq_unlock(rq, &flags); */ + read_unlock_irqrestore(&tasklist_lock, flags); +} +EXPORT_SYMBOL_GPL(gensched_dispatch); +#endif /* CONFIG_GENERIC_SCHEDULER */ + #ifdef CONFIG_DEBUG_SPINLOCK_SLEEP void __might_sleep(char *file, int line) { |
From: Luca A. <lu...@us...> - 2005-01-22 12:06:34
|
Update of /cvsroot/linux-hls/hls/linux-2.6/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4892/linux-2.6/include Modified Files: data.h Log Message: 2.6 backend update... Still doesn't work, but it looks better ;-) Index: data.h =================================================================== RCS file: /cvsroot/linux-hls/hls/linux-2.6/include/data.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** data.h 4 Apr 2004 20:31:24 -0000 1.1 --- data.h 22 Jan 2005 12:06:25 -0000 1.2 *************** *** 27,37 **** #define HLS_FASTCALL ! /* Linux Real-Time priorities go from 0 to 99 */ ! #define HLS_SCHEDULING_PRIORITY 100 ! /* The priority is computed as 1000 + rt_priority... ! * with rp_priority = -2000, it results -1000 ! * and the task will never be scheduled ! */ ! #define HLS_IDLE_PRIORITY -2000 typedef enum _HLS_CTL_COMMAND { --- 27,32 ---- #define HLS_FASTCALL ! #define HLS_SCHEDULING_PRIORITY DISPATCH_PRIORITY ! #define HLS_IDLE_PRIORITY INACTIVE_PRIORITY typedef enum _HLS_CTL_COMMAND { |
From: Luca A. <lu...@us...> - 2005-01-22 12:06:33
|
Update of /cvsroot/linux-hls/hls/hls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4892/hls Modified Files: hls_hooks.c Log Message: 2.6 backend update... Still doesn't work, but it looks better ;-) Index: hls_hooks.c =================================================================== RCS file: /cvsroot/linux-hls/hls/hls/hls_hooks.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** hls_hooks.c 2 Nov 2004 07:39:28 -0000 1.9 --- hls_hooks.c 22 Jan 2005 12:06:24 -0000 1.10 *************** *** 171,182 **** #else if (t->InState != HLS_Waiting) { - BUG_ON(t->InState != HLS_Waiting); /* FIXME: This stuff is arch-dependent!!! */ /* maybe we should provide some TH_STATE() and TH_ID() macros ? */ hls_hard_printk("HLS ERROR!!! UnBlockThreadHook on task %d (state %ld) with InState = %x!!!\n", Thread->pid, Thread->state, t->InState); hls_printk("HLS ERROR!!! UnBlockThreadHook on task %d (state %ld) with InState = %x!!!\n", Thread->pid, Thread->state, t->InState); } #endif ! #if 1 BUG_ON(t->vp->State != VP_Waiting); HLS_ASSERT (t->vp->State == VP_Waiting); --- 171,185 ---- #else if (t->InState != HLS_Waiting) { /* FIXME: This stuff is arch-dependent!!! */ /* maybe we should provide some TH_STATE() and TH_ID() macros ? */ hls_hard_printk("HLS ERROR!!! UnBlockThreadHook on task %d (state %ld) with InState = %x!!!\n", Thread->pid, Thread->state, t->InState); hls_printk("HLS ERROR!!! UnBlockThreadHook on task %d (state %ld) with InState = %x!!!\n", Thread->pid, Thread->state, t->InState); + #if 0 /* FIXME: This is Linux-2.6 specific!!! */ + dump_stack(); + #endif + whereami = 0; return; } #endif ! #if 0 BUG_ON(t->vp->State != VP_Waiting); HLS_ASSERT (t->vp->State == VP_Waiting); *************** *** 187,190 **** --- 190,196 ---- hls_hard_printk("HLS ERROR!!! UnBlockThreadHook on task %d (state %ld) with vp->State = %x!!!\n", Thread->pid, Thread->state, t->vp->State); hls_printk("HLS ERROR!!! UnBlockThreadHook on task %d (state %ld) with vp->State = %x!!!\n", Thread->pid, Thread->state, t->vp->State); + #if 0 /* FIXME: This is Linux-2.6 specific!!! */ + dump_stack(); + #endif } #endif |
From: Luca A. <lu...@us...> - 2004-11-02 07:39:38
|
Update of /cvsroot/linux-hls/hls/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5235/tests Modified Files: ppc-rdtsc.h Log Message: - Update the 2.6 backend... Now it inserts without big crashes, but still does not work Check if it breaks 2.4 (there is a pre_26 tag) Index: ppc-rdtsc.h =================================================================== RCS file: /cvsroot/linux-hls/hls/tests/ppc-rdtsc.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ppc-rdtsc.h 27 Aug 2002 11:26:20 -0000 1.1.1.1 --- ppc-rdtsc.h 2 Nov 2004 07:39:29 -0000 1.2 *************** *** 6,14 **** unsigned long chk; ! __asm__ __volatile__ ("1: mftbu %0; ! mftb %1; ! mftbu %2; ! cmpw %2, %0; ! bne 1b" : "=r" (((unsigned long int *)&ts)[0]), "=r" (((unsigned long int *)&ts)[1]), "=r" (chk)); --- 6,14 ---- unsigned long chk; ! __asm__ __volatile__ ("1: mftbu %0;\n\t" ! " mftb %1;\n\t" ! " mftbu %2;\n\t" ! " cmpw %2, %0;\n\t" ! " bne 1b" : "=r" (((unsigned long int *)&ts)[0]), "=r" (((unsigned long int *)&ts)[1]), "=r" (chk)); |
From: Luca A. <lu...@us...> - 2004-11-02 07:39:38
|
Update of /cvsroot/linux-hls/hls/linux-2.6 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5235/linux-2.6 Modified Files: Makefile bottom.c init.c Log Message: - Update the 2.6 backend... Now it inserts without big crashes, but still does not work Check if it breaks 2.4 (there is a pre_26 tag) Index: init.c =================================================================== RCS file: /cvsroot/linux-hls/hls/linux-2.6/init.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** init.c 9 Oct 2004 10:26:56 -0000 1.2 --- init.c 2 Nov 2004 07:39:29 -0000 1.3 *************** *** 86,90 **** } - read_lock(&tasklist_lock); do_each_thread(dummy, t) { #ifdef __FP_DEAMONS__ --- 86,89 ---- *************** *** 130,134 **** #endif } while_each_thread(dummy, t); - read_unlock(&tasklist_lock); } --- 129,132 ---- *************** *** 138,142 **** t = current; - read_lock(&tasklist_lock); do_each_thread(dummy, t) { if (t->private_data != NULL) { --- 136,139 ---- *************** *** 153,157 **** } } while_each_thread(dummy, t); - read_unlock(&tasklist_lock); } --- 150,153 ---- Index: bottom.c =================================================================== RCS file: /cvsroot/linux-hls/hls/linux-2.6/bottom.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** bottom.c 9 Oct 2004 10:26:56 -0000 1.2 --- bottom.c 2 Nov 2004 07:39:29 -0000 1.3 *************** *** 100,103 **** --- 100,104 ---- printk("HLS ERROR: Trying to schedule %d with state = %ld\n", t->pid, t->state); + BUG(); } } *************** *** 177,181 **** hls_printk("HLS parameter is: 0x%lx\n", (unsigned long int)t->hls); #endif ! if (t->state != TASK_UNINTERRUPTIBLE) { printk("HLS ERROR: Creating task with unexpected state: %ld\n", t->state); hls_printk("HLS ERROR: Creating task with unexpected state: %ld\n", t->state); --- 178,182 ---- hls_printk("HLS parameter is: 0x%lx\n", (unsigned long int)t->hls); #endif ! if (t->state != TASK_RUNNING) { printk("HLS ERROR: Creating task with unexpected state: %ld\n", t->state); hls_printk("HLS ERROR: Creating task with unexpected state: %ld\n", t->state); *************** *** 229,233 **** active = 0; - read_lock(&tasklist_lock); do_each_thread(dummy, t) { #ifdef VERBOSE1 --- 230,233 ---- *************** *** 260,264 **** #endif } while_each_thread(dummy, t); - read_unlock(&tasklist_lock); #if 0 if (active > 1) { --- 260,263 ---- Index: Makefile =================================================================== RCS file: /cvsroot/linux-hls/hls/linux-2.6/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile 9 Oct 2004 10:26:56 -0000 1.2 --- Makefile 2 Nov 2004 07:39:29 -0000 1.3 *************** *** 10,14 **** HLS = $(SUBDIRS)/.. HLS = $(M)/.. ! EXTRA_CFLAGS += -D__HARD_PANIC__ -I $(HLS)/hls/include -I $(HLS)/linux-2.6/include ifdef DEBUG --- 10,15 ---- HLS = $(SUBDIRS)/.. HLS = $(M)/.. ! #EXTRA_CFLAGS += -D__HARD_PANIC__ -I $(HLS)/hls/include -I $(HLS)/linux-2.6/include ! EXTRA_CFLAGS += -D__HARD_PANIC__ -g -I $(HLS)/hls/include -I $(HLS)/linux-2.6/include ifdef DEBUG |
From: Luca A. <lu...@us...> - 2004-11-02 07:39:38
|
Update of /cvsroot/linux-hls/hls/hls/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5235/hls/include Modified Files: hls_debug.h Log Message: - Update the 2.6 backend... Now it inserts without big crashes, but still does not work Check if it breaks 2.4 (there is a pre_26 tag) Index: hls_debug.h =================================================================== RCS file: /cvsroot/linux-hls/hls/hls/include/hls_debug.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** hls_debug.h 13 Dec 2003 12:27:15 -0000 1.3 --- hls_debug.h 2 Nov 2004 07:39:29 -0000 1.4 *************** *** 53,57 **** hls_printk ("%s:%d: failed HLS assertion: \"%s\".\n", file, line, assertion); ! #if __HARD_PANIC__ hls_panic(assertion); #else --- 53,57 ---- hls_printk ("%s:%d: failed HLS assertion: \"%s\".\n", file, line, assertion); ! #ifdef __HARD_PANIC__ hls_panic(assertion); #else |
From: Luca A. <lu...@us...> - 2004-11-02 07:39:37
|
Update of /cvsroot/linux-hls/hls/hls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5235/hls Modified Files: hls_hooks.c hls_sched_th.c Log Message: - Update the 2.6 backend... Now it inserts without big crashes, but still does not work Check if it breaks 2.4 (there is a pre_26 tag) Index: hls_hooks.c =================================================================== RCS file: /cvsroot/linux-hls/hls/hls/hls_hooks.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** hls_hooks.c 29 Nov 2003 11:59:00 -0000 1.8 --- hls_hooks.c 2 Nov 2004 07:39:28 -0000 1.9 *************** *** 56,60 **** HLS_ASSERT (HLSInitState == 1); ! HLS_ASSERT ((State == TASK_UNINTERRUPTIBLE) || (State == TASK_INTERRUPTIBLE)); HLS_ASSERT (Thread); #ifdef HLS_DEBUG --- 56,60 ---- HLS_ASSERT (HLSInitState == 1); ! /* this is only valid for 2.4... HLS_ASSERT ((State == TASK_UNINTERRUPTIBLE) || (State == TASK_INTERRUPTIBLE)); */ HLS_ASSERT (Thread); #ifdef HLS_DEBUG *************** *** 113,117 **** --- 113,119 ---- case VP_Waiting: /* Thread->state = TASK_UNINTERRUPTIBLE;*/ + #if 0 Thread->state = State; + #endif Th->InState = HLS_Waiting; break; *************** *** 127,130 **** --- 129,133 ---- case VP_Running: HLS_ASSERT (Th->vp->Proc != NO_PROC); + Th->InState = HLS_Ready; break; default: *************** *** 168,171 **** --- 171,175 ---- #else if (t->InState != HLS_Waiting) { + BUG_ON(t->InState != HLS_Waiting); /* FIXME: This stuff is arch-dependent!!! */ /* maybe we should provide some TH_STATE() and TH_ID() macros ? */ *************** *** 174,178 **** } #endif ! #if 0 HLS_ASSERT (t->vp->State == VP_Waiting); #else --- 178,183 ---- } #endif ! #if 1 ! BUG_ON(t->vp->State != VP_Waiting); HLS_ASSERT (t->vp->State == VP_Waiting); #else *************** *** 334,337 **** --- 339,343 ---- } + whereami = 15; #ifdef HLS_DEBUG HLSChangeFlag = HLS_CNT; *************** *** 342,345 **** --- 348,354 ---- t = HLSFindThread (Thread); HLS_ASSERT (t); + HLS_ASSERT (t->vp); + HLS_ASSERT (t->vp->TopSched); + HLS_ASSERT (t->vp->TopSched->CB); /* FIXME: What to do here? */ *************** *** 356,364 **** } #endif if (t->InState != HLS_Ready) { hls_hard_printk("HYPERERROR!!! Strange internal state [%d]: %x\n", Thread->pid, t->InState); ! hls_printk("HYPERERROR!!! Strange internal state [%d]: %x\n", Thread->pid, t->InState); } t->InState = HLS_Waiting; t->vp->TopSched->CB->B_VP_Release (t->vp); --- 365,376 ---- } #endif + whereami = 25; if (t->InState != HLS_Ready) { hls_hard_printk("HYPERERROR!!! Strange internal state [%d]: %x\n", Thread->pid, t->InState); ! WARN_ON(t->InState != HLS_Ready); ! // hls_printk("HYPERERROR!!! Strange internal state [%d]: %x\n", Thread->pid, t->InState); } + whereami = 35; t->InState = HLS_Waiting; t->vp->TopSched->CB->B_VP_Release (t->vp); Index: hls_sched_th.c =================================================================== RCS file: /cvsroot/linux-hls/hls/hls/hls_sched_th.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** hls_sched_th.c 9 Oct 2004 10:26:55 -0000 1.8 --- hls_sched_th.c 2 Nov 2004 07:39:28 -0000 1.9 *************** *** 237,240 **** --- 237,241 ---- switch (body->State) { case TASK_RUNNING: + Inst->vp->State = VP_Waiting; Inst->vp->TopSched->CB->B_VP_Request (Inst->vp); break; |
From: Luca A. <lu...@us...> - 2004-10-09 10:27:39
|
Update of /cvsroot/linux-hls/hls/linux-2.6 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27996/linux-2.6 Modified Files: Makefile bottom.c hls_ctl.c init.c Log Message: - Commit the 2.6 gensched patch - Update the linux-2.6 dir (compiles and inserts, but crashes) Index: init.c =================================================================== RCS file: /cvsroot/linux-hls/hls/linux-2.6/init.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** init.c 4 Apr 2004 20:31:24 -0000 1.1 --- init.c 9 Oct 2004 10:26:56 -0000 1.2 *************** *** 64,69 **** --- 64,73 ---- t = current; if (t->private_data == NULL) { + #if 0 t->policy = SCHED_FIFO; t->rt_priority = HLS_IDLE_PRIORITY; + #else + gensched_dispatch(t, GENSCHED_DISABLE); + #endif if ((t->state == TASK_INTERRUPTIBLE) || (t->state == TASK_UNINTERRUPTIBLE)) { HLSCreateThreadHook(t, t->state); *************** *** 98,103 **** #endif if (t->private_data == NULL) { ! t->policy = SCHED_FIFO; ! t->rt_priority = HLS_IDLE_PRIORITY; if ((t->state == TASK_INTERRUPTIBLE) || (t->state == TASK_UNINTERRUPTIBLE)) { HLSCreateThreadHook(t, t->state); --- 102,111 ---- #endif if (t->private_data == NULL) { ! #if 0 ! t->policy = SCHED_FIFO; ! t->rt_priority = HLS_IDLE_PRIORITY; ! #else ! gensched_dispatch(t, GENSCHED_DISABLE); ! #endif if ((t->state == TASK_INTERRUPTIBLE) || (t->state == TASK_UNINTERRUPTIBLE)) { HLSCreateThreadHook(t, t->state); Index: bottom.c =================================================================== RCS file: /cvsroot/linux-hls/hls/linux-2.6/bottom.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** bottom.c 4 Apr 2004 20:31:24 -0000 1.1 --- bottom.c 9 Oct 2004 10:26:56 -0000 1.2 *************** *** 52,55 **** --- 52,56 ---- c = my_current[proc]; + #if 0 #ifdef VERBOSE hls_printk("setting %d to %d... ", current->pid, HLS_IDLE_PRIORITY); *************** *** 59,72 **** c->pid, c->rt_priority, HLS_SCHEDULING_PRIORITY); } /* Must be implemented in some way... */ ! #error TODO: Do something smart, here!!! ! c->rt_priority = HLS_IDLE_PRIORITY; ! c->prio = MAX_PRIO; ! array = c->array; ! array->nr_active--; ! list_del(&c->run_list); ! if (list_empty(array->queue + c->prio)) ! __clear_bit(c->prio, array->bitmap); ! } else { #ifdef VERBOSE hls_printk("HLS From idle...\n"); --- 60,66 ---- c->pid, c->rt_priority, HLS_SCHEDULING_PRIORITY); } + #endif /* Must be implemented in some way... */ ! gensched_dispatch(c, GENSCHED_DISABLE); #ifdef VERBOSE hls_printk("HLS From idle...\n"); *************** *** 89,110 **** * The linux dispatcher will do the dirty work for us... */ ! t->rt_priority = HLS_SCHEDULING_PRIORITY; HLSProc[proc].CurrentThread = t->private_data; - c->prio = 0; - /* FIXME! */ - repeat_lock_task: - local_irq_save(rq_flags); - rq = task_rq(c); - spin_lock(&rq->lock); - if (unlikely(rq != task_rq(p))) { - spin_unlock_irqrestore(&rq->lock, rq_flags); - goto repeat_lock_task; - } - array = rq->active; - list_add_tail(&c->run_list, array->queue + c->prio); - __set_bit(c->prio, array->bitmap); - array->nr_active++; - c->array = array; - wup = t->pid; --- 83,88 ---- * The linux dispatcher will do the dirty work for us... */ ! gensched_dispatch(t, GENSCHED_ENABLE); HLSProc[proc].CurrentThread = t->private_data; wup = t->pid; *************** *** 204,209 **** --- 182,191 ---- return; } + #if 0 t->policy = SCHED_FIFO; t->rt_priority = HLS_IDLE_PRIORITY; + #else + gensched_dispatch(t, GENSCHED_DISABLE); + #endif HLSCreateThreadHook(t, t->state); Index: hls_ctl.c =================================================================== RCS file: /cvsroot/linux-hls/hls/linux-2.6/hls_ctl.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** hls_ctl.c 4 Apr 2004 20:31:24 -0000 1.1 --- hls_ctl.c 9 Oct 2004 10:26:56 -0000 1.2 *************** *** 51,54 **** --- 51,55 ---- } + #if 0 /* FIXME: Unused??? */ static int hls_null_msg(PRKTHREAD t) { *************** *** 78,81 **** --- 79,83 ---- return status; } + #endif static int hls_thread_move(PRKTHREAD t, struct HLS_SCHED_INSTANCE *new_sched) Index: Makefile =================================================================== RCS file: /cvsroot/linux-hls/hls/linux-2.6/Makefile,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile 4 Apr 2004 20:31:24 -0000 1.1 --- Makefile 9 Oct 2004 10:26:56 -0000 1.2 *************** *** 9,13 **** HLS = /root/src/NewGenSched/hls HLS = $(SUBDIRS)/.. ! EXTRA_CFLAGS += -I $(HLS)/hls/include -I $(HLS)/linux/include ifdef DEBUG --- 9,14 ---- HLS = /root/src/NewGenSched/hls HLS = $(SUBDIRS)/.. ! HLS = $(M)/.. ! EXTRA_CFLAGS += -D__HARD_PANIC__ -I $(HLS)/hls/include -I $(HLS)/linux-2.6/include ifdef DEBUG *************** *** 24,30 **** endif ! ifndef MULDIV ! OBJS += div.o ! else EXTRA_CFLAGS += -D__MULDIV__ endif --- 25,29 ---- endif ! ifdef MULDIV EXTRA_CFLAGS += -D__MULDIV__ endif |
From: Luca A. <lu...@us...> - 2004-10-09 10:27:12
|
Update of /cvsroot/linux-hls/hls/patches In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27996/patches Added Files: gensched2-2.6.8.patch tsc-2.6.8.patch Log Message: - Commit the 2.6 gensched patch - Update the linux-2.6 dir (compiles and inserts, but crashes) --- NEW FILE: gensched2-2.6.8.patch --- diff -urp kernel-source-2.6.8/Makefile gensched/kernel-source-2.6.8/Makefile --- kernel-source-2.6.8/Makefile 2004-09-13 05:28:07.000000000 +0200 +++ gensched/kernel-source-2.6.8/Makefile 2004-09-30 15:02:53.000000000 +0200 @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 6 SUBLEVEL = 8 -EXTRAVERSION = +EXTRAVERSION = -gensched NAME=Zonked Quokka # *DOCUMENTATION* diff -urp kernel-source-2.6.8/arch/i386/Kconfig gensched/kernel-source-2.6.8/arch/i386/Kconfig --- kernel-source-2.6.8/arch/i386/Kconfig 2004-09-13 05:28:07.000000000 +0200 +++ gensched/kernel-source-2.6.8/arch/i386/Kconfig 2004-09-30 15:02:33.000000000 +0200 @@ -540,6 +540,13 @@ config PREEMPT Say Y here if you are building a kernel for a desktop, embedded or real-time system. Say N if you are unsure. +#Added by Luca +config GENERIC_SCHEDULER + bool 'Generic Scheduler' + help + Gensched hooks, for implementing generic scheduling strategies in + modules... + config X86_UP_APIC bool "Local APIC support on uniprocessors" if !SMP depends on !(X86_VISWS || X86_VOYAGER) diff -urp kernel-source-2.6.8/arch/ppc/Kconfig gensched/kernel-source-2.6.8/arch/ppc/Kconfig --- kernel-source-2.6.8/arch/ppc/Kconfig 2004-08-14 07:38:08.000000000 +0200 +++ gensched/kernel-source-2.6.8/arch/ppc/Kconfig 2004-09-30 15:02:34.000000000 +0200 @@ -808,6 +808,13 @@ config PREEMPT Say Y here if you are building a kernel for a desktop, embedded or real-time system. Say N if you are unsure. +#Added by Luca +config GENERIC_SCHEDULER + bool 'Generic Scheduler' + help + Gensched hooks, for implementing generic scheduling strategies in + modules... + config HIGHMEM bool "High memory support" diff -urp kernel-source-2.6.8/include/linux/init_task.h gensched/kernel-source-2.6.8/include/linux/init_task.h --- kernel-source-2.6.8/include/linux/init_task.h 2004-08-14 07:36:16.000000000 +0200 +++ gensched/kernel-source-2.6.8/include/linux/init_task.h 2004-09-30 15:02:34.000000000 +0200 @@ -64,6 +64,12 @@ extern struct group_info init_groups; * INIT_TASK is used to set up the first task table, touch at * your own risk!. Base=0, limit=0x1fffff (=2MB) */ +#ifdef CONFIG_GENERIC_SCHEDULER +#define DATA_INIT .private_data = NULL, +#else +#define DATA_INIT +#endif /* CONFIG_GENERIC_SCHEDULER */ + #define INIT_TASK(tsk) \ { \ .state = 0, \ @@ -112,6 +118,7 @@ extern struct group_info init_groups; .proc_lock = SPIN_LOCK_UNLOCKED, \ .switch_lock = SPIN_LOCK_UNLOCKED, \ .journal_info = NULL, \ + DATA_INIT \ } diff -urp kernel-source-2.6.8/include/linux/sched.h gensched/kernel-source-2.6.8/include/linux/sched.h --- kernel-source-2.6.8/include/linux/sched.h 2004-08-14 07:36:16.000000000 +0200 +++ gensched/kernel-source-2.6.8/include/linux/sched.h 2004-10-04 22:01:48.000000000 +0200 @@ -527,6 +527,9 @@ struct task_struct { struct mempolicy *mempolicy; short il_next; /* could be shared with used_math */ #endif +#ifdef CONFIG_GENERIC_SCHEDULER + void *private_data; +#endif /* CONFIG_GENERIC_SCHEDULER */ }; static inline pid_t process_group(struct task_struct *tsk) @@ -1060,6 +1063,20 @@ extern void recalc_sigpending(void); extern void signal_wake_up(struct task_struct *t, int resume_stopped); +#ifdef CONFIG_GENERIC_SCHEDULER +extern void (*block_hook)(struct task_struct *tsk); +extern void (*unblock_hook)(struct task_struct *tsk); +extern void (*fork_hook)(struct task_struct *tsk); +extern void (*cleanup_hook)(struct task_struct *tsk); +extern int (*setsched_hook)(pid_t pid, int policy, struct sched_param *param); +extern int (*getsched_hook)(pid_t pid, struct sched_param *param); +void gensched_dispatch(struct task_struct *p, int state); +#define GENSCHED_ENABLE 0x10 +#define GENSCHED_DISABLE 0x20 +#define DISPATCH_PRIORITY (MAX_RT_PRIO - 1) +#define INACTIVE_PRIORITY 0 +#endif /* CONFIG_GENERIC_SCHEDULER */ + /* * Wrappers for p->thread_info->cpu access. No-op on UP. */ diff -urp kernel-source-2.6.8/kernel/exit.c gensched/kernel-source-2.6.8/kernel/exit.c --- kernel-source-2.6.8/kernel/exit.c 2004-08-14 07:37:40.000000000 +0200 +++ gensched/kernel-source-2.6.8/kernel/exit.c 2004-09-30 15:04:01.000000000 +0200 @@ -32,6 +32,11 @@ extern void sem_exit (void); extern struct task_struct *child_reaper; +#ifdef CONFIG_GENERIC_SCHEDULER +static void (*cleanup_hook)(struct task_struct *tsk); +EXPORT_SYMBOL_GPL(cleanup_hook); +#endif /* CONFIG_GENERIC_SCHEDULER */ + int getrusage(struct task_struct *, int, struct rusage __user *); static void __unhash_process(struct task_struct *p) @@ -821,6 +826,14 @@ asmlinkage NORET_TYPE void do_exit(long } acct_process(code); + +#ifdef CONFIG_GENERIC_SCHEDULER + /* Is this the correct place for this hook? */ + if (cleanup_hook != NULL) { + cleanup_hook(tsk); + } +#endif + __exit_mm(tsk); exit_sem(tsk); diff -urp kernel-source-2.6.8/kernel/fork.c gensched/kernel-source-2.6.8/kernel/fork.c --- kernel-source-2.6.8/kernel/fork.c 2004-08-14 07:36:16.000000000 +0200 +++ gensched/kernel-source-2.6.8/kernel/fork.c 2004-09-30 15:02:34.000000000 +0200 @@ -44,6 +44,12 @@ #include <asm/cacheflush.h> #include <asm/tlbflush.h> + +#ifdef CONFIG_GENERIC_SCHEDULER +static void (*fork_hook)(struct task_struct *tsk); +EXPORT_SYMBOL_GPL(fork_hook); +#endif /* CONFIG_GENERIC_SCHEDULER */ + /* The idle threads do not count.. * Protected by write_lock_irq(&tasklist_lock) */ @@ -1194,7 +1200,13 @@ long do_fork(unsigned long clone_flags, p->vfork_done = &vfork; init_completion(&vfork); } - +#ifdef CONFIG_GENERIC_SCHEDULER + /*FIXME: Is this the right place? */ + p->private_data = NULL; + if (fork_hook != NULL) { + fork_hook(p); + } +#endif /* CONFIG_GENERIC_SCHEDULER */ if ((p->ptrace & PT_PTRACED) || (clone_flags & CLONE_STOPPED)) { /* * We'll start up with an immediate SIGSTOP. diff -urp kernel-source-2.6.8/kernel/sched.c gensched/kernel-source-2.6.8/kernel/sched.c --- kernel-source-2.6.8/kernel/sched.c 2004-08-14 07:37:38.000000000 +0200 +++ gensched/kernel-source-2.6.8/kernel/sched.c 2004-10-07 07:36:35.000000000 +0200 @@ -44,6 +44,17 @@ #include <asm/unistd.h> +#ifdef CONFIG_GENERIC_SCHEDULER +static void (*block_hook)(struct task_struct *tsk); +static void (*unblock_hook)(struct task_struct *tsk); +static int (*setsched_hook)(pid_t pid, int policy, struct sched_param *param); +static int (*getsched_hook)(pid_t pid, struct sched_param *param); +EXPORT_SYMBOL_GPL(block_hook); +EXPORT_SYMBOL_GPL(unblock_hook); +EXPORT_SYMBOL_GPL(setsched_hook); +EXPORT_SYMBOL_GPL(getsched_hook); +#endif /* CONFIG_GENERIC_SCHEDULER */ + #ifdef CONFIG_NUMA #define cpu_to_node_mask(cpu) node_to_cpumask(cpu_to_node(cpu)) #else @@ -368,6 +379,11 @@ static inline void __activate_task(task_ { enqueue_task(p, rq->active); rq->nr_running++; +#ifdef CONFIG_GENERIC_SCHEDULER + if ((unblock_hook != NULL) && (p->private_data != NULL)) { + unblock_hook(p); + } +#endif /* CONFIG_GENERIC_SCHEDULER */ } /* @@ -512,6 +528,11 @@ static void deactivate_task(struct task_ rq->nr_uninterruptible++; dequeue_task(p, p->array); p->array = NULL; +#ifdef CONFIG_GENERIC_SCHEDULER + if ((block_hook != NULL) && (p->private_data != NULL)) { + block_hook(p); + } +#endif /* CONFIG_GENERIC_SCHEDULER */ } /* @@ -2812,6 +2833,17 @@ out_nounlock: asmlinkage long sys_sched_setscheduler(pid_t pid, int policy, struct sched_param __user *param) { +#ifdef CONFIG_GENERIC_SCHEDULER + /* FIXME: Move in setsched!!! */ + if (setsched_hook != NULL) { + int res; + + res = setsched_hook(pid, policy, param); + if (res <= 0) { + return res; + } + } +#endif return setscheduler(pid, policy, param); } @@ -2822,6 +2854,16 @@ asmlinkage long sys_sched_setscheduler(p */ asmlinkage long sys_sched_setparam(pid_t pid, struct sched_param __user *param) { +#ifdef CONFIG_GENERIC_SCHEDULER + if (setsched_hook != NULL) { + int res; + + res = setsched_hook(pid, -1, param); + if (res <= 0) { + return res; + } + } +#endif return setscheduler(pid, -1, param); } @@ -2862,6 +2904,17 @@ asmlinkage long sys_sched_getparam(pid_t int retval = -EINVAL; task_t *p; +#ifdef CONFIG_GENERIC_SCHEDULER + /* FIXME: Move down, and pass p, not pid!!! */ + if (getsched_hook != NULL) { + int res; + + res = getsched_hook(pid, param); + if (res <= 0) { + return res; + } + } +#endif if (!param || pid < 0) goto out_nounlock; @@ -3976,6 +4029,70 @@ void __init sched_init(void) enter_lazy_tlb(&init_mm, current); } +#ifdef CONFIG_GENERIC_SCHEDULER +void gensched_dispatch(struct task_struct *p, int state) +{ + runqueue_t *rq; + prio_array_t *array; + unsigned long flags; + int oldprio; + + read_lock_irq(&tasklist_lock); + rq = task_rq_lock(p, &flags); + + array = p->array; + if (array) { + /* deactivate_task(p, task_rq(p));*/ + /* We cannot directly call deactivate_task, because it would call the deactivation hook... */ + /*nr_running_dec(task_rq(p));*/ + task_rq(p)->nr_running--; + if (p->state == TASK_UNINTERRUPTIBLE) + task_rq(p)->nr_uninterruptible++; + dequeue_task(p, p->array); + p->array = NULL; + } else if (state == GENSCHED_ENABLE) { + printk("ERROR!!! Trying to dispatch a non-active task?\n"); + BUG(); + } + oldprio = p->prio; + if (state == GENSCHED_ENABLE) { + if (p->rt_priority != INACTIVE_PRIORITY) { + printk("ERROR!!! Trying to dispatch a task with oldprio = %d != %d?\n", + p->rt_priority, INACTIVE_PRIORITY); + BUG(); + } + __setscheduler(p, SCHED_FIFO, DISPATCH_PRIORITY); + } else { + __setscheduler(p, SCHED_FIFO, INACTIVE_PRIORITY); + } + if (array) { + /* __activate_task(p, task_rq(p)); */ + enqueue_task(p, task_rq(p)->active); + /*nr_running_inc(task_rq(p));*/ + task_rq(p)->nr_running++; + if (task_running(rq, p)) { + if (p->prio > oldprio) { + resched_task(rq->curr); + } else { +#if 0 + printk("ERROR!!! %d < %d?\n", p->prio, oldprio); + BUG(); /* Comment the BUG out... Can happen in convert_tasks() */ +#endif + } + } else if (p->prio < rq->curr->prio) { +#if 0 + printk("ERROR [1]!!! %d < %d?\n", p->prio, rq->curr->prio); +#endif + resched_task(rq->curr); + } + } + + task_rq_unlock(rq, &flags); + read_unlock_irq(&tasklist_lock); +} +EXPORT_SYMBOL_GPL(gensched_dispatch); +#endif /* CONFIG_GENERIC_SCHEDULER */ + #ifdef CONFIG_DEBUG_SPINLOCK_SLEEP void __might_sleep(char *file, int line) { --- NEW FILE: tsc-2.6.8.patch --- diff -urp kernel-source-2.6.8/arch/i386/kernel/i386_ksyms.c gensched/kernel-source-2.6.8/arch/i386/kernel/i386_ksyms.c --- kernel-source-2.6.8/arch/i386/kernel/i386_ksyms.c 2004-08-14 07:38:09.000000000 +0200 +++ gensched/kernel-source-2.6.8/arch/i386/kernel/i386_ksyms.c 2004-09-30 15:02:34.000000000 +0200 @@ -36,6 +36,13 @@ extern void dump_thread(struct pt_regs *, struct user *); extern spinlock_t rtc_lock; +#ifdef CONFIG_GENERIC_SCHEDULER +extern unsigned long fast_gettimeoffset_quotient; +extern unsigned long cpu_khz; +EXPORT_SYMBOL_GPL(cpu_khz); +EXPORT_SYMBOL_GPL(fast_gettimeoffset_quotient); +#endif /* CONFIG_GENERIC_SCHEDULER */ + /* This is definitely a GPL-only symbol */ EXPORT_SYMBOL_GPL(cpu_gdt_table); diff -urp kernel-source-2.6.8/arch/ppc/kernel/time.c gensched/kernel-source-2.6.8/arch/ppc/kernel/time.c --- kernel-source-2.6.8/arch/ppc/kernel/time.c 2004-08-14 07:37:38.000000000 +0200 +++ gensched/kernel-source-2.6.8/arch/ppc/kernel/time.c 2004-09-30 15:02:34.000000000 +0200 @@ -95,6 +95,10 @@ spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED EXPORT_SYMBOL(rtc_lock); +#ifdef CONFIG_GENERIC_SCHEDULER +EXPORT_SYMBOL_GPL(tb_to_us); +#endif + /* Timer interrupt helper function */ static inline int tb_delta(unsigned *jiffy_stamp) { int delta; |
From: Luca A. <lu...@us...> - 2004-10-09 10:27:12
|
Update of /cvsroot/linux-hls/hls/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27996/scripts Added Files: compile_monolithic-2.6 Log Message: - Commit the 2.6 gensched patch - Update the linux-2.6 dir (compiles and inserts, but crashes) --- NEW FILE: compile_monolithic-2.6 --- make -C /home/luca/src/tmp/kernel-source-2.6.8 M=/home/luca/src/hls/linux-2.6 modules CLI=1 MULDIV=1 INT_SCHED=1 CREATE=1 |
From: Luca A. <lu...@us...> - 2004-10-09 10:27:11
|
Update of /cvsroot/linux-hls/hls/hls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27996/hls Modified Files: hls_init.c hls_sched_th.c Log Message: - Commit the 2.6 gensched patch - Update the linux-2.6 dir (compiles and inserts, but crashes) Index: hls_init.c =================================================================== RCS file: /cvsroot/linux-hls/hls/hls/hls_init.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** hls_init.c 13 Dec 2003 12:27:15 -0000 1.1 --- hls_init.c 9 Oct 2004 10:26:55 -0000 1.2 *************** *** 40,43 **** --- 40,44 ---- } + #ifdef __INTERNAL_SCHEDULERS__ static void CreateSimpleHierarchy (void) { *************** *** 83,86 **** --- 84,88 ---- #endif } + #endif void HLSInit (void) Index: hls_sched_th.c =================================================================== RCS file: /cvsroot/linux-hls/hls/hls/hls_sched_th.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** hls_sched_th.c 8 Nov 2003 10:34:31 -0000 1.7 --- hls_sched_th.c 9 Oct 2004 10:26:55 -0000 1.8 *************** *** 197,201 **** /* FIXME: This field is arch dependent! */ /* ((PKTHREAD)body->Thread)->private_data = (void *)Inst; */ ! HLS_DATA((PKTHREAD)body->Thread) = (void *)Inst; Inst->vp->BottomSched = body->Self; --- 197,201 ---- /* FIXME: This field is arch dependent! */ /* ((PKTHREAD)body->Thread)->private_data = (void *)Inst; */ ! HLS_DATA(body->Thread) = (void *)Inst; Inst->vp->BottomSched = body->Self; *************** *** 271,274 **** --- 271,275 ---- #ifdef HLS_DEBUG + #if 0 /* Still have to understand what to do here... */ static struct TH_INSTANCE_DATA *SItoID (struct HLS_SCHED_INSTANCE *si) { *************** *** 278,282 **** } - #if 0 /* Still have to understand what to do here... */ static int ThreadCurrentCount (PRKTHREAD Thread) { --- 279,282 ---- |
From: Luca A. <lu...@us...> - 2004-08-21 13:54:21
|
Update of /cvsroot/linux-hls/qosman/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6861/src Modified Files: srv-ks.c Log Message: Update to the new gensched interface Index: srv-ks.c =================================================================== RCS file: /cvsroot/linux-hls/qosman/src/srv-ks.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** srv-ks.c 9 Apr 2004 13:39:57 -0000 1.2 --- srv-ks.c 21 Aug 2004 13:54:09 -0000 1.3 *************** *** 125,128 **** --- 125,129 ---- int pid; struct qtask_global *p; + struct task_struct *t; /* struct sched_param sp; *************** *** 147,155 **** return; } if (p->valid == PERIOD_CHANGED) { ! cbs_get_params(pid, &qs, &ts); ! cbs_set_params(pid, qs, p->per); p->valid = VALID; } --- 148,162 ---- return; } + t = find_task_by_pid(pid); + if (t == NULL) { + cprintf("Error!!! Cannot find task for pid %d\n", pid); + + return; + } if (p->valid == PERIOD_CHANGED) { ! cbs_get_params(t, &qs, &ts); ! cbs_set_params(t, qs, p->per); p->valid = VALID; } *************** *** 159,164 **** qos_abort(3750); } ! cbs_get_params(pid, &qs, &ts); ! cbs_set_params(pid, p->q, ts); p->valid = VALID; } --- 166,171 ---- qos_abort(3750); } ! cbs_get_params(t, &qs, &ts); ! cbs_set_params(t, p->q, ts); p->valid = VALID; } |
From: Luca A. <lu...@us...> - 2004-08-21 13:54:20
|
Update of /cvsroot/linux-hls/qosman/us/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6861/us/include Modified Files: local.h Log Message: Update to the new gensched interface Index: local.h =================================================================== RCS file: /cvsroot/linux-hls/qosman/us/include/local.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** local.h 9 Apr 2004 13:39:58 -0000 1.2 --- local.h 21 Aug 2004 13:54:09 -0000 1.3 *************** *** 4,7 **** --- 4,8 ---- #include <unistd.h> #include <stdlib.h> + #include <string.h> #include <fcntl.h> |
From: Luca A. <lu...@us...> - 2004-08-21 13:51:39
|
Update of /cvsroot/linux-hls/cbs/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5943 Modified Files: Makefile cbs.c hooks.c init.c timers.c Log Message: - Update to the new gensched interface - New "generic" timing code, based on sys_gettimeofday Index: init.c =================================================================== RCS file: /cvsroot/linux-hls/cbs/src/init.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** init.c 21 Feb 2004 13:06:37 -0000 1.1.1.1 --- init.c 21 Aug 2004 13:51:27 -0000 1.2 *************** *** 28,33 **** extern void generic_register(struct task_struct *t); extern void generic_unregister(struct task_struct *t); ! extern int generic_setsched(pid_t pid, int policy, struct sched_param *param); ! extern int generic_getsched(pid_t pid, struct sched_param *param); --- 28,33 ---- extern void generic_register(struct task_struct *t); extern void generic_unregister(struct task_struct *t); ! extern int generic_setsched(struct task_struct *t, int policy, struct sched_param *param); ! extern int generic_getsched(struct task_struct *t, struct sched_param *param); Index: hooks.c =================================================================== RCS file: /cvsroot/linux-hls/cbs/src/hooks.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** hooks.c 21 Feb 2004 13:06:36 -0000 1.1.1.1 --- hooks.c 21 Aug 2004 13:51:27 -0000 1.2 *************** *** 20,23 **** --- 20,24 ---- #include <scheduler.h> #include <dispatch.h> + #include <muldiv.h> #include <time.h> *************** *** 40,62 **** #endif ! static inline struct task_struct *find_process_by_pid(pid_t pid) ! { ! struct task_struct *tsk = current; ! ! if (pid) { ! tsk = find_task_by_pid(pid); ! } ! ! return tsk; ! } ! ! int cbs_get_params(int pid, unsigned long int *qs, unsigned long int *ts) { struct cbs_struct *cbs; - struct task_struct *p; unsigned long flags; spin_lock_irqsave(&generic_scheduler_lock, flags); - p = find_process_by_pid(pid); if (p == NULL) { spin_unlock_irqrestore(&generic_scheduler_lock, flags); --- 41,50 ---- #endif ! int cbs_get_params(struct task_struct *p, unsigned long int *qs, unsigned long int *ts) { struct cbs_struct *cbs; unsigned long flags; spin_lock_irqsave(&generic_scheduler_lock, flags); if (p == NULL) { spin_unlock_irqrestore(&generic_scheduler_lock, flags); *************** *** 76,87 **** return 0; } ! int cbs_set_params(int pid, unsigned long int qs, unsigned long int ts) { struct cbs_struct *cbs; - struct task_struct *p; unsigned long flags; spin_lock_irqsave(&generic_scheduler_lock, flags); - p = find_process_by_pid(pid); if (p == NULL) { spin_unlock_irqrestore(&generic_scheduler_lock, flags); --- 64,73 ---- return 0; } ! int cbs_set_params(struct task_struct *p, unsigned long int qs, unsigned long int ts) { struct cbs_struct *cbs; unsigned long flags; spin_lock_irqsave(&generic_scheduler_lock, flags); if (p == NULL) { spin_unlock_irqrestore(&generic_scheduler_lock, flags); *************** *** 96,100 **** #ifdef QOSDBG cprintf("<changing period> Task (pid %d) changed from %d to %d\n", ! pid, p->oldp, p->per); cprintf(" (quantum is %d)\n", cbs->max_budget); #endif --- 82,86 ---- #ifdef QOSDBG cprintf("<changing period> Task (pid %d) changed from %d to %d\n", ! p->pid, p->oldp, p->per); cprintf(" (quantum is %d)\n", cbs->max_budget); #endif *************** *** 109,113 **** #ifdef QOSDBG cprintf(" Task %d changed capacity from %d (%d) to %d\n", ! pid, p->oldq, ce.max_budget, p->q); #endif cbs->max_budget = qs; --- 95,99 ---- #ifdef QOSDBG cprintf(" Task %d changed capacity from %d (%d) to %d\n", ! p->pid, p->oldq, ce.max_budget, p->q); #endif cbs->max_budget = qs; *************** *** 245,251 **** * > 0 ---> do the regular Linux thing... */ ! int generic_getsched(pid_t pid, struct sched_param *sp) { - struct task_struct *p; struct cbs_error cbs_e; struct sched_param_new sched_p, *param; --- 231,236 ---- * > 0 ---> do the regular Linux thing... */ ! int generic_getsched(struct task_struct *p, struct sched_param *sp) { struct cbs_error cbs_e; struct sched_param_new sched_p, *param; *************** *** 258,262 **** spin_lock_irqsave(&generic_scheduler_lock, flags); - p = find_process_by_pid(pid); if (p == NULL) { spin_unlock_irqrestore(&generic_scheduler_lock, flags); --- 243,246 ---- *************** *** 304,308 **** } ! int generic_setsched(pid_t pid, int policy, struct sched_param *sp) { unsigned long int t, q; --- 288,292 ---- } ! int generic_setsched(struct task_struct *p, int policy, struct sched_param *sp) { unsigned long int t, q; *************** *** 312,316 **** #endif struct cbs_struct *cbs; - struct task_struct *p; struct cbs_param cbs_p; struct sched_param_new sched_p; --- 296,299 ---- *************** *** 323,327 **** spin_lock_irqsave(&generic_scheduler_lock, flags); debug_code = 5; - p = find_process_by_pid(pid); if (p == NULL) { debug_code = 0; --- 306,309 ---- Index: timers.c =================================================================== RCS file: /cvsroot/linux-hls/cbs/src/timers.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** timers.c 21 Feb 2004 13:06:36 -0000 1.1.1.1 --- timers.c 21 Aug 2004 13:51:27 -0000 1.2 *************** *** 18,21 **** --- 18,22 ---- #include <timers.h> + #include <muldiv.h> #include <time.h> Index: Makefile =================================================================== RCS file: /cvsroot/linux-hls/cbs/src/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Makefile 21 Feb 2004 13:06:34 -0000 1.1.1.1 --- Makefile 21 Aug 2004 13:51:27 -0000 1.2 *************** *** 6,11 **** ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/) CPPFLAGS += -D__KERNEL__ -DMODULE -I$(KERNEL_DIR)/include -I./include ! CFLAGS += -Wall -Wstrict-prototypes -O2 -g ifeq ($(ARCH), ppc) CFLAGS += -g -msoft-float -ffixed-r2 -mmultiple -mstring --- 6,12 ---- ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/) + TARCH := $(ARCH) CPPFLAGS += -D__KERNEL__ -DMODULE -I$(KERNEL_DIR)/include -I./include ! CFLAGS += -Wall -Wstrict-prototypes -O2 -g -fno-strict-aliasing ifeq ($(ARCH), ppc) CFLAGS += -g -msoft-float -ffixed-r2 -mmultiple -mstring *************** *** 51,55 **** ! all: include/time.h cbs_sched.o OBJS = cbs.o dispatch.o hooks.o init.o --- 52,56 ---- ! all: include/muldiv.h include/time.h cbs_sched.o OBJS = cbs.o dispatch.o hooks.o init.o *************** *** 80,85 **** $(GENKSYMS) -k2.4.0 < tmp > $@ ! include/time.h: include/$(ARCH)-time.h ! ln -s $(ARCH)-time.h include/time.h cbs_sched.o: $(OBJS) --- 81,89 ---- $(GENKSYMS) -k2.4.0 < tmp > $@ ! include/time.h: include/$(TARCH)-time.h ! ln -s $(TARCH)-time.h include/time.h ! ! include/muldiv.h: include/$(ARCH)-muldiv.h ! ln -s $(ARCH)-muldiv.h include/muldiv.h cbs_sched.o: $(OBJS) Index: cbs.c =================================================================== RCS file: /cvsroot/linux-hls/cbs/src/cbs.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** cbs.c 20 Jun 2004 13:11:31 -0000 1.3 --- cbs.c 21 Aug 2004 13:51:27 -0000 1.4 *************** *** 15,18 **** --- 15,19 ---- #include <linux/list.h> #include <linux/slab.h> + #include <muldiv.h> #include <time.h> *************** *** 23,27 **** #endif - static unsigned long long int prev_exec_set_time = 0; static unsigned long long int last_update_time = 0; --- 24,27 ---- *************** *** 335,339 **** sched_print(" Selected CBS %p (task %d)\n", new_exec, new_exec->task->pid); #endif ! sched_print(" Setting timer in %ld ticks\n", new_exec->c); #endif --- 335,339 ---- sched_print(" Selected CBS %p (task %d)\n", new_exec, new_exec->task->pid); #endif ! sched_print(" Setting timer in %Ld ticks\n", new_exec->c); #endif *************** *** 449,453 **** } else { #ifdef __CBS_DEBUG__ ! sched_print(" Setting timer in %ld ticks\n", t->c); #endif #ifdef __GRUB__ --- 449,453 ---- } else { #ifdef __CBS_DEBUG__ ! sched_print(" Setting timer in %Ld ticks\n", t->c); #endif #ifdef __GRUB__ *************** *** 633,637 **** --- 633,643 ---- #ifdef __CBS_GET_ERROR__ + #ifdef __CBS_DEBUG__ + sched_print("Mallocing...\n"); + #endif arrival = kmalloc(sizeof(struct arrival_list), GFP_ATOMIC); + #ifdef __CBS_DEBUG__ + sched_print("done: %p\n", arrival); + #endif if (!arrival) { sched_print("Failed to allocate an arrival stuff: allocated = %d\n", t->allocated_act); *************** *** 653,656 **** --- 659,665 ---- trace_activation(t, r); #endif + #ifdef __CBS_DEBUG__ + sched_print("New DL?\n"); + #endif /* CBS test: c > (d - r) * U ---> New deadline */ if ((t->c > llimd(t->deadline - r, t->max_budget_clock, t->period_clock)) || *************** *** 660,664 **** t->c = t->max_budget_clock; #ifdef __CBS_DEBUG__ ! sched_print(" New budget %ld\n",t->c); sched_print(" New Deadline %Ld\n", t->deadline); #endif --- 669,673 ---- t->c = t->max_budget_clock; #ifdef __CBS_DEBUG__ ! sched_print(" New budget %Ld\n",t->c); sched_print(" New Deadline %Ld\n", t->deadline); #endif *************** *** 670,673 **** --- 679,685 ---- res = 0; + #ifdef __CBS_DEBUG__ + sched_print(" Adding to list..."); + #endif if (edf_list_add(t, 1)) { #ifdef __CBS_DEBUG__ |
From: Luca A. <lu...@us...> - 2004-08-21 13:51:38
|
Update of /cvsroot/linux-hls/cbs/src/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5943/include Modified Files: cbs.h i386-time.h Added Files: generic-time.h i386-muldiv.h ppc-muldiv.h Log Message: - Update to the new gensched interface - New "generic" timing code, based on sys_gettimeofday Index: cbs.h =================================================================== RCS file: /cvsroot/linux-hls/cbs/src/include/cbs.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** cbs.h 21 Feb 2004 13:06:37 -0000 1.1.1.1 --- cbs.h 21 Aug 2004 13:51:27 -0000 1.2 *************** *** 91,95 **** void cbs_init(void); void cbs_deinit(void); ! int cbs_get_params(int pid, unsigned long int *qs, unsigned long int *ts); ! int cbs_set_params(int pid, unsigned long int qs, unsigned long int ts); #endif /* __CBS_H__ */ --- 91,95 ---- void cbs_init(void); void cbs_deinit(void); ! int cbs_get_params(struct task_struct *p, unsigned long int *qs, unsigned long int *ts); ! int cbs_set_params(struct task_struct *p, unsigned long int qs, unsigned long int ts); #endif /* __CBS_H__ */ --- NEW FILE: i386-muldiv.h --- #ifndef __MULDIV_H__ #define __MULDIV_H__ /* This function comes from RTAI (http://www.rtai.org) */ static inline long long llimd(long long ll, int mult, int div) { __asm__ __volatile (\ "movl %%edx,%%ecx; mull %%esi; movl %%eax,%%ebx; \n\t" "movl %%ecx,%%eax; movl %%edx,%%ecx; mull %%esi; \n\t" "addl %%ecx,%%eax; adcl $0,%%edx; divl %%edi; \n\t" "movl %%eax,%%ecx; movl %%ebx,%%eax; divl %%edi; \n\t" "sal $1,%%edx; cmpl %%edx,%%edi; movl %%ecx,%%edx; \n\t" "jge 1f; addl $1,%%eax; adcl $0,%%edx; 1:" : "=A" (ll) : "A" (ll), "S" (mult), "D" (div) : "%ebx", "%ecx"); return ll; } #endif /* __MULDIV_H__ */ --- NEW FILE: ppc-muldiv.h --- #ifndef __MULDIV_H__ #define __MULDIV_H__ /* This comes from RTAI... Please, adjust the license stuff!!! */ static inline unsigned long long ullmul(unsigned long m0, unsigned long m1) { unsigned long long res; __asm__ __volatile__ ("mulhwu %0, %1, %2" : "=r" (((unsigned long *)&res)[0]) : "%r" (m0), "r" (m1)); ((unsigned long *)&res)[1] = m0 * m1; return res; } static inline unsigned long long ulldiv(unsigned long long ull, unsigned long uld, unsigned long *r) { unsigned long long q, rf; unsigned long qh, rh, ql, qf; q = 0; rf = (unsigned long long)(0xFFFFFFFF - (qf = 0xFFFFFFFF / uld) * uld) + 1ULL; while (ull >= uld) { ((unsigned long *)&q)[0] += (qh = ((unsigned long *)&ull)[0] / uld); rh = ((unsigned long *)&ull)[0] - qh * uld; q += rh * (unsigned long long)qf + (ql = ((unsigned long *)&ull)[1] / uld); ull = rh * rf + (((unsigned long *)&ull)[1] - ql * uld); } *r = ull; return q; } // returns (long long)ll = (int)ll*(int)(mult)/(int)div. static inline unsigned long long llimd(unsigned long long ull, unsigned long mult, unsigned long div) { unsigned long long low; unsigned long q, r; low = ullmul(((unsigned long *)&ull)[1], mult); q = ulldiv(ullmul(((unsigned long *)&ull)[0], mult) + ((unsigned long *)&low)[0], div, (unsigned long *)&low); low = ulldiv(low, div, &r); ((unsigned long *)&low)[0] += q; return (r + r) > div ? low + 1 : low; } #endif /* __MULDIV_H__ */ --- NEW FILE: generic-time.h --- /* * Copyright (C) 2002 Luca Abeni * This is Free Software; see GPL.txt for details */ #ifndef __TIME_H__ #include <linux/module.h> #ifndef CONFIG_GENERIC_SCHEDULER #error The Generic Scheduler is not enabled!!! #endif #include <asm/time.h> static inline unsigned long long int sched_read_clock(void) { unsigned long long int ts; struct timeval tv; do_gettimeofday(&tv); ts = (unsigned long long int)tv.tv_usec + (unsigned long long int)tv.tv_sec * 1000000LLU; return ts; } /* static inline unsigned long long int llimd(unsigned long long ull, unsigned long mult, unsigned long div); */ /* fast_gettimeoffset_quotient = 2^32 * (1 / (TSC clocks per usec)) */ static inline unsigned long long int us2clock(unsigned long u) { return u; } static inline unsigned long int clock2ms(unsigned long long int c) { unsigned long int ms; ms = llimd(c, 1, 1000); return ms; } static inline unsigned long int clock2us(unsigned long long c) { return c; } static inline unsigned long int clock2jiffies(unsigned long long c) { return llimd(c, HZ, 1000000); } #endif /* __TIME_H__ */ Index: i386-time.h =================================================================== RCS file: /cvsroot/linux-hls/cbs/src/include/i386-time.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** i386-time.h 21 Feb 2004 13:06:37 -0000 1.1.1.1 --- i386-time.h 21 Aug 2004 13:51:27 -0000 1.2 *************** *** 22,26 **** } ! static inline long long llimd(long long ll, int mult, int div); /* fast_gettimeoffset_quotient = 2^32 * (1 / (TSC clocks per usec)) */ --- 22,26 ---- } ! /* static inline long long llimd(long long ll, int mult, int div); */ /* fast_gettimeoffset_quotient = 2^32 * (1 / (TSC clocks per usec)) */ *************** *** 59,77 **** return c - llimd(tmp2, cpu_khz, 1000); } - /* This function comes from RTAI (http://www.rtai.org) */ - static inline long long llimd(long long ll, int mult, int div) - { - __asm__ __volatile (\ - "movl %%edx,%%ecx; mull %%esi; movl %%eax,%%ebx; \n\t" - "movl %%ecx,%%eax; movl %%edx,%%ecx; mull %%esi; \n\t" - "addl %%ecx,%%eax; adcl $0,%%edx; divl %%edi; \n\t" - "movl %%eax,%%ecx; movl %%ebx,%%eax; divl %%edi; \n\t" - "sal $1,%%edx; cmpl %%edx,%%edi; movl %%ecx,%%edx; \n\t" - "jge 1f; addl $1,%%eax; adcl $0,%%edx; 1:" - : "=A" (ll) - : "A" (ll), "S" (mult), "D" (div) - : "%ebx", "%ecx"); - return ll; - } - #endif /* __TIME_H__ */ --- 59,61 ---- |
From: Luca A. <lu...@us...> - 2004-07-25 09:57:44
|
Update of /cvsroot/linux-hls/qosman/demos In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13492/demos Modified Files: Makefile mpcore.c mpcore.h mpdemo.c ppsdemo.c Added Files: mpcore-fb.c mpcore-fb.h Log Message: Update to the demos: New FB-based demo Index: mpcore.h =================================================================== RCS file: /cvsroot/linux-hls/qosman/demos/mpcore.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mpcore.h 9 Apr 2004 13:41:31 -0000 1.1 --- mpcore.h 25 Jul 2004 09:57:30 -0000 1.2 *************** *** 12,17 **** void file_set_end(void); FILE *file_open(char *fname, ImageDesc *img); ! struct controls *window_prepare(int w, int h); ! void frame_display(struct controls *c, ImageDesc *img, unsigned char *b); #endif /* __MP_CORE_H__ */ --- 12,20 ---- void file_set_end(void); FILE *file_open(char *fname, ImageDesc *img); ! struct controls *window_prepare(ImageDesc *img); ! void frame_display(struct controls *c, ImageDesc *img, unsigned char *b, int i); ! void events_update(void); ! void pbar_update(struct controls *c, float l); + #define output_init gtk_init #endif /* __MP_CORE_H__ */ --- NEW FILE: mpcore-fb.c --- #include <sys/mman.h> #include <sys/ioctl.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <stdlib.h> #include <unistd.h> #include <stdio.h> #include <errno.h> #include <string.h> #include <linux/fb.h> #include <mpeg.h> #include "mpcore-fb.h" #define FULLCOLOR static int end = 0; static char *fbdevname = "/dev/fb0"; static struct fb_cmap old_cmap; static struct fb_cmap *cmap_bw(int size) { int i; unsigned short int *red, *green, *blue; struct fb_cmap *cmap; red = malloc(size * sizeof(red[0])); if(!red) { fprintf(stderr, "Can't allocate red palette with %d entries.\n", size); return NULL; } for(i = 0; i < size; i++) { red[i] = (65535 / (size - 1)) * i; } green = malloc(size * sizeof(green[0])); if(!green) { fprintf(stderr, "Can't allocate green palette with %d entries.\n", size); free(red); return NULL; } for(i = 0; i< size; i++) { green[i] = (65535 / (size - 1)) * i; } blue = malloc(size * sizeof(blue[0])); if(!blue) { fprintf(stderr, "Can't allocate blue palette with %d entries.\n", size); free(red); free(green); return NULL; } for(i = 0; i< size; i++) { blue[i] = (65535 / (size - 1)) * i; } cmap = malloc(sizeof(struct fb_cmap)); if(!cmap) { fprintf(stderr, "Can't allocate color map\n"); free(red); free(green); free(blue); return NULL; } cmap->start = 0; cmap->transp = 0; cmap->len = size; cmap->red = red; cmap->blue = blue; cmap->green = green; cmap->transp = NULL; return cmap; } static struct fb_cmap *cmap_color(int size, ColormapEntry *mpmap) { int i; unsigned short int *red, *green, *blue; struct fb_cmap *cmap; printf("Colormap Size: %d\n", size); red = malloc(size * sizeof(red[0])); if(!red) { fprintf(stderr, "Can't allocate red palette with %d entries.\n", size); return NULL; } green = malloc(size * sizeof(green[0])); if(!green) { fprintf(stderr, "Can't allocate green palette with %d entries.\n", size); free(red); return NULL; } blue = malloc(size * sizeof(blue[0])); if(!blue) { fprintf(stderr, "Can't allocate blue palette with %d entries.\n", size); free(red); free(green); return NULL; } for(i = 0; i < size; i++) { red[i] = mpmap[i].red /* * 256 */; blue[i] = mpmap[i].blue /* * 256 */; green[i] = mpmap[i].green /* * 256 */; printf("%d ---> R: %d G: %d B: %d\n", i, red[i], green[i], blue[i]); } cmap = malloc(sizeof(struct fb_cmap)); if(!cmap) { fprintf(stderr, "Can't allocate color map\n"); free(red); free(green); free(blue); return NULL; } cmap->start = 0; cmap->transp = 0; cmap->len = size; cmap->red = red; cmap->blue = blue; cmap->green = green; cmap->transp = NULL; return cmap; } void events_update(void) { } void pbar_update(struct controls *c, float l) { } int file_end(void) { return end; } void file_set_end(void) { end = 1; } void frame_display(struct controls *c, ImageDesc *img, unsigned char *b, int id) { int i; #ifndef FULLCOLOR if (c->bpp * 8 != img->Depth) { fprintf(stderr, "(%d != %d) Screen BPP != Img BPP!!! :(\n", c->bpp, img->Depth); exit(-1); } #endif for (i = 0; i < img->Height; i++) { memcpy(c->fb_line_len / 2 * id + c->b + i * c->fb_line_len, b + i * img->Width * c->bpp, img->Width * c->bpp); } } FILE *file_open(char *fname, ImageDesc *img) { FILE *f; int i; f = fopen(fname, "rb"); if (fname == NULL) { perror("Error opening:"); exit(-1); } #ifdef FULLCOLOR SetMPEGOption(MPEG_DITHER, FULL_COLOR_DITHER); #else SetMPEGOption(MPEG_DITHER, /*GRAY_DITHER*/ FS4_DITHER); #endif if (!OpenMPEG(f, img)) { fprintf(stderr, "OpenMPEG on %s failed\n", fname); exit(-1); } printf("H: %d\tW: %d\tD: %d\n", img->Height, img->Width, img->Depth); printf("PS: %d\tSize: %d\tBMP: %d\n", img->PixelSize, img->Size, img->BitmapPad); printf("Rate: %d\tbr: %d\tcmap Size: %d\n", img->PictureRate, img->BitRate, img->ColormapSize); for (i = 0; i < img->ColormapSize; i++) { printf("%d ---> R: %d G: %d B: %d\n", i, img->Colormap[i].red, img->Colormap[i].green, img->Colormap[i].blue); } return f; } struct controls *window_prepare(ImageDesc *img) { int res; struct fb_var_screeninfo fb_vinfo; struct fb_fix_screeninfo fb_finfo; struct controls *p; struct fb_cmap *cmap; p = malloc(sizeof(struct controls)); if (p == NULL) { return NULL; } p->fbdev_fd = open(fbdevname, O_RDWR); if (p->fbdev_fd == -1) { perror("Cannot open FB device"); free(p); return NULL; } res = ioctl(p->fbdev_fd, FBIOGET_VSCREENINFO, &fb_vinfo); if (res < 0) { perror("Error opening fbdev"); close(p->fbdev_fd); free(p); return NULL; } #if 0 p->fbtty_fd = open("dev/tty", O_RDWR); if (fbtty_fd < 0) { perror("Error opening /dev/tty"); return NULL; } #endif printf("Bits per Pixel: %d\n", fb_vinfo.bits_per_pixel); printf("Red.Len: %d\n", fb_vinfo.red.length); printf("Blue.Len: %d\n", fb_vinfo.blue.length); printf("Green.Len: %d\n", fb_vinfo.green.length); res = ioctl(p->fbdev_fd, FBIOGET_FSCREENINFO, &fb_finfo); if (res < 0) { perror("Can't get FSCREENINFO"); close(p->fbdev_fd); free(p); return NULL; } #ifdef FULLCOLOR fb_vinfo.bits_per_pixel = 32; res = ioctl(p->fbdev_fd, FBIOPUT_VSCREENINFO, &fb_vinfo); if (res < 0) { perror("Error opening fbdev"); close(p->fbdev_fd); free(p); return NULL; } #endif p->fb_line_len = fb_finfo.line_length; p->fb_size = fb_finfo.smem_len; p->bpp = fb_vinfo.bits_per_pixel / 8; /* CHECKME! */ p->b = NULL; p->b = (unsigned char *)mmap(0, p->fb_size, PROT_READ | PROT_WRITE, MAP_SHARED, p->fbdev_fd, 0); if (p->b == (unsigned char *) -1) { perror("MMAP"); close(p->fbdev_fd); free(p); return NULL; } #if 0 center = frame_buffer + (out_width - in_width) * fb_pixel_size / 2 + ( (out_height - in_height) / 2 ) * fb_line_len + x_offset * fb_pixel_size + y_offset * fb_line_len; #endif printf("frame_buffer @ %p\n", p->b); #if 0 printf("center @ %p\n", center); printf("pixel per line: %d\n", fb_line_len / fb_pixel_size); memset(frame_buffer, '\0', fb_line_len * fb_yres); #endif #ifdef FULLCOLOR #else #if 0 cmap = cmap_bw(256); #else cmap = cmap_color(img->ColormapSize, img->Colormap); #endif old_cmap.len = 256; old_cmap.start = 0; old_cmap.red = malloc(256 * 2); old_cmap.blue = malloc(256 * 2); old_cmap.green = malloc(256 * 2); old_cmap.transp = malloc(256 * 2); res = ioctl(p->fbdev_fd, FBIOGETCMAP, &old_cmap); if (res) { fprintf(stderr, "can't get cmap: %s\n", strerror(errno)); close(p->fbdev_fd); free(p); return NULL; } res = ioctl(p->fbdev_fd, FBIOPUTCMAP, cmap); if (res) { fprintf(stderr, "can't put cmap: %s\n", strerror(errno)); close(p->fbdev_fd); free(p); return NULL; } free(cmap->red); free(cmap->green); free(cmap->blue); free(cmap); #endif return p; } Index: mpdemo.c =================================================================== RCS file: /cvsroot/linux-hls/qosman/demos/mpdemo.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** mpdemo.c 9 Apr 2004 13:39:56 -0000 1.2 --- mpdemo.c 25 Jul 2004 09:57:30 -0000 1.3 *************** *** 43,47 **** --- 43,51 ---- #include <mpeg.h> + #ifdef __FB__ + #include "mpcore-fb.h" + #else #include "mpcore.h" + #endif #if 0 #include <rk/rk.h> *************** *** 65,70 **** static int myid; - #define MAXSLIDE 150 - void save_results(void) { --- 69,72 ---- *************** *** 155,159 **** argc = ac; argv = av; ! gtk_init(&argc, &argv); if (argc != 2) { printf("Gimme the file name, please!!!\n"); --- 157,161 ---- argc = ac; argv = av; ! output_init(&argc, &argv); if (argc != 2) { printf("Gimme the file name, please!!!\n"); *************** *** 175,179 **** i = 0; ! c = window_prepare(img.Width, img.Height); cprintf("[MPEGDemo] Starting to play...\n"); --- 177,181 ---- i = 0; ! c = window_prepare(&img); cprintf("[MPEGDemo] Starting to play...\n"); *************** *** 182,193 **** gettimeofday(&now, NULL); timevect[i] = now.tv_usec + now.tv_sec * 1000000; ! #ifdef VIDEO ! while (gtk_events_pending()) { ! gtk_main_iteration_do(FALSE); ! } ! #endif ! if (gtk_events_pending()) { ! gtk_main_iteration_do(FALSE); ! } if (!file_end()) { moreframes = GetMPEGFrame(rgbbuff); --- 184,188 ---- gettimeofday(&now, NULL); timevect[i] = now.tv_usec + now.tv_sec * 1000000; ! events_update(); if (!file_end()) { moreframes = GetMPEGFrame(rgbbuff); *************** *** 195,208 **** file_set_end(); } ! frame_display(c, &img, rgbbuff); } l = qman_howlate(0); // timevect2[i] = l; l = l / 5000; ! if (l > MAXSLIDE) { ! l = MAXSLIDE; ! } ! gtk_progress_bar_update(GTK_PROGRESS_BAR(c->prbar), ! (float) l / (float) MAXSLIDE); gettimeofday(&now, NULL); --- 190,199 ---- file_set_end(); } ! frame_display(c, &img, rgbbuff, myid); } l = qman_howlate(0); // timevect2[i] = l; l = l / 5000; ! pbar_update(c, l); gettimeofday(&now, NULL); Index: ppsdemo.c =================================================================== RCS file: /cvsroot/linux-hls/qosman/demos/ppsdemo.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ppsdemo.c 9 Apr 2004 13:39:56 -0000 1.2 --- ppsdemo.c 25 Jul 2004 09:57:30 -0000 1.3 *************** *** 146,150 **** i = 0; ! c = window_prepare(img.Width, img.Height); cprintf("Starting...\n"); --- 146,150 ---- i = 0; ! c = window_prepare(&img); cprintf("Starting...\n"); *************** *** 165,169 **** file_set_end(); } ! frame_display(c, &img, rgbbuff); } l = qman_howlate(0); --- 165,169 ---- file_set_end(); } ! frame_display(c, &img, rgbbuff, num); } l = qman_howlate(0); --- NEW FILE: mpcore-fb.h --- #ifndef __MP_CORE_H__ #define __MP_CORE_H__ struct controls { int fb_size; int fb_line_len; int bpp; struct fb_cmap *old_cmap; int fbdev_fd; unsigned char *b; }; int file_end(void); void file_set_end(void); FILE *file_open(char *fname, ImageDesc *img); struct controls *window_prepare(ImageDesc *img); void frame_display(struct controls *c, ImageDesc *img, unsigned char *b, int i); void events_update(void); void pbar_update(struct controls *c, float l); #define output_init(a, b) #endif /* __MP_CORE_H__ */ Index: mpcore.c =================================================================== RCS file: /cvsroot/linux-hls/qosman/demos/mpcore.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mpcore.c 9 Apr 2004 13:41:31 -0000 1.1 --- mpcore.c 25 Jul 2004 09:57:30 -0000 1.2 *************** *** 7,13 **** --- 7,36 ---- #include "mpcore.h" + #define MAXSLIDE 150 + static GdkPixmap *screen; static int end = 0; + + void events_update(void) + { + #ifdef VIDEO + while (gtk_events_pending()) { + gtk_main_iteration_do(FALSE); + } + #endif + if (gtk_events_pending()) { + gtk_main_iteration_do(FALSE); + } + } + + void pbar_update(struct controls *c, float l) + { + if (l > MAXSLIDE) { + l = MAXSLIDE; + } + gtk_progress_bar_update(GTK_PROGRESS_BAR(c->prbar), l / (float)MAXSLIDE); + } + int file_end(void) { *************** *** 20,24 **** } ! void frame_display(struct controls *c, ImageDesc *img, unsigned char *b) { gdk_draw_rgb_32_image(screen, c->gc, 0, 0, img->Width, img->Height, --- 43,47 ---- } ! void frame_display(struct controls *c, ImageDesc *img, unsigned char *b, int i) { gdk_draw_rgb_32_image(screen, c->gc, 0, 0, img->Width, img->Height, *************** *** 81,85 **** ! struct controls *window_prepare(int w, int h) { GdkGC *gc1; --- 104,108 ---- ! struct controls *window_prepare(ImageDesc *img) { GdkGC *gc1; *************** *** 105,109 **** window = gtk_window_new(GTK_WINDOW_TOPLEVEL); ! gtk_window_set_default_size(GTK_WINDOW(window), w, h + 50); vbox = gtk_vbox_new(FALSE, 0); --- 128,132 ---- window = gtk_window_new(GTK_WINDOW_TOPLEVEL); ! gtk_window_set_default_size(GTK_WINDOW(window), img->Width, img->Height + 50); vbox = gtk_vbox_new(FALSE, 0); *************** *** 118,122 **** //drawing area c->d_area = gtk_drawing_area_new(); ! gtk_drawing_area_size(GTK_DRAWING_AREA(c->d_area), w, h); expid = gtk_signal_connect(GTK_OBJECT(c->d_area), "expose_event", GTK_SIGNAL_FUNC(expose_event), NULL); --- 141,145 ---- //drawing area c->d_area = gtk_drawing_area_new(); ! gtk_drawing_area_size(GTK_DRAWING_AREA(c->d_area), img->Width, img->Height); expid = gtk_signal_connect(GTK_OBJECT(c->d_area), "expose_event", GTK_SIGNAL_FUNC(expose_event), NULL); Index: Makefile =================================================================== RCS file: /cvsroot/linux-hls/qosman/demos/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile 9 Apr 2004 13:39:56 -0000 1.2 --- Makefile 25 Jul 2004 09:57:30 -0000 1.3 *************** *** 4,14 **** GTKLIB = `gtk-config --libs` O_OBJS = ! TESTS = mpdemo ppsdemo all: $(TESTS) mpdemo: mpcore.o qtest.o mpdemo.o ../libqos.a gcc qtest.o mpdemo.o mpcore.o -L.. -lqos -L../../lib -lmpeg $(GTKLIB) -o mpdemo ppsdemo: mpcore.o test1.o ppsdemo.o ../libqos.a gcc test1.o mpcore.o ppsdemo.o -L.. -lqos -L../../lib -lmpeg $(GTKLIB) -o ppsdemo --- 4,20 ---- GTKLIB = `gtk-config --libs` O_OBJS = ! TESTS = mpdemo ppsdemo mpdemo-fb txtdemo all: $(TESTS) + mpdemo-fb.o: mpdemo.c + $(CC) $(CFLAGS) -D__FB__ -c mpdemo.c -o mpdemo-fb.o + mpdemo: mpcore.o qtest.o mpdemo.o ../libqos.a gcc qtest.o mpdemo.o mpcore.o -L.. -lqos -L../../lib -lmpeg $(GTKLIB) -o mpdemo + mpdemo-fb: mpcore-fb.o qtest.o mpdemo-fb.o ../libqos.a + gcc qtest.o mpdemo-fb.o mpcore-fb.o -L.. -lqos -L../../lib -lmpeg -o mpdemo-fb + ppsdemo: mpcore.o test1.o ppsdemo.o ../libqos.a gcc test1.o mpcore.o ppsdemo.o -L.. -lqos -L../../lib -lmpeg $(GTKLIB) -o ppsdemo *************** *** 22,27 **** clean: rm -rf *.o ! rm -rf mpdemo ! rm -rf ppsdemo ifeq (deps,$(wildcard deps)) --- 28,32 ---- clean: rm -rf *.o ! rm -rf $(TESTS) ifeq (deps,$(wildcard deps)) |
From: Luca A. <lu...@us...> - 2004-07-18 18:39:43
|
Update of /cvsroot/linux-hls/hls/patches In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2678/patches Modified Files: gensched2-2.4.25.patch Log Message: - Committed the new version of the gensched patch (I erroneously committed a wrong patch) - Port the hls module to the new gensched interface (setscheduler and getscheduler changed) - Some fixes... Index: gensched2-2.4.25.patch =================================================================== RCS file: /cvsroot/linux-hls/hls/patches/gensched2-2.4.25.patch,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** gensched2-2.4.25.patch 18 Jul 2004 10:40:42 -0000 1.1 --- gensched2-2.4.25.patch 18 Jul 2004 18:39:31 -0000 1.2 *************** *** 1,5 **** ! diff -ur ../linux-2.4.25/Makefile linux-2.4.25/Makefile --- ../linux-2.4.25/Makefile 2004-03-07 09:07:35.000000000 +0100 ! +++ linux-2.4.25/Makefile 2004-06-20 15:58:40.000000000 +0200 @@ -1,7 +1,7 @@ VERSION = 2 --- 1,5 ---- ! diff -urp ../linux-2.4.25/Makefile linux-2.4.25/Makefile --- ../linux-2.4.25/Makefile 2004-03-07 09:07:35.000000000 +0100 ! +++ linux-2.4.25/Makefile 2004-07-18 20:25:11.000000000 +0200 @@ -1,7 +1,7 @@ VERSION = 2 *************** *** 7,18 **** SUBLEVEL = 25 -EXTRAVERSION = ! + EXTRAVERSION = -gensched KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) ! diff -ur ../linux-2.4.25/arch/i386/config.in linux-2.4.25/arch/i386/config.in --- ../linux-2.4.25/arch/i386/config.in 2004-03-07 09:08:19.000000000 +0100 ! +++ linux-2.4.25/arch/i386/config.in 2004-06-20 15:58:40.000000000 +0200 ! @@ -261,6 +261,8 @@ if [ "$CONFIG_SMP" = "y" -a "$CONFIG_X86_CMPXCHG" = "y" ]; then define_bool CONFIG_HAVE_DEC_LOCK y --- 7,18 ---- SUBLEVEL = 25 -EXTRAVERSION = ! +EXTRAVERSION = -gensched KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) ! diff -urp ../linux-2.4.25/arch/i386/config.in linux-2.4.25/arch/i386/config.in --- ../linux-2.4.25/arch/i386/config.in 2004-03-07 09:08:19.000000000 +0100 ! +++ linux-2.4.25/arch/i386/config.in 2004-07-18 13:34:01.000000000 +0200 ! @@ -261,6 +261,8 @@ fi if [ "$CONFIG_SMP" = "y" -a "$CONFIG_X86_CMPXCHG" = "y" ]; then define_bool CONFIG_HAVE_DEC_LOCK y *************** *** 23,30 **** mainmenu_option next_comment ! diff -ur ../linux-2.4.25/arch/ppc/config.in linux-2.4.25/arch/ppc/config.in --- ../linux-2.4.25/arch/ppc/config.in 2004-03-07 09:08:24.000000000 +0100 ! +++ linux-2.4.25/arch/ppc/config.in 2004-06-20 15:59:35.000000000 +0200 ! @@ -265,6 +265,9 @@ if [ "$CONFIG_8xx" = "y" -o "$CONFIG_8260" = "y" ]; then define_bool CONFIG_EMBEDDEDBOOT y --- 23,30 ---- mainmenu_option next_comment ! diff -urp ../linux-2.4.25/arch/ppc/config.in linux-2.4.25/arch/ppc/config.in --- ../linux-2.4.25/arch/ppc/config.in 2004-03-07 09:08:24.000000000 +0100 ! +++ linux-2.4.25/arch/ppc/config.in 2004-07-18 13:34:01.000000000 +0200 ! @@ -265,6 +265,9 @@ fi if [ "$CONFIG_8xx" = "y" -o "$CONFIG_8260" = "y" ]; then define_bool CONFIG_EMBEDDEDBOOT y *************** *** 36,43 **** mainmenu_option next_comment ! diff -ur ../linux-2.4.25/include/linux/sched.h linux-2.4.25/include/linux/sched.h --- ../linux-2.4.25/include/linux/sched.h 2004-03-07 09:07:41.000000000 +0100 ! +++ linux-2.4.25/include/linux/sched.h 2004-06-20 18:03:49.000000000 +0200 ! @@ -415,6 +415,9 @@ /* journalling filesystem info */ --- 36,43 ---- mainmenu_option next_comment ! diff -urp ../linux-2.4.25/include/linux/sched.h linux-2.4.25/include/linux/sched.h --- ../linux-2.4.25/include/linux/sched.h 2004-03-07 09:07:41.000000000 +0100 ! +++ linux-2.4.25/include/linux/sched.h 2004-07-18 13:38:23.000000000 +0200 ! @@ -415,6 +415,9 @@ struct task_struct { /* journalling filesystem info */ *************** *** 49,53 **** /* ! @@ -469,6 +472,12 @@ * INIT_TASK is used to set up the first task table, touch at * your own risk!. Base=0, limit=0x1fffff (=2MB) --- 49,53 ---- /* ! @@ -469,6 +472,12 @@ extern struct exec_domain default_exec_d * INIT_TASK is used to set up the first task table, touch at * your own risk!. Base=0, limit=0x1fffff (=2MB) *************** *** 62,66 **** { \ state: 0, \ ! @@ -510,6 +519,7 @@ blocked: {{0}}, \ alloc_lock: SPIN_LOCK_UNLOCKED, \ --- 62,66 ---- { \ state: 0, \ ! @@ -510,6 +519,7 @@ extern struct exec_domain default_exec_d blocked: {{0}}, \ alloc_lock: SPIN_LOCK_UNLOCKED, \ *************** *** 70,74 **** ! @@ -806,6 +816,15 @@ extern long kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); --- 70,74 ---- ! @@ -806,6 +816,15 @@ extern void FASTCALL(remove_wait_queue(w extern long kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); *************** *** 86,90 **** do { \ wait_queue_t __wait; \ ! @@ -897,6 +916,11 @@ p->sleep_time = jiffies; list_del(&p->run_list); --- 86,90 ---- do { \ wait_queue_t __wait; \ ! @@ -897,6 +916,11 @@ static inline void del_from_runqueue(str p->sleep_time = jiffies; list_del(&p->run_list); *************** *** 98,104 **** static inline int task_on_runqueue(struct task_struct *p) ! diff -ur ../linux-2.4.25/kernel/exit.c linux-2.4.25/kernel/exit.c --- ../linux-2.4.25/kernel/exit.c 2004-03-07 09:07:40.000000000 +0100 ! +++ linux-2.4.25/kernel/exit.c 2004-06-20 15:58:40.000000000 +0200 @@ -21,6 +21,10 @@ #include <asm/pgtable.h> --- 98,104 ---- static inline int task_on_runqueue(struct task_struct *p) ! diff -urp ../linux-2.4.25/kernel/exit.c linux-2.4.25/kernel/exit.c --- ../linux-2.4.25/kernel/exit.c 2004-03-07 09:07:40.000000000 +0100 ! +++ linux-2.4.25/kernel/exit.c 2004-07-18 13:34:01.000000000 +0200 @@ -21,6 +21,10 @@ #include <asm/pgtable.h> *************** *** 112,116 **** extern struct task_struct *child_reaper; ! @@ -443,6 +447,14 @@ lock_kernel(); --- 112,116 ---- extern struct task_struct *child_reaper; ! @@ -443,6 +447,14 @@ fake_volatile: lock_kernel(); *************** *** 127,133 **** __exit_fs(tsk); exit_namespace(tsk); ! diff -ur ../linux-2.4.25/kernel/fork.c linux-2.4.25/kernel/fork.c --- ../linux-2.4.25/kernel/fork.c 2004-03-07 09:07:40.000000000 +0100 ! +++ linux-2.4.25/kernel/fork.c 2004-06-20 15:58:40.000000000 +0200 @@ -29,6 +29,10 @@ #include <asm/mmu_context.h> --- 127,133 ---- __exit_fs(tsk); exit_namespace(tsk); ! diff -urp ../linux-2.4.25/kernel/fork.c linux-2.4.25/kernel/fork.c --- ../linux-2.4.25/kernel/fork.c 2004-03-07 09:07:40.000000000 +0100 ! +++ linux-2.4.25/kernel/fork.c 2004-07-18 13:34:01.000000000 +0200 @@ -29,6 +29,10 @@ #include <asm/mmu_context.h> *************** *** 141,145 **** int nr_threads; int nr_running; ! @@ -779,6 +783,13 @@ if (!current->counter) current->need_resched = 1; --- 141,145 ---- int nr_threads; int nr_running; ! @@ -779,6 +783,13 @@ int do_fork(unsigned long clone_flags, u if (!current->counter) current->need_resched = 1; *************** *** 155,162 **** * Ok, add it to the run-queues and make it * visible to the rest of the system. ! diff -ur ../linux-2.4.25/kernel/ksyms.c linux-2.4.25/kernel/ksyms.c --- ../linux-2.4.25/kernel/ksyms.c 2004-03-07 09:07:40.000000000 +0100 ! +++ linux-2.4.25/kernel/ksyms.c 2004-06-20 15:58:40.000000000 +0200 ! @@ -619,6 +619,17 @@ /* debug */ EXPORT_SYMBOL(dump_stack); --- 155,162 ---- * Ok, add it to the run-queues and make it * visible to the rest of the system. ! diff -urp ../linux-2.4.25/kernel/ksyms.c linux-2.4.25/kernel/ksyms.c --- ../linux-2.4.25/kernel/ksyms.c 2004-03-07 09:07:40.000000000 +0100 ! +++ linux-2.4.25/kernel/ksyms.c 2004-07-18 13:34:01.000000000 +0200 ! @@ -619,6 +619,17 @@ EXPORT_SYMBOL(unshare_files); /* debug */ EXPORT_SYMBOL(dump_stack); *************** *** 176,182 **** extern const char _end[]; EXPORT_SYMBOL(_end); ! diff -ur ../linux-2.4.25/kernel/sched.c linux-2.4.25/kernel/sched.c --- ../linux-2.4.25/kernel/sched.c 2004-03-07 09:07:40.000000000 +0100 ! +++ linux-2.4.25/kernel/sched.c 2004-06-20 18:02:35.000000000 +0200 @@ -33,6 +33,13 @@ #include <asm/uaccess.h> --- 176,182 ---- extern const char _end[]; EXPORT_SYMBOL(_end); ! diff -urp ../linux-2.4.25/kernel/sched.c linux-2.4.25/kernel/sched.c --- ../linux-2.4.25/kernel/sched.c 2004-03-07 09:07:40.000000000 +0100 ! +++ linux-2.4.25/kernel/sched.c 2004-07-18 20:26:35.000000000 +0200 @@ -33,6 +33,13 @@ #include <asm/uaccess.h> *************** *** 193,197 **** extern void tqueue_bh(void); extern void immediate_bh(void); ! @@ -330,6 +337,11 @@ { list_add_tail(&p->run_list, &runqueue_head); --- 193,197 ---- extern void tqueue_bh(void); extern void immediate_bh(void); ! @@ -330,6 +337,11 @@ static inline void add_to_runqueue(struc { list_add_tail(&p->run_list, &runqueue_head); *************** *** 205,209 **** static inline void move_last_runqueue(struct task_struct * p) ! @@ -961,6 +973,16 @@ if (!p) goto out_unlock; --- 205,209 ---- static inline void move_last_runqueue(struct task_struct * p) ! @@ -961,6 +973,19 @@ static int setscheduler(pid_t pid, int p if (!p) goto out_unlock; *************** *** 213,218 **** + int res; + ! + res = setsched_hook(p, -1, param); + if (res <= 0) { + return res; + } --- 213,221 ---- + int res; + ! + res = setsched_hook(p, policy, param); + if (res <= 0) { + + spin_unlock(&runqueue_lock); + + read_unlock_irq(&tasklist_lock); + + + return res; + } *************** *** 222,226 **** policy = p->policy; else { ! @@ -1048,6 +1070,16 @@ retval = -ESRCH; if (!p) --- 225,229 ---- policy = p->policy; else { ! @@ -1048,6 +1073,16 @@ asmlinkage long sys_sched_getparam(pid_t retval = -ESRCH; if (!p) |
From: Luca A. <lu...@us...> - 2004-07-18 18:39:43
|
Update of /cvsroot/linux-hls/hls/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2678/linux Modified Files: hls_ctl.c init.c Removed Files: sched.c Log Message: - Committed the new version of the gensched patch (I erroneously committed a wrong patch) - Port the hls module to the new gensched interface (setscheduler and getscheduler changed) - Some fixes... Index: init.c =================================================================== RCS file: /cvsroot/linux-hls/hls/linux/init.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** init.c 13 Dec 2003 12:27:15 -0000 1.10 --- init.c 18 Jul 2004 18:39:31 -0000 1.11 *************** *** 40,44 **** /* FIXME: These prototypes should be removed... */ ! int hls_setsched(pid_t pid, int policy, struct sched_param *param); extern void HLSInit(void); extern void HLSDeinit (void); --- 40,44 ---- /* FIXME: These prototypes should be removed... */ ! int hls_setsched(struct task *p, int policy, struct sched_param *param); extern void HLSInit(void); extern void HLSDeinit (void); --- sched.c DELETED --- Index: hls_ctl.c =================================================================== RCS file: /cvsroot/linux-hls/hls/linux/hls_ctl.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** hls_ctl.c 14 Mar 2004 14:45:07 -0000 1.10 --- hls_ctl.c 18 Jul 2004 18:39:31 -0000 1.11 *************** *** 288,292 **** return -EINVAL; } ! return sched_p.sp.sched_priority; } --- 288,295 ---- return -EINVAL; } ! if ((sched_p.sp.sched_priority < 0) || (sched_p.sp.sched_priority > HLS_MAXIMUM_PRIORITY)){ ! return 0; ! } ! return sched_p.sp.sched_priority; } *************** *** 300,320 **** return -EFAULT; } - printk("Parse priority: %d\n", sched_p.sp.sched_priority); return sched_p.sp.sched_priority; } - static inline struct task_struct *find_process_by_pid(pid_t pid) - { - struct task_struct *tsk = current; - - if (pid) { - tsk = find_task_by_pid(pid); - } - - return tsk; - } - - /* Return value: * < 0 ---> Failure --- 303,310 ---- *************** *** 322,328 **** * > 0 ---> do the regular Linux thing... */ ! int hls_setsched(pid_t pid, int policy, struct sched_param *param) { - struct task_struct *p; unsigned long flags; char sp[HLS_PARMS_SIZE]; --- 312,317 ---- * > 0 ---> do the regular Linux thing... */ ! int hls_setsched(struct task_struct *p, int policy, struct sched_param *param) { unsigned long flags; char sp[HLS_PARMS_SIZE]; *************** *** 334,338 **** spin_lock_irqsave(&hls_lock, flags); - p = find_process_by_pid(pid); if (p == NULL) { spin_unlock_irqrestore(&hls_lock, flags); --- 323,326 ---- *************** *** 420,424 **** res = hls_ctl(p, s, sched_param, priority); - spin_unlock_irqrestore(&hls_lock, flags); --- 408,411 ---- |
From: Luca A. <lu...@us...> - 2004-07-18 10:40:50
|
Update of /cvsroot/linux-hls/hls/patches In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26246 Added Files: gensched2-2.4.25.patch tsc-2.4.25.patch Log Message: - Split the gensched patch in 2 parts - Modify the setsched & gensched hook to get a task struct instead of a pid as an input --- NEW FILE: gensched2-2.4.25.patch --- diff -ur ../linux-2.4.25/Makefile linux-2.4.25/Makefile --- ../linux-2.4.25/Makefile 2004-03-07 09:07:35.000000000 +0100 +++ linux-2.4.25/Makefile 2004-06-20 15:58:40.000000000 +0200 @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 4 SUBLEVEL = 25 -EXTRAVERSION = + EXTRAVERSION = -gensched KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) diff -ur ../linux-2.4.25/arch/i386/config.in linux-2.4.25/arch/i386/config.in --- ../linux-2.4.25/arch/i386/config.in 2004-03-07 09:08:19.000000000 +0100 +++ linux-2.4.25/arch/i386/config.in 2004-06-20 15:58:40.000000000 +0200 @@ -261,6 +261,8 @@ if [ "$CONFIG_SMP" = "y" -a "$CONFIG_X86_CMPXCHG" = "y" ]; then define_bool CONFIG_HAVE_DEC_LOCK y fi +#Added by Luca +bool 'Generic Scheduler' CONFIG_GENERIC_SCHEDULER endmenu mainmenu_option next_comment diff -ur ../linux-2.4.25/arch/ppc/config.in linux-2.4.25/arch/ppc/config.in --- ../linux-2.4.25/arch/ppc/config.in 2004-03-07 09:08:24.000000000 +0100 +++ linux-2.4.25/arch/ppc/config.in 2004-06-20 15:59:35.000000000 +0200 @@ -265,6 +265,9 @@ if [ "$CONFIG_8xx" = "y" -o "$CONFIG_8260" = "y" ]; then define_bool CONFIG_EMBEDDEDBOOT y fi + +#Added by Luca +bool 'Generic Scheduler' CONFIG_GENERIC_SCHEDULER endmenu mainmenu_option next_comment diff -ur ../linux-2.4.25/include/linux/sched.h linux-2.4.25/include/linux/sched.h --- ../linux-2.4.25/include/linux/sched.h 2004-03-07 09:07:41.000000000 +0100 +++ linux-2.4.25/include/linux/sched.h 2004-06-20 18:03:49.000000000 +0200 @@ -415,6 +415,9 @@ /* journalling filesystem info */ void *journal_info; +#ifdef CONFIG_GENERIC_SCHEDULER + void *private_data; +#endif /* CONFIG_GENERIC_SCHEDULER */ }; /* @@ -469,6 +472,12 @@ * INIT_TASK is used to set up the first task table, touch at * your own risk!. Base=0, limit=0x1fffff (=2MB) */ +#ifdef CONFIG_GENERIC_SCHEDULER +#define DATA_INIT private_data: NULL, +#else +#define DATA_INIT +#endif /* CONFIG_GENERIC_SCHEDULER */ + #define INIT_TASK(tsk) \ { \ state: 0, \ @@ -510,6 +519,7 @@ blocked: {{0}}, \ alloc_lock: SPIN_LOCK_UNLOCKED, \ journal_info: NULL, \ + DATA_INIT \ } @@ -806,6 +816,15 @@ extern long kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); +#ifdef CONFIG_GENERIC_SCHEDULER +extern void (*block_hook)(struct task_struct *tsk); +extern void (*unblock_hook)(struct task_struct *tsk); +extern void (*fork_hook)(struct task_struct *tsk); +extern void (*cleanup_hook)(struct task_struct *tsk); +extern int (*setsched_hook)(struct task_struct *p, int policy, struct sched_param *param); +extern int (*getsched_hook)(struct task_struct *p, struct sched_param *param); +#endif /* CONFIG_GENERIC_SCHEDULER */ + #define __wait_event(wq, condition) \ do { \ wait_queue_t __wait; \ @@ -897,6 +916,11 @@ p->sleep_time = jiffies; list_del(&p->run_list); p->run_list.next = NULL; +#ifdef CONFIG_GENERIC_SCHEDULER + if ((block_hook != NULL) && (p->private_data != NULL)) { + block_hook(p); + } +#endif /* CONFIG_GENERIC_SCHEDULER */ } static inline int task_on_runqueue(struct task_struct *p) diff -ur ../linux-2.4.25/kernel/exit.c linux-2.4.25/kernel/exit.c --- ../linux-2.4.25/kernel/exit.c 2004-03-07 09:07:40.000000000 +0100 +++ linux-2.4.25/kernel/exit.c 2004-06-20 15:58:40.000000000 +0200 @@ -21,6 +21,10 @@ #include <asm/pgtable.h> #include <asm/mmu_context.h> +#ifdef CONFIG_GENERIC_SCHEDULER +void (*cleanup_hook)(struct task_struct *tsk); +#endif /* CONFIG_GENERIC_SCHEDULER */ + extern void sem_exit (void); extern struct task_struct *child_reaper; @@ -443,6 +447,14 @@ lock_kernel(); sem_exit(); + +#ifdef CONFIG_GENERIC_SCHEDULER + /* Is this the correct place for this hook? */ + if (cleanup_hook != NULL) { + cleanup_hook(tsk); + } +#endif + __exit_files(tsk); __exit_fs(tsk); exit_namespace(tsk); diff -ur ../linux-2.4.25/kernel/fork.c linux-2.4.25/kernel/fork.c --- ../linux-2.4.25/kernel/fork.c 2004-03-07 09:07:40.000000000 +0100 +++ linux-2.4.25/kernel/fork.c 2004-06-20 15:58:40.000000000 +0200 @@ -29,6 +29,10 @@ #include <asm/mmu_context.h> #include <asm/processor.h> +#ifdef CONFIG_GENERIC_SCHEDULER +void (*fork_hook)(struct task_struct *tsk); +#endif /* CONFIG_GENERIC_SCHEDULER */ + /* The idle threads do not count.. */ int nr_threads; int nr_running; @@ -779,6 +783,13 @@ if (!current->counter) current->need_resched = 1; +#ifdef CONFIG_GENERIC_SCHEDULER + p->private_data = NULL; + if (fork_hook != NULL) { + fork_hook(p); + } +#endif /* CONFIG_GENERIC_SCHEDULER */ + /* * Ok, add it to the run-queues and make it * visible to the rest of the system. diff -ur ../linux-2.4.25/kernel/ksyms.c linux-2.4.25/kernel/ksyms.c --- ../linux-2.4.25/kernel/ksyms.c 2004-03-07 09:07:40.000000000 +0100 +++ linux-2.4.25/kernel/ksyms.c 2004-06-20 15:58:40.000000000 +0200 @@ -619,6 +619,17 @@ /* debug */ EXPORT_SYMBOL(dump_stack); +#ifdef CONFIG_GENERIC_SCHEDULER +extern struct task_struct * init_tasks[NR_CPUS]; +EXPORT_SYMBOL_GPL(init_tasks); +EXPORT_SYMBOL_GPL(block_hook); +EXPORT_SYMBOL_GPL(unblock_hook); +EXPORT_SYMBOL_GPL(fork_hook); +EXPORT_SYMBOL_GPL(cleanup_hook); +EXPORT_SYMBOL_GPL(setsched_hook); +EXPORT_SYMBOL_GPL(getsched_hook); +#endif /* CONFIG_GENERIC_SCHEDULER */ + /* To match ksyms with System.map */ extern const char _end[]; EXPORT_SYMBOL(_end); diff -ur ../linux-2.4.25/kernel/sched.c linux-2.4.25/kernel/sched.c --- ../linux-2.4.25/kernel/sched.c 2004-03-07 09:07:40.000000000 +0100 +++ linux-2.4.25/kernel/sched.c 2004-06-20 18:02:35.000000000 +0200 @@ -33,6 +33,13 @@ #include <asm/uaccess.h> #include <asm/mmu_context.h> +#ifdef CONFIG_GENERIC_SCHEDULER +void (*block_hook)(struct task_struct *tsk); +void (*unblock_hook)(struct task_struct *tsk); +int (*setsched_hook)(struct task_struct *p, int policy, struct sched_param *param); +int (*getsched_hook)(struct task_struct *p, struct sched_param *param); +#endif /* CONFIG_GENERIC_SCHEDULER */ + extern void timer_bh(void); extern void tqueue_bh(void); extern void immediate_bh(void); @@ -330,6 +337,11 @@ { list_add_tail(&p->run_list, &runqueue_head); nr_running++; +#ifdef CONFIG_GENERIC_SCHEDULER + if ((unblock_hook != NULL) && (p->private_data != NULL)) { + unblock_hook(p); + } +#endif /* CONFIG_GENERIC_SCHEDULER */ } static inline void move_last_runqueue(struct task_struct * p) @@ -961,6 +973,16 @@ if (!p) goto out_unlock; +#ifdef CONFIG_GENERIC_SCHEDULER + if (setsched_hook != NULL) { + int res; + + res = setsched_hook(p, -1, param); + if (res <= 0) { + return res; + } + } +#endif if (policy < 0) policy = p->policy; else { @@ -1048,6 +1070,16 @@ retval = -ESRCH; if (!p) goto out_unlock; +#ifdef CONFIG_GENERIC_SCHEDULER + if (getsched_hook != NULL) { + int res; + + res = getsched_hook(p, param); + if (res <= 0) { + return res; + } + } +#endif lp.sched_priority = p->rt_priority; read_unlock(&tasklist_lock); --- NEW FILE: tsc-2.4.25.patch --- diff -ur linux-2.4.25/arch/i386/kernel/i386_ksyms.c linux-2.4.25-gensched/arch/i386/kernel/i386_ksyms.c --- linux-2.4.25/arch/i386/kernel/i386_ksyms.c 2004-02-18 14:36:30.000000000 +0100 +++ linux-2.4.25-gensched/arch/i386/kernel/i386_ksyms.c 2004-02-29 22:41:05.000000000 +0100 @@ -187,3 +187,10 @@ EXPORT_SYMBOL(eddnr); EXPORT_SYMBOL(edd_disk80_sig); #endif + +#ifdef CONFIG_GENERIC_SCHEDULER +extern unsigned long fast_gettimeoffset_quotient; +extern unsigned long cpu_khz; +EXPORT_SYMBOL_GPL(cpu_khz); +EXPORT_SYMBOL_GPL(fast_gettimeoffset_quotient); +#endif /* CONFIG_GENERIC_SCHEDULER */ diff -ur linux-2.4.25/arch/ppc/kernel/time.c linux-2.4.25-gensched/arch/ppc/kernel/time.c --- linux-2.4.25/arch/ppc/kernel/time.c 2003-08-25 13:44:40.000000000 +0200 +++ linux-2.4.25-gensched/arch/ppc/kernel/time.c 2004-02-29 22:35:36.000000000 +0100 @@ -90,6 +90,10 @@ EXPORT_SYMBOL(rtc_lock); +#ifdef CONFIG_GENERIC_SCHEDULER +EXPORT_SYMBOL_GPL(tb_to_us); +#endif + /* Timer interrupt helper function */ static inline int tb_delta(unsigned *jiffy_stamp) { int delta; |