linux-hls-cvs Mailing List for Hierarchical Loadable Schedulers (Page 3)
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: <lu...@us...> - 2003-11-29 11:59:04
|
Update of /cvsroot/linux-hls/hls/hls
In directory sc8-pr-cvs1:/tmp/cvs-serv4847/hls
Modified Files:
hls_hooks.c
Log Message:
Fix problem when rmmoving hls_module...
Index: hls_hooks.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/hls/hls_hooks.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** hls_hooks.c 8 Nov 2003 10:34:31 -0000 1.7
--- hls_hooks.c 29 Nov 2003 11:59:00 -0000 1.8
***************
*** 330,333 ****
--- 330,336 ----
HLS_ASSERT (HLSInitState == 1);
HLS_ASSERT (current_task() == Thread);
+ if (current_task() != Thread) {
+ hls_printk("Current Task: %d\tThread: %d\n", current_task()->pid, Thread->pid);
+ }
#ifdef HLS_DEBUG
***************
*** 362,364 ****
--- 365,393 ----
t->CurProc = NO_PROC;
whereami = 0;
+ }
+
+ void hls_block_other_thread(PRKTHREAD Thread)
+ {
+ struct TH_INSTANCE_DATA *t;
+
+ if (whereami != 0) {
+ hls_hard_printk("HLSBlockThreadHook --- WAI = %d [%d]\n", whereami, Thread->pid);
+ hls_printk("HLSBlockThreadHook --- WAI = %d [%d]\n", whereami, Thread->pid);
+ hls_panic("Entering HLSBlockThreadHook with WAI != 0\n");
+ }
+
+ whereami = 6;
+ HLS_ASSERT (HLSInitState == 1);
+
+ t = HLSFindThread(Thread);
+ HLS_ASSERT (t);
+
+ 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);
+ t->CurProc = NO_PROC;
+ whereami = 0;
}
|
|
From: <lu...@us...> - 2003-11-29 09:11:39
|
Update of /cvsroot/linux-hls/hls/simul/include
In directory sc8-pr-cvs1:/tmp/cvs-serv14351/simul/include
Modified Files:
bitfields.h event.h heap.h interface-data.h interface-funcs.h
os.h sim.h
Log Message:
- Some cleanup & code reorganization
- Fix the simulator's compilation
- Better logging macros for the simulator backend
Index: bitfields.h
===================================================================
RCS file: /cvsroot/linux-hls/hls/simul/include/bitfields.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** bitfields.h 25 Feb 2003 09:18:58 -0000 1.3
--- bitfields.h 29 Nov 2003 09:11:35 -0000 1.4
***************
*** 9,12 ****
--- 9,15 ----
*/
+ #ifndef __BITFIELDS_H__
+ #define __BITFIELDS_H__
+
/* This is clearly a hack! */
extern unsigned char KiFindLeftNibbleBitTable[];
***************
*** 41,43 ****
} /*lint --e(717)*/ while (0);
!
--- 44,46 ----
} /*lint --e(717)*/ while (0);
! #endif /* __BITFIELDS_H__ */
Index: event.h
===================================================================
RCS file: /cvsroot/linux-hls/hls/simul/include/event.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** event.h 25 Feb 2003 09:18:58 -0000 1.4
--- event.h 29 Nov 2003 09:11:35 -0000 1.5
***************
*** 9,12 ****
--- 9,15 ----
*/
+ #ifndef __EVENT_H__
+ #define __EVENT_H__
+
#define EVENT_TYPE_INITIALIZE 1
#define EVENT_TYPE_SHUTDOWN 2
***************
*** 57,59 ****
struct sim_event *new_event(int type, int proc);
void insert_event(struct sim_event *event, long long int etime);
! long long int process_event(struct eventq_elt *eq);
--- 60,63 ----
struct sim_event *new_event(int type, int proc);
void insert_event(struct sim_event *event, long long int etime);
!
! #endif /* __EVENT_H__ */
Index: heap.h
===================================================================
RCS file: /cvsroot/linux-hls/hls/simul/include/heap.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** heap.h 25 Feb 2003 09:18:58 -0000 1.3
--- heap.h 29 Nov 2003 09:11:35 -0000 1.4
***************
*** 9,12 ****
--- 9,15 ----
*/
+ #ifndef __HEAP_H__
+ #define __HEAP_H__
+
struct eventq_elt {
long long int key;
***************
*** 23,24 ****
--- 26,31 ----
void event_list_insert(long long int key, void *ptr);
void event_list_remove(void *ptr);
+
+ long long int process_event(struct eventq_elt *eq);
+
+ #endif /* __HEAP_H__ */
Index: interface-data.h
===================================================================
RCS file: /cvsroot/linux-hls/hls/simul/include/interface-data.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** interface-data.h 25 Feb 2003 09:18:58 -0000 1.3
--- interface-data.h 29 Nov 2003 09:11:35 -0000 1.4
***************
*** 18,22 ****
--- 18,26 ----
typedef long long _int64;
+ #if 0
typedef _int64 WNT_TIME; /* FIXME: This must be removed! */
+ #else
+ typedef long int WNT_TIME; /* FIXME: This must be removed! */
+ #endif
#define MAXIMUM_PROCESSORS 32
***************
*** 24,28 ****
#define PROCT ULONG
#define KPRIORITY int
! #define MAXIMUM_PRIORITY 32 /* FIXME: Shouldn't this go in rr.h??? */
#define CONTAINING_RECORD(address, type, field) ((type *)( \
--- 28,32 ----
#define PROCT ULONG
#define KPRIORITY int
! #define HLS_MAXIMUM_PRIORITY 32 /* FIXME: Shouldn't this go in rr.h??? */
#define CONTAINING_RECORD(address, type, field) ((type *)( \
***************
*** 77,80 ****
--- 81,91 ----
*/
};
+
+ typedef enum _HLS_BOOL {
+ HLS_FALSE = 0, HLS_TRUE = 0x600 // don't change this value
+ } HLS_BOOL;
+ typedef enum _HLS_STATUS {
+ HLS_SUCCESS = 0xadd0, HLS_NOROOM, HLS_INVALID_PARAMETER
+ } HLS_STATUS;
Index: interface-funcs.h
===================================================================
RCS file: /cvsroot/linux-hls/hls/simul/include/interface-funcs.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** interface-funcs.h 25 Feb 2003 09:18:58 -0000 1.3
--- interface-funcs.h 29 Nov 2003 09:11:35 -0000 1.4
***************
*** 26,33 ****
} while(0);
! #define hls_printk printf
! #define hls_hard_printk printf
! #define DbgPrint printf
#define hls_panic sim_panic
--- 26,33 ----
} while(0);
! #define hls_printk(...) fprintf(stderr, __VA_ARGS__)
! #define hls_hard_printk(...) fprintf(stderr, __VA_ARGS__)
! #define DbgPrint(...) fprintf(stderr, __VA_ARGS__)
#define hls_panic sim_panic
Index: os.h
===================================================================
RCS file: /cvsroot/linux-hls/hls/simul/include/os.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** os.h 25 Feb 2003 09:18:58 -0000 1.4
--- os.h 29 Nov 2003 09:11:35 -0000 1.5
***************
*** 9,12 ****
--- 9,15 ----
*/
+ #ifndef __OS_H__
+ #define __OS_H__
+
int random_priority(void);
struct sim_task_struct *make_new_thread(long long int create_time,
***************
*** 23,24 ****
--- 26,28 ----
void scheduler_set_default(char *mstr);
+ #endif /* __OS_H__ */
Index: sim.h
===================================================================
RCS file: /cvsroot/linux-hls/hls/simul/include/sim.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** sim.h 25 Feb 2003 09:18:58 -0000 1.7
--- sim.h 29 Nov 2003 09:11:35 -0000 1.8
***************
*** 9,12 ****
--- 9,15 ----
*/
+ #ifndef __SIM_H__
+ #define __SIM_H__
+
#define SIM_MAX_THREADS 6000
***************
*** 34,37 ****
#define sim_printf printf
#else
! #define sim_printf(a, ...)
#endif
--- 37,42 ----
#define sim_printf printf
#else
! #define sim_printf(...)
#endif
+
+ #endif /* __SIM_H__ */
|
|
From: <lu...@us...> - 2003-11-29 09:11:39
|
Update of /cvsroot/linux-hls/hls/simul
In directory sc8-pr-cvs1:/tmp/cvs-serv14351/simul
Modified Files:
Makefile sim.c sim_events.c sim_os.c
Log Message:
- Some cleanup & code reorganization
- Fix the simulator's compilation
- Better logging macros for the simulator backend
Index: Makefile
===================================================================
RCS file: /cvsroot/linux-hls/hls/simul/Makefile,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** Makefile 25 Feb 2003 09:18:55 -0000 1.11
--- Makefile 29 Nov 2003 09:11:35 -0000 1.12
***************
*** 8,12 ****
#CPPFLAGS += -DVERBOSE
! #DEBUG = -lefence
CFLAGS += -g
CPPFLAGS += -DHLS_DEBUG=10
--- 8,12 ----
#CPPFLAGS += -DVERBOSE
! DEBUG = -lefence
CFLAGS += -g
CPPFLAGS += -DHLS_DEBUG=10
Index: sim.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/simul/sim.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** sim.c 25 Feb 2003 09:18:57 -0000 1.9
--- sim.c 29 Nov 2003 09:11:35 -0000 1.10
***************
*** 66,72 ****
static void sim_deinit (void)
{
struct eventq_elt qe;
- #if 0
for (;;) {
HeapExtractMin(&qe);
--- 66,72 ----
static void sim_deinit (void)
{
+ #if 0
struct eventq_elt qe;
for (;;) {
HeapExtractMin(&qe);
Index: sim_events.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/simul/sim_events.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** sim_events.c 25 Feb 2003 09:18:57 -0000 1.13
--- sim_events.c 29 Nov 2003 09:11:35 -0000 1.14
***************
*** 13,16 ****
--- 13,17 ----
#include "interface-data.h"
+ #include "hls_common.h"
#include "data.h"
#include "sim.h"
***************
*** 19,22 ****
--- 20,25 ----
#include "os.h"
+ #include "workload.h"
+
/* TODO: Check all of these!!! */
long long int max_blocking_time;
***************
*** 160,164 ****
{
if (ot != NULL) {
! sim_printf("Next Task Event: sim_state = %d total_remaining_cpu_time = %d\n", ot->sim_state, ot->total_remaining_cpu_time);
#if 0
if ((ot->sim_state != THREAD_SM_ENDED) && (ot->sim_state != THREAD_SM_NEVERENDING)) {
--- 163,168 ----
{
if (ot != NULL) {
! sim_printf("Next Task Event: sim_state = %d total_remaining_cpu_time = %lld\n",
! ot->sim_state, ot->total_remaining_cpu_time);
#if 0
if ((ot->sim_state != THREAD_SM_ENDED) && (ot->sim_state != THREAD_SM_NEVERENDING)) {
Index: sim_os.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/simul/sim_os.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** sim_os.c 25 Feb 2003 09:18:57 -0000 1.8
--- sim_os.c 29 Nov 2003 09:11:35 -0000 1.9
***************
*** 192,200 ****
void thread_end(struct sim_task_struct *t, long long int time)
{
! struct sim_event *e;
t->sim_state = THREAD_SM_ENDED;
HLSExitThreadHook(t);
! // make_new_thread(time + 1 + (sim_rand() % 100000));
sim_thread_count--;
/* swap_thread(); Not Needed */
--- 192,200 ----
void thread_end(struct sim_task_struct *t, long long int time)
{
! /* struct sim_event *e; */
t->sim_state = THREAD_SM_ENDED;
HLSExitThreadHook(t);
! /* make_new_thread(time + 1 + (sim_rand() % 100000)); */
sim_thread_count--;
/* swap_thread(); Not Needed */
|
|
From: <lu...@us...> - 2003-11-29 09:11:38
|
Update of /cvsroot/linux-hls/hls/linux
In directory sc8-pr-cvs1:/tmp/cvs-serv14351/linux
Modified Files:
Makefile hls_ctl.c init.c procfs.c
Log Message:
- Some cleanup & code reorganization
- Fix the simulator's compilation
- Better logging macros for the simulator backend
Index: Makefile
===================================================================
RCS file: /cvsroot/linux-hls/hls/linux/Makefile,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Makefile 25 Nov 2002 11:33:32 -0000 1.6
--- Makefile 29 Nov 2003 09:11:35 -0000 1.7
***************
*** 24,28 ****
OBJS = hls_sched_th.o hls_hooks.o hls_sched_root.o hls_sched_join.o \
! hls_utils.o hls_ctl.o hls_timers.o hls_debug.o \
init.o bottom.o misc.o procfs.o
--- 24,28 ----
OBJS = hls_sched_th.o hls_hooks.o hls_sched_root.o hls_sched_join.o \
! hls_utils.o hls_names.o hls_ctl.o hls_timers.o hls_debug.o \
init.o bottom.o misc.o procfs.o
Index: hls_ctl.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/linux/hls_ctl.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** hls_ctl.c 8 Nov 2003 10:34:32 -0000 1.8
--- hls_ctl.c 29 Nov 2003 09:11:35 -0000 1.9
***************
*** 10,19 ****
*/
! #include "hls_common.h"
! #include "hls_internal.h"
! #include "thr.h"
! #include "hls.h"
! #include "hls_hooks.h"
--- 10,19 ----
*/
! #include <hls_common.h>
! #include <hls_internal.h>
! #include <thr.h>
! #include <hls.h>
! #include <hls_hooks.h>
Index: init.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/linux/init.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** init.c 8 Nov 2003 10:34:32 -0000 1.7
--- init.c 29 Nov 2003 09:11:35 -0000 1.8
***************
*** 39,45 ****
MODULE_LICENSE("GPL");
int hls_setsched(pid_t pid, int policy, struct sched_param *param);
-
-
extern void HLSInit(void);
extern void HLSDeinit (void);
--- 39,44 ----
MODULE_LICENSE("GPL");
+ /* 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);
Index: procfs.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/linux/procfs.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** procfs.c 8 Nov 2003 10:34:32 -0000 1.7
--- procfs.c 29 Nov 2003 09:11:35 -0000 1.8
***************
*** 22,27 ****
#include <linux/slab.h>
! #include "data.h"
! #include "interface-data.h"
#include <hls_internal.h>
--- 22,27 ----
#include <linux/slab.h>
! #include <data.h>
! #include <interface-data.h>
#include <hls_internal.h>
***************
*** 31,34 ****
--- 31,35 ----
*instances_file, *tasks_file, *default_file, *rt_file;
+ #if 0
extern char *hls_scheduler_name(int i);
extern char *hls_instance_name(int i);
***************
*** 40,43 ****
--- 41,45 ----
extern void SetDefPriForSched(char Pri, struct HLS_SCHED_INSTANCE *Inst);
extern int hls_setparam_ascii(struct HLS_SCHED_INSTANCE *inst, char *param);
+ #endif
static int hls_proc_read_rt(char *p, char **s, off_t o,
|
|
From: <lu...@us...> - 2003-11-29 09:11:38
|
Update of /cvsroot/linux-hls/hls/hls/include In directory sc8-pr-cvs1:/tmp/cvs-serv14351/hls/include Modified Files: hls_internal.h Log Message: - Some cleanup & code reorganization - Fix the simulator's compilation - Better logging macros for the simulator backend Index: hls_internal.h =================================================================== RCS file: /cvsroot/linux-hls/hls/hls/include/hls_internal.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** hls_internal.h 8 Nov 2003 10:34:31 -0000 1.3 --- hls_internal.h 29 Nov 2003 09:11:35 -0000 1.4 *************** *** 41,62 **** ! extern char *ReasonStr(HLS_READY_REASON r); ! extern int ThreadListCount(PRKTHREAD T, PRLIST_ENTRY l); ! extern void HLSInit(void); ! extern void HLSDeinit(void); ! extern HLS_BOOL HLSDispatcherLockHeld(void); ! extern struct HLS_SCHED_INSTANCE *HLSNewSchedInstance(char *SchedName, char *InstName, struct HLS_SCHED_INSTANCE *Parent); ! extern void hls_malloc_stats(void); ! extern void HLSDestroySchedInstance(struct HLS_SCHED_INSTANCE *Inst); ! extern void HLSScheduleThread(PRKTHREAD Thread, PROCT Proc); ! extern HLS_STATUS HLSSetPri(PRKTHREAD Thread, KPRIORITY Priority); ! extern int ThreadReadyCount(PRKTHREAD Thread); ! extern void SetDefPriForSched(char Pri, struct HLS_SCHED_INSTANCE *Inst); ! extern struct HLS_SCHED_INSTANCE *HLSFindInstByName(char *Name); ! extern char *hls_rt_name(void); ! extern char *hls_default_name(void); ! extern void hls_setdefault(void *p); ! extern void hls_setrt(void *p); ! extern void hls_convert_tasks(void); #endif /* _HLS_H_ */ --- 41,70 ---- ! char *ReasonStr(HLS_READY_REASON r); ! int ThreadListCount(PRKTHREAD T, PRLIST_ENTRY l); ! void HLSInit(void); ! void HLSDeinit(void); ! HLS_BOOL HLSDispatcherLockHeld(void); ! struct HLS_SCHED_INSTANCE *HLSNewSchedInstance(char *SchedName, ! char *InstName, struct HLS_SCHED_INSTANCE *Parent); ! void hls_malloc_stats(void); ! void HLSDestroySchedInstance(struct HLS_SCHED_INSTANCE *Inst); ! void HLSScheduleThread(PRKTHREAD Thread, PROCT Proc); ! HLS_STATUS HLSSetPri(PRKTHREAD Thread, KPRIORITY Priority); ! int ThreadReadyCount(PRKTHREAD Thread); ! void SetDefPriForSched(char Pri, struct HLS_SCHED_INSTANCE *Inst); ! struct HLS_SCHED_INSTANCE *HLSFindInstByName(char *Name); ! char *hls_rt_name(void); ! char *hls_default_name(void); ! void hls_setdefault(void *p); ! void hls_setrt(void *p); ! void hls_convert_tasks(void); ! ! /* These are needed by procfs.c */ ! char *hls_scheduler_name(int i); ! char *hls_instance_name(int i); ! char *hls_instance_scheduler(int i); ! char *hls_instance_father(int i); ! int hls_setparam_ascii(struct HLS_SCHED_INSTANCE *inst, char *param); #endif /* _HLS_H_ */ |
|
From: <lu...@us...> - 2003-11-29 09:11:38
|
Update of /cvsroot/linux-hls/hls/hls
In directory sc8-pr-cvs1:/tmp/cvs-serv14351/hls
Modified Files:
hls_utils.c
Added Files:
hls_names.c
Log Message:
- Some cleanup & code reorganization
- Fix the simulator's compilation
- Better logging macros for the simulator backend
--- NEW FILE: hls_names.c ---
/*
* Copyright (c) 2003 Luca Abeni
*
* Module Name: hls_names.c
* Abstract: HLS utility functions needed by the procfs stuff.
* Author: Luca Abeni 20-Nov-2003
*
* This is free software; see BSD.txt
*/
#include "hls_common.h"
#include "hls_internal.h"
#include "thr.h"
extern struct HLS_CALLBACKS *HLSAbsScheds[HLS_MAX_ABS_SCHEDS];
char *hls_default_name(void)
{
if (HLSDefaultSched == NULL) {
return "";
}
HLSDbgPrint(5, ("Default %p: %s\n", HLSDefaultSched, HLSDefaultSched->Name));
return HLSDefaultSched->Name;
}
void hls_setdefault(void *p)
{
int wasnull;
wasnull = 0;
if (HLSDefaultSched == NULL) {
wasnull =1;
}
HLSDefaultSched = p;
if (wasnull) {
hls_convert_tasks();
}
}
char *hls_rt_name(void)
{
if (hls_rt_sched == NULL) {
return "";
}
HLSDbgPrint(5, ("RT Scheduler %p: %s\n",
hls_rt_sched, hls_rt_sched->Name));
return hls_rt_sched->Name;
}
void hls_setrt(void *p)
{
hls_rt_sched = p;
}
char *hls_instance_name(int i)
{
if (i >= HLS_MAX_SCHED_INSTS) {
return (char *)-1;
}
if (!HLSAllSchedInsts[i]) {
return NULL;
}
return HLSAllSchedInsts[i]->Name;
}
char *hls_instance_scheduler(int i)
{
if (i >= HLS_MAX_SCHED_INSTS) {
return (char *)-1;
}
if (!HLSAllSchedInsts[i]) {
return NULL;
}
return HLSAllSchedInsts[i]->Type;
}
char *hls_instance_father(int i)
{
if (i >= HLS_MAX_SCHED_INSTS) {
return (char *)-1;
}
if (!HLSAllSchedInsts[i]) {
return NULL;
}
if (HLSAllSchedInsts[i]->Parent) {
return HLSAllSchedInsts[i]->Parent->Name;
}
return "";
}
char *hls_scheduler_name(int i)
{
if (i >= HLS_MAX_ABS_SCHEDS) {
return (char *)-1;
}
if (!HLSAbsScheds[i]) {
return NULL;
}
return HLSAbsScheds[i]->Name;
}
Index: hls_utils.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/hls/hls_utils.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** hls_utils.c 8 Nov 2003 10:34:31 -0000 1.15
--- hls_utils.c 29 Nov 2003 09:11:34 -0000 1.16
***************
*** 199,289 ****
}
- char *hls_default_name(void)
- {
- if (HLSDefaultSched == NULL) {
- return "";
- }
-
- HLSDbgPrint(5, ("Default %p: %s\n", HLSDefaultSched, HLSDefaultSched->Name));
- return HLSDefaultSched->Name;
- }
- void hls_setdefault(void *p)
- {
- int wasnull;
-
- wasnull = 0;
- if (HLSDefaultSched == NULL) {
- wasnull =1;
- }
- HLSDefaultSched = p;
- if (wasnull) {
- hls_convert_tasks();
- }
- }
- char *hls_rt_name(void)
- {
- if (hls_rt_sched == NULL) {
- return "";
- }
-
- HLSDbgPrint(5, ("RT Scheduler %p: %s\n",
- hls_rt_sched, hls_rt_sched->Name));
-
- return hls_rt_sched->Name;
- }
- void hls_setrt(void *p)
- {
- hls_rt_sched = p;
- }
-
- char *hls_instance_name(int i)
- {
- if (i >= HLS_MAX_SCHED_INSTS) {
- return (char *)-1;
- }
-
- if (!HLSAllSchedInsts[i]) {
- return NULL;
- }
- return HLSAllSchedInsts[i]->Name;
- }
- char *hls_instance_scheduler(int i)
- {
- if (i >= HLS_MAX_SCHED_INSTS) {
- return (char *)-1;
- }
-
- if (!HLSAllSchedInsts[i]) {
- return NULL;
- }
- return HLSAllSchedInsts[i]->Type;
- }
- char *hls_instance_father(int i)
- {
- if (i >= HLS_MAX_SCHED_INSTS) {
- return (char *)-1;
- }
-
- if (!HLSAllSchedInsts[i]) {
- return NULL;
- }
- if (HLSAllSchedInsts[i]->Parent) {
- return HLSAllSchedInsts[i]->Parent->Name;
- }
-
- return "";
- }
- char *hls_scheduler_name(int i)
- {
- if (i >= HLS_MAX_ABS_SCHEDS) {
- return (char *)-1;
- }
-
- if (!HLSAbsScheds[i]) {
- return NULL;
- }
- return HLSAbsScheds[i]->Name;
- }
-
HLS_STATUS HLSUnregisterScheduler (struct HLS_CALLBACKS *NewSchedCB)
{
--- 199,202 ----
***************
*** 430,434 ****
}
! extern int hls_setparam_ascii(struct HLS_SCHED_INSTANCE *inst, char *param);
static void CreateSimpleHierarchy (void)
{
--- 343,347 ----
}
! //extern int hls_setparam_ascii(struct HLS_SCHED_INSTANCE *inst, char *param);
static void CreateSimpleHierarchy (void)
{
|
|
From: <lu...@us...> - 2003-11-08 10:34:45
|
Update of /cvsroot/linux-hls/hls/hls/include
In directory sc8-pr-cvs1:/tmp/cvs-serv6094/hls/include
Modified Files:
hls_interface.h hls_internal.h rsv.h
Added Files:
hls_hooks.h
Log Message:
Lot of changes....
- Unbreak the debugging stuff
- Some random cleanups
- Fixes in the RR scheduler (I hope... MAXIMUM_PRIORITY does not seem to be
a valid priority)
- Allow the RES scheduler to be scheduled (there's a fixme: some functions
still have to be properly implemented)
- change Q e T from long long to long in the RES scheduler
- Implement the "rt scheduler" stuff
--- NEW FILE: hls_hooks.h ---
#ifndef __HLS_HOOKS_H__
#define __HLS_HOOKS_H__
extern void HLSExitThreadHook(PRKTHREAD Thread);
extern void HLSCreateThreadHook(PRKTHREAD Thread, KTHREAD_STATE State);
extern void HLSBlockThreadHook(PRKTHREAD Thread);
extern void HLSUnblockThreadHook(PRKTHREAD Thread);
#endif /* __HLS_HOOKS_H__ */
Index: hls_interface.h
===================================================================
RCS file: /cvsroot/linux-hls/hls/hls/include/hls_interface.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** hls_interface.h 25 Feb 2003 09:18:54 -0000 1.2
--- hls_interface.h 8 Nov 2003 10:34:31 -0000 1.3
***************
*** 11,14 ****
--- 11,16 ----
#ifndef __HLS_INTERFACE__
#define __HLS_INTERFACE__
+
+ #if 0
/*
* README
***************
*** 25,37 ****
#define HLS_DEBUG 0
#endif /* HLS_DEBUG */
!
#include <interface-funcs.h>
#include <interface-data.h>
- typedef enum _HLS_STATUS {
- HLS_SUCCESS = 0xadd0, HLS_NOROOM, HLS_INVALID_PARAMETER
- } HLS_STATUS;
-
#define MAX_NAMELEN 20
--- 27,35 ----
#define HLS_DEBUG 0
#endif /* HLS_DEBUG */
! #endif
#include <interface-funcs.h>
#include <interface-data.h>
#define MAX_NAMELEN 20
***************
*** 146,152 ****
- typedef enum _HLS_BOOL {
- HLS_FALSE = 0, HLS_TRUE = 0x600 // don't change this value
- } HLS_BOOL;
#define MAX_PROCS ((PROCT)MAXIMUM_PROCESSORS)
--- 144,147 ----
Index: hls_internal.h
===================================================================
RCS file: /cvsroot/linux-hls/hls/hls/include/hls_internal.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** hls_internal.h 25 Feb 2003 09:18:54 -0000 1.2
--- hls_internal.h 8 Nov 2003 10:34:31 -0000 1.3
***************
*** 32,35 ****
--- 32,36 ----
extern ULONG HLSNumScheds;
extern struct HLS_SCHED_INSTANCE *HLSDefaultSched;
+ extern struct HLS_SCHED_INSTANCE *hls_rt_sched;
#ifdef ADJUST
***************
*** 46,53 ****
extern HLS_BOOL HLSDispatcherLockHeld(void);
extern struct HLS_SCHED_INSTANCE *HLSNewSchedInstance(char *SchedName, char *InstName, struct HLS_SCHED_INSTANCE *Parent);
- extern void HLSExitThreadHook(PRKTHREAD Thread);
- extern void HLSCreateThreadHook(PRKTHREAD Thread, KTHREAD_STATE State);
- extern void HLSBlockThreadHook(PRKTHREAD Thread);
- extern void HLSUnblockThreadHook(PRKTHREAD Thread);
extern void hls_malloc_stats(void);
extern void HLSDestroySchedInstance(struct HLS_SCHED_INSTANCE *Inst);
--- 47,50 ----
***************
*** 57,60 ****
--- 54,62 ----
extern void SetDefPriForSched(char Pri, struct HLS_SCHED_INSTANCE *Inst);
extern struct HLS_SCHED_INSTANCE *HLSFindInstByName(char *Name);
+ extern char *hls_rt_name(void);
+ extern char *hls_default_name(void);
+ extern void hls_setdefault(void *p);
+ extern void hls_setrt(void *p);
+ extern void hls_convert_tasks(void);
#endif /* _HLS_H_ */
Index: rsv.h
===================================================================
RCS file: /cvsroot/linux-hls/hls/hls/include/rsv.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** rsv.h 25 Feb 2003 09:18:54 -0000 1.3
--- rsv.h 8 Nov 2003 10:34:31 -0000 1.4
***************
*** 15,20 ****
HLS_BOOL BeginRes;
HLS_BOOL Soft;
! WNT_TIME Amount;
! WNT_TIME Period;
/* HANDLE UserThreadHandle; */
};
--- 15,20 ----
HLS_BOOL BeginRes;
HLS_BOOL Soft;
! unsigned long int Amount;
! unsigned long int Period;
/* HANDLE UserThreadHandle; */
};
|
|
From: <lu...@us...> - 2003-11-08 10:34:36
|
Update of /cvsroot/linux-hls/hls/linux
In directory sc8-pr-cvs1:/tmp/cvs-serv6094/linux
Modified Files:
bottom.c hls_ctl.c hls_timers.c init.c procfs.c
Added Files:
bottom.h procfs.h
Log Message:
Lot of changes....
- Unbreak the debugging stuff
- Some random cleanups
- Fixes in the RR scheduler (I hope... MAXIMUM_PRIORITY does not seem to be
a valid priority)
- Allow the RES scheduler to be scheduled (there's a fixme: some functions
still have to be properly implemented)
- change Q e T from long long to long in the RES scheduler
- Implement the "rt scheduler" stuff
--- NEW FILE: bottom.h ---
#ifndef __BOTTOM_H__
#define __BOTTOM_H__
extern void hls_bottom_vp_request(struct task_struct *t);
extern void hls_bottom_vp_release(struct task_struct *t);
extern void hls_bottom_vp_register(struct task_struct *t);
extern void hls_bottom_vp_unregister(struct task_struct *t);
#endif /* __BOTTOM_H__ */
--- NEW FILE: procfs.h ---
#ifndef __PROCFS_H__
#define __PROCFS_H__
int hls_proc_init(void);
void hls_proc_cleanup(void);
#endif /* __PROCFS_H__ */
Index: bottom.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/linux/bottom.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** bottom.c 28 Aug 2003 19:52:23 -0000 1.8
--- bottom.c 8 Nov 2003 10:34:32 -0000 1.9
***************
*** 16,21 ****
#include <linux/sched.h>
! #include <hls.h>
! #include <interface-data.h>
#ifndef CONFIG_GENERIC_SCHEDULER
--- 16,24 ----
#include <linux/sched.h>
! #include "data.h"
! #include "interface-data.h"
! #include "hls_hooks.h"
! #include "bottom.h"
! #include "hls_internal.h"
#ifndef CONFIG_GENERIC_SCHEDULER
***************
*** 25,39 ****
/* #define VERBOSE1 */
- struct hls_sched_param {
- struct sched_param sp;
- int size;
- void *p;
- };
-
- extern void HLSCreateThreadHook (struct task_struct *thread, long state);
- extern void HLSExitThreadHook (struct task_struct *thread);
- extern void HLSUnblockThreadHook (struct task_struct *thread);
- extern void HLSBlockThreadHook (struct task_struct *thread);
- extern int hls_ctl(struct task_struct *t, struct hls_param *p, int hls_priority);
struct HLS_PROC {
void *CurrentThread;
--- 28,31 ----
***************
*** 46,52 ****
--- 38,50 ----
spinlock_t hls_lock __cacheline_aligned = SPIN_LOCK_UNLOCKED; /* inner */
+ static int wup, lastt;
+ extern int whereami;
+
void show_tasks(void);
void HLSScheduleThread(struct task_struct *t, unsigned long proc)
{
+ int sched_non_running;
+
+ sched_non_running = 0;
if (my_current[proc] != NULL) {
struct task_struct *c;
***************
*** 74,77 ****
--- 72,76 ----
/* Do we have a new task to schedule? */
if (t != NULL) {
+ sched_non_running = (t->state != TASK_RUNNING);
if(t->policy != SCHED_FIFO) {
printk("HLS ERROR: Scheduling an HLS task with policy != SCHED_FIFO...\n");
***************
*** 83,88 ****
--- 82,89 ----
t->rt_priority = HLS_SCHEDULING_PRIORITY;
HLSProc[proc].CurrentThread = t->private_data;
+ wup = t->pid;
} else {
HLSProc[proc].CurrentThread = NULL;
+ wup = -1;
}
***************
*** 90,93 ****
--- 91,100 ----
show_tasks();
+ lastt = wup;
+
+ if (sched_non_running) {
+ printk("HLS ERROR: Trying to schedule %d with state = %ld\n",
+ t->pid, t->state);
+ }
}
***************
*** 225,230 ****
if (t->rt_priority == HLS_SCHEDULING_PRIORITY) {
if (t->state != TASK_RUNNING) {
! printk("HLS ERROR: Task %d has rt_priority = %ld and state = %ld\n",
! t->pid, t->rt_priority, t->state);
hls_printk("HLS ERROR: Task %d has rt_priority = %ld and state = %ld\n",
t->pid, t->rt_priority, t->state);
--- 232,238 ----
if (t->rt_priority == HLS_SCHEDULING_PRIORITY) {
if (t->state != TASK_RUNNING) {
! printk("HLS ERROR: Task %d has rt_priority = %ld and state = %ld --- WAI = %d WUP = %d Last = %d\n",
! t->pid, t->rt_priority, t->state,
! whereami, wup, lastt);
hls_printk("HLS ERROR: Task %d has rt_priority = %ld and state = %ld\n",
t->pid, t->rt_priority, t->state);
***************
*** 280,371 ****
}
#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;
- }
-
-
- /* Return value:
- * < 0 ---> Failure
- * = 0 ---> Success
- * > 0 ---> do the regular Linux thing...
- */
- int hls_setsched(pid_t pid, int policy, struct sched_param *param)
- {
- struct task_struct *p;
- struct hls_param hls_p;
- struct hls_sched_param sched_p;
- unsigned long flags;
- int res;
-
- spin_lock_irqsave(&hls_lock, flags);
- p = find_process_by_pid(pid);
- if (p == NULL) {
- spin_unlock_irqrestore(&hls_lock, flags);
- return -ESRCH;
- }
- if (policy != SCHED_HLS) {
- if (p->private_data != NULL) {
- #ifdef NOLINUX_TASKS
- printk("Policy %d != SCHED_HLS. Doing nothing...\n", policy);
- #else
- HLSExitThreadHook(p);
- p->policy = SCHED_OTHER;
- p->private_data = NULL;
- #endif
- }
-
- spin_unlock_irqrestore(&hls_lock, flags);
-
- return 1;
- }
-
- if (copy_from_user(&sched_p, param, sizeof(struct hls_sched_param)) < 0) {
- spin_unlock_irqrestore(&hls_lock, flags);
-
- return -EFAULT;
- }
- if (sizeof(struct hls_param) != sched_p.size) {
- spin_unlock_irqrestore(&hls_lock, flags);
-
- return -EFAULT;
- }
- if (copy_from_user(&hls_p, sched_p.p, sizeof(struct hls_param)) < 0) {
- spin_unlock_irqrestore(&hls_lock, flags);
-
- return -EFAULT;
- }
- /* Extra consinstency check... */
- if (hls_p.signature != HLS_SIGNATURE) {
- spin_unlock_irqrestore(&hls_lock, flags);
-
- return -EFAULT;
- }
-
- if (p->private_data == NULL) {
- 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, &hls_p, sched_p.sp.sched_priority);
-
- spin_unlock_irqrestore(&hls_lock, flags);
-
- return res;
}
--- 288,290 ----
Index: hls_ctl.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/linux/hls_ctl.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** hls_ctl.c 27 Aug 2003 17:52:00 -0000 1.7
--- hls_ctl.c 8 Nov 2003 10:34:32 -0000 1.8
***************
*** 15,18 ****
--- 15,35 ----
#include "thr.h"
#include "hls.h"
+ #include "hls_hooks.h"
+
+
+ #define NOLINUX_TASKS
+
+ #define HLS_NAME_SIZE 256
+ #define HLS_PARMS_SIZE 256
+
+ struct hls_sched_param {
+ struct sched_param sp;
+ int size;
+ void *p;
+ };
+
+ extern spinlock_t hls_lock;
+
+
static int hls_setparam(struct HLS_VPROC *vp, void *sched_params, int prio)
***************
*** 23,28 ****
NewMsg.ObjType = RRMsgValue;
#endif
- NewMsg.type = MSG_SETPARAMS;
NewMsg.body = sched_params;
NewMsg.Pri = prio;
--- 40,49 ----
NewMsg.ObjType = RRMsgValue;
#endif
NewMsg.body = sched_params;
+ if (sched_params == NULL) {
+ NewMsg.type = MSG_SETPRI;
+ } else {
+ NewMsg.type = MSG_SETPARAMS;
+ }
NewMsg.Pri = prio;
***************
*** 138,176 ****
!
! int hls_ctl(PRKTHREAD t, struct hls_param *p, int hls_priority)
{
int status;
! char sched_name[255];
! char sched_param[255];
void *s_p;
struct HLS_SCHED_INSTANCE *target_sched;
struct TH_INSTANCE_DATA *th;
int state;
if (p->command == HLS_CMD_NULL_MSG) {
return hls_null_msg(t);
}
! if (p->sched_data_size > 255) {
! return -EFAULT;
! }
! if ((p->sched_data_size == 0)) {
! s_p = NULL;
! } else {
! if (copy_from_user(sched_param, p->sched_data, p->sched_data_size) < 0) {
!
! return -EFAULT;
! }
! s_p = &sched_param;
! }
!
! /* Find the scheduler */
! memset(sched_name, 0, 255);
! if (copy_from_user(sched_name, p->scheduler, strlen(p->scheduler)) < 0) {
!
! return -EFAULT;
! }
!
target_sched = HLSFindInstByName(sched_name);
if (!target_sched) {
--- 159,183 ----
! /* TODO:
! * - in hls_ctl, Change hls_param *p ---> void *sp, HLS_SCHED_INSTANCE *target_sched
! * - add an hls_do_something_to_user_parms to get those vales...
! */
! int hls_ctl(PRKTHREAD t, struct HLS_SCHED_INSTANCE *target_sched, void *s_p, int hls_priority)
{
int status;
! /*
void *s_p;
struct HLS_SCHED_INSTANCE *target_sched;
+ */
struct TH_INSTANCE_DATA *th;
int state;
+ #if 0
if (p->command == HLS_CMD_NULL_MSG) {
return hls_null_msg(t);
}
+ #endif
! #if 0
target_sched = HLSFindInstByName(sched_name);
if (!target_sched) {
***************
*** 178,181 ****
--- 185,189 ----
return -EINVAL;
}
+ #endif
/* Find the task instance */
***************
*** 190,194 ****
/* Yes: We simply do a setparm */
HLSDbgPrint (9, ("(infr) hls_ctl: %s is already scheduled by %s; trying to update params\n",
! ThreadStr(t), sched_name));
status = hls_setparam(th->vp, s_p, hls_priority);
if (status == HLS_SUCCESS) {
--- 198,202 ----
/* Yes: We simply do a setparm */
HLSDbgPrint (9, ("(infr) hls_ctl: %s is already scheduled by %s; trying to update params\n",
! ThreadStr(t), target_sched->Name));
status = hls_setparam(th->vp, s_p, hls_priority);
if (status == HLS_SUCCESS) {
***************
*** 200,209 ****
/* We have to move to the new scheduler... */
! hls_printk("hls_ctl: Moving to %s\n", sched_name);
state = hls_thread_move(t, target_sched);
if (state < 0) {
return -EINVAL;
}
hls_printk(" ...and setting the parameters!\n");
status = hls_setparam(th->vp, s_p, hls_priority);
if (status == HLS_SUCCESS) {
--- 208,221 ----
/* 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!\n");
+ #endif
status = hls_setparam(th->vp, s_p, hls_priority);
if (status == HLS_SUCCESS) {
***************
*** 222,223 ****
--- 234,423 ----
return 0;
}
+
+ static int hls_parse_param(void *p, struct HLS_SCHED_INSTANCE **sched, void *parms)
+ {
+ struct hls_sched_param sched_p;
+ struct hls_param hls_p;
+ static char sched_name[HLS_NAME_SIZE];
+
+ if (copy_from_user(&sched_p, p, sizeof(struct hls_sched_param)) < 0) {
+
+ return -EFAULT;
+ }
+ if (sizeof(struct hls_param) != sched_p.size) {
+
+ return -EFAULT;
+ }
+ if (copy_from_user(&hls_p, sched_p.p, sizeof(struct hls_param)) < 0) {
+
+ return -EFAULT;
+ }
+ /* Extra consinstency check... */
+ if (hls_p.signature != HLS_SIGNATURE) {
+
+ return -EFAULT;
+ }
+
+ if (hls_p.sched_data_size > HLS_PARMS_SIZE) {
+ return -EFAULT;
+ }
+ if (hls_p.sched_data_size == 0) {
+ memset(parms, 0, HLS_PARMS_SIZE);
+ } else {
+ if (copy_from_user(parms, hls_p.sched_data, hls_p.sched_data_size) < 0) {
+
+ return -EFAULT;
+ }
+ }
+
+ /* Check if there is room for the scheduler's name... */
+ if (strlen(hls_p.scheduler) > HLS_NAME_SIZE) {
+ return -EINVAL;
+ }
+
+ /* ...And get it!!! */
+ memset(sched_name, 0, HLS_NAME_SIZE);
+ if (copy_from_user(sched_name, hls_p.scheduler, strlen(hls_p.scheduler)) < 0) {
+
+ return -EFAULT;
+ }
+ *sched = HLSFindInstByName(sched_name);
+ if (!*sched) {
+ printk("Cannot find scheduler %s\n", sched_name);
+
+ return -EINVAL;
+ }
+
+ return sched_p.sp.sched_priority;
+ }
+
+ static int hls_parse_priority(void *p)
+ {
+ struct hls_sched_param sched_p;
+
+ if (copy_from_user(&sched_p, p, sizeof(struct hls_sched_param)) < 0) {
+
+ return -EFAULT;
+ }
+
+ 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
+ * = 0 ---> Success
+ * > 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];
+ char *sched_param = NULL;
+ struct HLS_SCHED_INSTANCE *s;
+ int res;
+ int priority = HLS_DEFAULT_PRIORITY;
+ int return_to_linux;
+
+ spin_lock_irqsave(&hls_lock, flags);
+ p = find_process_by_pid(pid);
+ if (p == NULL) {
+ spin_unlock_irqrestore(&hls_lock, flags);
+ return -ESRCH;
+ }
+
+ return_to_linux = -1;
+ if (policy != SCHED_HLS) {
+ if (policy == SCHED_OTHER) {
+ if (p->private_data != NULL) {
+ #ifdef NOLINUX_TASKS
+ s = HLSDefaultSched;
+ priority = HLS_DEFAULT_PRIORITY;
+ #else
+ HLSExitThreadHook(p);
+ p->policy = SCHED_OTHER;
+ p->private_data = NULL;
+ /* We return to use the linux scheduler...
+ * No need to set s & sched_param
+ */
+ return_to_linux = 1;
+ #endif
+ } else {
+ /* Private data == NULL...
+ * - If NOLINUX_TASKS, transform in HLS
+ * - Otherwise, do nothing
+ */
+ #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...
+ * No need to set s & sched_param
+ */
+ return_to_linux = 0;
+ }
+ } else {
+ if (p->private_data == NULL) {
+ /* Transform in HLS */
+ p->policy = SCHED_FIFO;
+ p->rt_priority = HLS_IDLE_PRIORITY;
+ HLSCreateThreadHook(p, p->state);
+ }
+ /* Change scheduler to rt_sched */
+ priority = hls_parse_priority(param);
+ s = hls_rt_sched;
+ if (priority >= HLS_MAXIMUM_PRIORITY) {
+ priority = HLS_MAXIMUM_PRIORITY - 1;
+ }
+ }
+
+ if (return_to_linux >= 0) {
+ spin_unlock_irqrestore(&hls_lock, flags);
+
+ return return_to_linux;
+ }
+ } else {
+ priority = hls_parse_param(param, &s, sp);
+ sched_param = sp;
+ if (priority < 0) {
+ spin_unlock_irqrestore(&hls_lock, flags);
+
+ return priority;
+ }
+ }
+
+ if (p->private_data == NULL) {
+ 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);
+
+ spin_unlock_irqrestore(&hls_lock, flags);
+
+ return res;
+ }
+
Index: hls_timers.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/linux/hls_timers.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** hls_timers.c 25 Feb 2003 09:18:55 -0000 1.5
--- hls_timers.c 8 Nov 2003 10:34:32 -0000 1.6
***************
*** 2,6 ****
* Copyright (c) 2002 Luca Abeni & John Regehr
*
! * Module Name: hls_ctl.c
* Abstract: Kernel-dependent part of the timers mechanism.
* Author: Luca Abeni 2002, John Regehr 2000
--- 2,6 ----
* Copyright (c) 2002 Luca Abeni & John Regehr
*
! * Module Name: hls_timers.c
* Abstract: Kernel-dependent part of the timers mechanism.
* Author: Luca Abeni 2002, John Regehr 2000
***************
*** 20,28 ****
struct HLS_SCHED_INSTANCE *Sched;
! /*
! #ifdef __DO_CLI__
spin_lock_irqsave(&hls_lock, flags);
#endif
- */
Sched = (struct HLS_SCHED_INSTANCE *) arg;
--- 20,26 ----
struct HLS_SCHED_INSTANCE *Sched;
! #ifdef __DO_CLI1__
spin_lock_irqsave(&hls_lock, flags);
#endif
Sched = (struct HLS_SCHED_INSTANCE *) arg;
***************
*** 32,40 ****
Sched->CB->I_TimerCallback(Sched);
! /*
! #ifdef __DO_CLI__
spin_unlock_irqrestore(&hls_lock, flags);
#endif
- */
}
--- 30,36 ----
Sched->CB->I_TimerCallback(Sched);
! #ifdef __DO_CLI1__
spin_unlock_irqrestore(&hls_lock, flags);
#endif
}
***************
*** 48,51 ****
--- 44,56 ----
_int64 T;
+ /* Timer debugging stuff... */
+ if (timer_pending(&Sched->HLSTimer)) {
+ /* ERROR!!! Timer Posted twice! */
+ extern int whereami;
+ hls_hard_printk("HLS ERROR: Scheduler %s posted a timer twice!!! WAI = %d\n",
+ Sched->Name, whereami);
+ return;
+ }
+
T = -T1;
if (T < 0) {
Index: init.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/linux/init.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** init.c 25 Feb 2003 09:18:55 -0000 1.6
--- init.c 8 Nov 2003 10:34:32 -0000 1.7
***************
*** 20,24 ****
#include <linux/sched.h>
! #include <hls.h>
#ifndef CONFIG_GENERIC_SCHEDULER
--- 20,28 ----
#include <linux/sched.h>
! #include <data.h>
!
! #include "hls_hooks.h"
! #include "bottom.h"
! #include "procfs.h"
#ifndef CONFIG_GENERIC_SCHEDULER
***************
*** 35,48 ****
MODULE_LICENSE("GPL");
- extern void hls_bottom_vp_request(struct task_struct *t);
- extern void hls_bottom_vp_release(struct task_struct *t);
- extern void hls_bottom_vp_register(struct task_struct *t);
- extern void hls_bottom_vp_unregister(struct task_struct *t);
int hls_setsched(pid_t pid, int policy, struct sched_param *param);
- extern void HLSCreateThreadHook (struct task_struct *Thread, long int State);
- extern void HLSExitThreadHook (struct task_struct *Thread);
- extern void HLSUnblockThreadHook (struct task_struct *Thread);
-
extern void HLSInit(void);
--- 39,44 ----
***************
*** 51,55 ****
extern spinlock_t hls_lock;
! void convert_tasks(void)
{
struct task_struct *t;
--- 47,51 ----
extern spinlock_t hls_lock;
! void hls_convert_tasks(void)
{
struct task_struct *t;
***************
*** 163,167 ****
*/
#ifdef __CREATE_HIERARCHY__
! convert_tasks();
#endif
--- 159,163 ----
*/
#ifdef __CREATE_HIERARCHY__
! hls_convert_tasks();
#endif
Index: procfs.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/linux/procfs.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** procfs.c 25 Feb 2003 09:18:55 -0000 1.6
--- procfs.c 8 Nov 2003 10:34:32 -0000 1.7
***************
*** 22,27 ****
#include <linux/slab.h>
static struct proc_dir_entry *hls_dir, *schedulers_file,
! *instances_file, *tasks_file, *default_file;
extern char *hls_scheduler_name(int i);
--- 22,33 ----
#include <linux/slab.h>
+ #include "data.h"
+ #include "interface-data.h"
+ #include <hls_internal.h>
+
+ #include "procfs.h"
+
static struct proc_dir_entry *hls_dir, *schedulers_file,
! *instances_file, *tasks_file, *default_file, *rt_file;
extern char *hls_scheduler_name(int i);
***************
*** 29,40 ****
extern char *hls_instance_scheduler(int i);
extern char *hls_instance_father(int i);
- extern char *hls_default_name(void);
extern struct HLS_SCHED_INSTANCE *HLSFindInstByName (char *Name);
extern struct HLS_SCHED_INSTANCE *HLSNewSchedInstance(char *SchedName,
char *InstName, struct HLS_SCHED_INSTANCE *Parent);
- extern void hls_setdefault(void *p);
extern void SetDefPriForSched(char Pri, struct HLS_SCHED_INSTANCE *Inst);
extern int hls_setparam_ascii(struct HLS_SCHED_INSTANCE *inst, char *param);
static int hls_proc_read_default(char *p, char **s, off_t o,
int c, int *eof, void *dummy)
--- 35,81 ----
extern char *hls_instance_scheduler(int i);
extern char *hls_instance_father(int i);
extern struct HLS_SCHED_INSTANCE *HLSFindInstByName (char *Name);
extern struct HLS_SCHED_INSTANCE *HLSNewSchedInstance(char *SchedName,
char *InstName, struct HLS_SCHED_INSTANCE *Parent);
extern void SetDefPriForSched(char Pri, struct HLS_SCHED_INSTANCE *Inst);
extern int hls_setparam_ascii(struct HLS_SCHED_INSTANCE *inst, char *param);
+ static int hls_proc_read_rt(char *p, char **s, off_t o,
+ int c, int *eof, void *dummy)
+ {
+ char *name;
+ int len;
+
+ name = hls_rt_name();
+ #if (HLS_DEBUG > 0)
+ printk("Read %s (%d)\n", name, strlen(name));
+ #endif
+ len = strlen(name) + 1;
+ strcpy(p, name);
+
+ return len;
+ }
+ static int hls_proc_write_rt(struct file *f, const char *b,
+ unsigned long c, void *dummy)
+ {
+ void *sched;
+ char schedname[16];
+
+ memcpy(schedname, b, c);
+ schedname[c - 1] = 0;
+
+ sched = HLSFindInstByName(schedname);
+
+ if (sched == NULL) {
+ printk("Cannot find %s\n", schedname);
+
+ return c;
+ }
+
+ hls_setrt(sched);
+
+ return c;
+ }
+
static int hls_proc_read_default(char *p, char **s, off_t o,
int c, int *eof, void *dummy)
***************
*** 44,48 ****
--- 85,91 ----
name = hls_default_name();
+ #if (HLS_DEBUG > 0)
printk("Read %s (%d)\n", name, strlen(name));
+ #endif
len = strlen(name) + 1;
strcpy(p, name);
***************
*** 103,111 ****
memcpy(mybuff, b, c);
mybuff[c - 1] = 0;
printk("ProcFSed %s\n", mybuff);
sscanf(mybuff, "%s %s %s %n", instname, schedname, fathername, &len);
printk("Creating %s of type %s and father %s\n", instname, schedname, fathername);
!
father_sched = HLSFindInstByName(fathername);
if (father_sched == NULL) {
--- 146,158 ----
memcpy(mybuff, b, c);
mybuff[c - 1] = 0;
+ #if (HLS_DEBUG > 0)
printk("ProcFSed %s\n", mybuff);
+ #endif
sscanf(mybuff, "%s %s %s %n", instname, schedname, fathername, &len);
+ #if (HLS_DEBUG > 0)
printk("Creating %s of type %s and father %s\n", instname, schedname, fathername);
! #endif
!
father_sched = HLSFindInstByName(fathername);
if (father_sched == NULL) {
***************
*** 125,129 ****
--- 172,178 ----
if ((len > 0) && (len < c)) {
+ #if (HLS_DEBUG > 0)
printk("Read %d: remains %s\n", len, mybuff + len);
+ #endif
res = hls_setparam_ascii(new_instance, mybuff + len);
if (res < 0) {
***************
*** 225,228 ****
--- 274,292 ----
default_file->owner = THIS_MODULE;
+ rt_file = create_proc_entry("rt", 0644, hls_dir);
+ if(rt_file == NULL) {
+ remove_proc_entry("default", hls_dir);
+ remove_proc_entry("tasks", hls_dir);
+ remove_proc_entry("instances", hls_dir);
+ remove_proc_entry("schedulers", hls_dir);
+ remove_proc_entry("HLS", NULL);
+
+ return -ENOMEM;
+ }
+ rt_file->data = NULL;
+ rt_file->read_proc = hls_proc_read_rt;
+ rt_file->write_proc = hls_proc_write_rt;
+ rt_file->owner = THIS_MODULE;
+
return 0;
}
***************
*** 230,233 ****
--- 294,298 ----
void hls_proc_cleanup(void)
{
+ remove_proc_entry("rt", hls_dir);
remove_proc_entry("default", hls_dir);
remove_proc_entry("tasks", hls_dir);
|
|
From: <lu...@us...> - 2003-11-08 10:34:36
|
Update of /cvsroot/linux-hls/hls/tests
In directory sc8-pr-cvs1:/tmp/cvs-serv6094/tests
Modified Files:
schedtest.c
Log Message:
Lot of changes....
- Unbreak the debugging stuff
- Some random cleanups
- Fixes in the RR scheduler (I hope... MAXIMUM_PRIORITY does not seem to be
a valid priority)
- Allow the RES scheduler to be scheduled (there's a fixme: some functions
still have to be properly implemented)
- change Q e T from long long to long in the RES scheduler
- Implement the "rt scheduler" stuff
Index: schedtest.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/tests/schedtest.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** schedtest.c 27 Aug 2002 11:26:20 -0000 1.1.1.1
--- schedtest.c 8 Nov 2003 10:34:32 -0000 1.2
***************
*** 13,17 ****
#define US 50
! #define MAX 50
unsigned long int pin[2000], pout[2000];
--- 13,17 ----
#define US 50
! #define MAX 500
unsigned long int pin[2000], pout[2000];
***************
*** 38,42 ****
rsv.Amount = 300000;
rsv.Period = 1000000;
!
res = sched_setscheduler(getpid(), SCHED_HLS, &sp);
if (res < 0) {
--- 38,48 ----
rsv.Amount = 300000;
rsv.Period = 1000000;
! if (argc == 3) {
! rsv.Amount = atoi(argv[1]) * 10;
! rsv.Period = atoi(argv[2]) * 10;
! }
! printf("Setting up reservation with parameters (%d, %d)\n",
! rsv.Amount, rsv.Period);
!
res = sched_setscheduler(getpid(), SCHED_HLS, &sp);
if (res < 0) {
|
|
From: <lu...@us...> - 2003-11-08 10:34:36
|
Update of /cvsroot/linux-hls/hls/linux/include
In directory sc8-pr-cvs1:/tmp/cvs-serv6094/linux/include
Modified Files:
data.h hls.h interface-data.h interface-funcs.h
Log Message:
Lot of changes....
- Unbreak the debugging stuff
- Some random cleanups
- Fixes in the RR scheduler (I hope... MAXIMUM_PRIORITY does not seem to be
a valid priority)
- Allow the RES scheduler to be scheduled (there's a fixme: some functions
still have to be properly implemented)
- change Q e T from long long to long in the RES scheduler
- Implement the "rt scheduler" stuff
Index: data.h
===================================================================
RCS file: /cvsroot/linux-hls/hls/linux/include/data.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** data.h 25 Feb 2003 09:18:55 -0000 1.3
--- data.h 8 Nov 2003 10:34:32 -0000 1.4
***************
*** 22,28 ****
--- 22,69 ----
#define PKTHREAD struct task_struct *
+
#define HLS_READY_REASON int
#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 {
+ HLS_CMD_DUMP_COUNTS = 100,
+ HLS_CMD_WHICH_PROC = 101,
+ HLS_CMD_SET_DEBUG_LEVEL = 102,
+ HLS_CMD_RES = 103,
+ HLS_CMD_SET_TIMERRES = 104,
+ HLS_CMD_GET_STOLEN = 105,
+ HLS_CMD_LIST_RES = 106,
+ HLS_CMD_END_RES = 107,
+ HLS_CMD_NEW_INSTANCE = 108,
+ HLS_CMD_SET_SHARE = 109,
+ HLS_CMD_SET_DEFAULT = 110,
+ HLS_CMD_DESTROY_INSTANCE = 111,
+ HLS_CMD_NULL_MSG = 112,
+ HLS_CMD_MOVE_THREAD = 113
+ } HLS_CTL_COMMAND;
+
+
+ struct hls_param {
+ unsigned long int signature;
+ HLS_CTL_COMMAND command;
+ char *scheduler;
+ int sched_data_size;
+ void *sched_data;
+ };
+
+
+ #define SCHED_HLS 10
+
+ #define HLS_SIGNATURE 0x56
+
#endif /* __DATA__ */
Index: hls.h
===================================================================
RCS file: /cvsroot/linux-hls/hls/linux/include/hls.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** hls.h 25 Feb 2003 09:18:55 -0000 1.2
--- hls.h 8 Nov 2003 10:34:32 -0000 1.3
***************
*** 16,56 ****
};
- /* 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 {
- HLS_CMD_DUMP_COUNTS = 100,
- HLS_CMD_WHICH_PROC = 101,
- HLS_CMD_SET_DEBUG_LEVEL = 102,
- HLS_CMD_RES = 103,
- HLS_CMD_SET_TIMERRES = 104,
- HLS_CMD_GET_STOLEN = 105,
- HLS_CMD_LIST_RES = 106,
- HLS_CMD_END_RES = 107,
- HLS_CMD_NEW_INSTANCE = 108,
- HLS_CMD_SET_SHARE = 109,
- HLS_CMD_SET_DEFAULT = 110,
- HLS_CMD_DESTROY_INSTANCE = 111,
- HLS_CMD_NULL_MSG = 112,
- HLS_CMD_MOVE_THREAD = 113
- } HLS_CTL_COMMAND;
-
- struct hls_param {
- unsigned long int signature;
- HLS_CTL_COMMAND command;
- char *scheduler;
- int sched_data_size;
- void *sched_data;
- };
-
- #define SCHED_HLS 10
-
- #define HLS_SIGNATURE 0x56
-
#endif /* __HLS_H__ */
--- 16,18 ----
Index: interface-data.h
===================================================================
RCS file: /cvsroot/linux-hls/hls/linux/include/interface-data.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** interface-data.h 25 Feb 2003 09:18:55 -0000 1.2
--- interface-data.h 8 Nov 2003 10:34:32 -0000 1.3
***************
*** 12,20 ****
#define __INTERFACE_DATA__
#define SCHAR signed char
#define ULONG unsigned long
typedef long long _int64;
! typedef _int64 WNT_TIME; /* FIXME: This must be removed! */
#define MAXIMUM_PROCESSORS 32
--- 12,26 ----
#define __INTERFACE_DATA__
+ #define LIST_ENTRY struct list_head
+ typedef LIST_ENTRY *PRLIST_ENTRY;
+
+
+
+
#define SCHAR signed char
#define ULONG unsigned long
typedef long long _int64;
! typedef long int WNT_TIME; /* FIXME: This must be removed! */
#define MAXIMUM_PROCESSORS 32
***************
*** 22,30 ****
#define PROCT ULONG
#define KPRIORITY int
! #define MAXIMUM_PRIORITY 32 /* FIXME: Shouldn't this go in rr.h??? */
#define CONTAINING_RECORD(address, type, field) ((type *)( \
(char *)(address) - \
(unsigned long)(&((type *)0)->field)))
#endif /* __INTERFACE_DATA__ */
--- 28,44 ----
#define PROCT ULONG
#define KPRIORITY int
! #define HLS_MAXIMUM_PRIORITY 32 /* FIXME: Shouldn't this go in rr.h??? */
#define CONTAINING_RECORD(address, type, field) ((type *)( \
(char *)(address) - \
(unsigned long)(&((type *)0)->field)))
+
+ typedef enum _HLS_BOOL {
+ HLS_FALSE = 0, HLS_TRUE = 0x600 // don't change this value
+ } HLS_BOOL;
+ typedef enum _HLS_STATUS {
+ HLS_SUCCESS = 0xadd0, HLS_NOROOM, HLS_INVALID_PARAMETER
+ } HLS_STATUS;
+
#endif /* __INTERFACE_DATA__ */
Index: interface-funcs.h
===================================================================
RCS file: /cvsroot/linux-hls/hls/linux/include/interface-funcs.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** interface-funcs.h 25 Feb 2003 09:18:55 -0000 1.2
--- interface-funcs.h 8 Nov 2003 10:34:32 -0000 1.3
***************
*** 45,53 ****
#define hls_hard_printk printk
#define DbgPrint printk
#define hls_panic panic
!
! #define LIST_ENTRY struct list_head
#define LIST_NEXT_ENTRY(l) (l->next)
- typedef LIST_ENTRY *PRLIST_ENTRY;
extern inline void *hls_malloc (int size)
--- 45,54 ----
#define hls_hard_printk printk
#define DbgPrint printk
+ #if 0
#define hls_panic panic
! #else
! #define hls_panic(a) BUG()
! #endif
#define LIST_NEXT_ENTRY(l) (l->next)
extern inline void *hls_malloc (int size)
|
Update of /cvsroot/linux-hls/hls/hls
In directory sc8-pr-cvs1:/tmp/cvs-serv6094/hls
Modified Files:
hls_debug.c hls_hooks.c hls_sched_ps.c hls_sched_res.c
hls_sched_rr.c hls_sched_th.c hls_utils.c
Log Message:
Lot of changes....
- Unbreak the debugging stuff
- Some random cleanups
- Fixes in the RR scheduler (I hope... MAXIMUM_PRIORITY does not seem to be
a valid priority)
- Allow the RES scheduler to be scheduled (there's a fixme: some functions
still have to be properly implemented)
- change Q e T from long long to long in the RES scheduler
- Implement the "rt scheduler" stuff
Index: hls_debug.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/hls/hls_debug.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** hls_debug.c 25 Feb 2003 09:18:52 -0000 1.4
--- hls_debug.c 8 Nov 2003 10:34:31 -0000 1.5
***************
*** 127,131 ****
*/
#if 0
! for (i=0; i<MAXIMUM_PRIORITY; i++) {
if (KiReadySummary & (1<<i)) {
PRLIST_ENTRY ListHead = &KiDispatcherReadyListHead[i];
--- 127,131 ----
*/
#if 0
! for (i=0; i<HLS_MAXIMUM_PRIORITY; i++) {
if (KiReadySummary & (1<<i)) {
PRLIST_ENTRY ListHead = &KiDispatcherReadyListHead[i];
Index: hls_hooks.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/hls/hls_hooks.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** hls_hooks.c 25 Feb 2003 09:18:52 -0000 1.6
--- hls_hooks.c 8 Nov 2003 10:34:31 -0000 1.7
***************
*** 14,17 ****
--- 14,19 ----
#include "hls_internal.h"
+ #include "hls_hooks.h"
+
/* This could be fixed... */
#include "thr.h"
***************
*** 40,45 ****
hls_hard_printk("HLSCreateThreadHook --- WAI = %d [%d]\n", whereami, Thread->pid);
hls_printk("HLSCreateThreadHook --- WAI = %d [%d]\n", whereami, Thread->pid);
- /*
hls_panic("Entering HLSCreateThreadHook with WAI != 0\n");
asm("cli");asm("halt");
*/
--- 42,47 ----
hls_hard_printk("HLSCreateThreadHook --- WAI = %d [%d]\n", whereami, Thread->pid);
hls_printk("HLSCreateThreadHook --- WAI = %d [%d]\n", whereami, Thread->pid);
hls_panic("Entering HLSCreateThreadHook with WAI != 0\n");
+ /*
asm("cli");asm("halt");
*/
***************
*** 143,148 ****
hls_hard_printk("HLSUnblockThreadHook --- WAI = %d [%d]\n", whereami, Thread->pid);
hls_printk("HLSUnblockThreadHook --- WAI = %d [%d]\n", whereami, Thread->pid);
- /*
hls_panic("Entering HLSUnblockThreadHook with WAI != 0\n");
asm("cli");asm("halt");
*/
--- 145,150 ----
hls_hard_printk("HLSUnblockThreadHook --- WAI = %d [%d]\n", whereami, Thread->pid);
hls_printk("HLSUnblockThreadHook --- WAI = %d [%d]\n", whereami, Thread->pid);
hls_panic("Entering HLSUnblockThreadHook with WAI != 0\n");
+ /*
asm("cli");asm("halt");
*/
***************
*** 261,266 ****
hls_hard_printk("HLSExitThreadHook --- WAI = %d [%d]\n", whereami, Thread->pid);
hls_printk("HLSExitThreadHook --- WAI = %d [%d]\n", whereami, Thread->pid);
- /*
hls_panic("Entering HLSExitThreadHook with WAI != 0\n");
asm("cli");asm("halt");
*/
--- 263,268 ----
hls_hard_printk("HLSExitThreadHook --- WAI = %d [%d]\n", whereami, Thread->pid);
hls_printk("HLSExitThreadHook --- WAI = %d [%d]\n", whereami, Thread->pid);
hls_panic("Entering HLSExitThreadHook with WAI != 0\n");
+ /*
asm("cli");asm("halt");
*/
***************
*** 316,321 ****
hls_hard_printk("HLSBlockThreadHook --- WAI = %d [%d]\n", whereami, Thread->pid);
hls_printk("HLSBlockThreadHook --- WAI = %d [%d]\n", whereami, Thread->pid);
- /*
hls_panic("Entering HLSBlockThreadHook with WAI != 0\n");
asm("cli");asm("halt");
*/
--- 318,323 ----
hls_hard_printk("HLSBlockThreadHook --- WAI = %d [%d]\n", whereami, Thread->pid);
hls_printk("HLSBlockThreadHook --- WAI = %d [%d]\n", whereami, Thread->pid);
hls_panic("Entering HLSBlockThreadHook with WAI != 0\n");
+ /*
asm("cli");asm("halt");
*/
***************
*** 353,358 ****
if (t->InState != HLS_Ready) {
! hls_hard_printk("HYPERERROR!!! Strange internal state: %x\n", t->InState);
! hls_printk("HYPERERROR!!! Strange internal state: %x\n", t->InState);
}
t->InState = HLS_Waiting;
--- 355,360 ----
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;
Index: hls_sched_ps.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/hls/hls_sched_ps.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** hls_sched_ps.c 25 Feb 2003 09:18:53 -0000 1.9
--- hls_sched_ps.c 8 Nov 2003 10:34:31 -0000 1.10
***************
*** 593,597 ****
HLSDbgPrint (9, ("(%s) got a message\n",
Inst->Self->Name));
-
switch (m->type) {
case MSG_SETDEFPRI:
--- 593,596 ----
***************
*** 627,633 ****
HLS_ASSERT (IsBVP (Inst, bvp));
{
! struct PS_UD *ud = BVPtoPSUD(bvp);
struct ps_msg_body *body;
body = m->body;
HLS_ASSERT(body);
--- 626,633 ----
HLS_ASSERT (IsBVP (Inst, bvp));
{
! struct PS_UD *ud;
struct ps_msg_body *body;
+ ud = BVPtoPSUD(bvp);
body = m->body;
HLS_ASSERT(body);
***************
*** 675,679 ****
HLS_ASSERT (0);
}
!
return status;
}
--- 675,679 ----
HLS_ASSERT (0);
}
!
return status;
}
Index: hls_sched_res.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/hls/hls_sched_res.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** hls_sched_res.c 25 Feb 2003 09:18:53 -0000 1.10
--- hls_sched_res.c 8 Nov 2003 10:34:31 -0000 1.11
***************
*** 323,327 ****
for (i=0; i<DL_REC_INDEX; i++) {
! DbgPrint ("Time %lld ActualAmount %lld Stolen %lld\n",
DL_RECS[i].Time,
DL_RECS[i].ActualAmount,
--- 323,327 ----
for (i=0; i<DL_REC_INDEX; i++) {
! DbgPrint ("Time %ld ActualAmount %ld Stolen %ld\n",
DL_RECS[i].Time,
DL_RECS[i].ActualAmount,
***************
*** 341,348 ****
--- 341,353 ----
}
+ /* FIXME: This is triggered by hourglass... */
static void RES_T_CallbackRevoke (struct HLS_VPROC *tvp)
{
+ #if 0
// not allowed to revoke from reservation scheduler
HLS_ASSERT (0);
+ #else
+ hls_printk("FIXME: Please implement hls_sched_res:CallbackRemove()");
+ #endif
}
***************
*** 437,445 ****
#endif
! HLSDbgPrint (11, ("(%s) ud->StartTime is %lld, now is %lld\n",
ud->udvp->TopSched->Name,
ud->StartTime, Now));
! HLSDbgPrint (11, ("(%s) deduction starting as %lld but compensating for %lu clock ints\n",
ud->udvp->TopSched->Name,
Deduction, ClockInts));
--- 442,450 ----
#endif
! HLSDbgPrint (11, ("(%s) ud->StartTime is %ld, now is %ld\n",
ud->udvp->TopSched->Name,
ud->StartTime, Now));
! HLSDbgPrint (11, ("(%s) deduction starting as %ld but compensating for %lu clock ints\n",
ud->udvp->TopSched->Name,
Deduction, ClockInts));
***************
*** 473,477 ****
HLS_ASSERT (ud->StartTime != -1);
! HLSDbgPrint (9, ("(%s) deducting %lld from budget; %lld remains\n",
ud->udvp->TopSched->Name,
Deduction, ud->Budget - Deduction));
--- 478,482 ----
HLS_ASSERT (ud->StartTime != -1);
! HLSDbgPrint (9, ("(%s) deducting %ld from budget; %ld remains\n",
ud->udvp->TopSched->Name,
Deduction, ud->Budget - Deduction));
***************
*** 480,484 ****
if (ud->Budget < -((WNT_TIME)ID->TimeIncrement)) {
! hls_printk("(%s) hrm: budget is %lld, less than theoretical minimum of %lld\n",
ud->udvp->TopSched->Name,
ud->Budget, -((WNT_TIME)ID->TimeIncrement));
--- 485,489 ----
if (ud->Budget < -((WNT_TIME)ID->TimeIncrement)) {
! hls_printk("(%s) hrm: budget is %ld, less than theoretical minimum of %ld\n",
ud->udvp->TopSched->Name,
ud->Budget, -((WNT_TIME)ID->TimeIncrement));
***************
*** 544,548 ****
static void ReplenishBudget (struct RES_UD *ud)
{
! HLSDbgPrint (9, ("(%s) now is %lld; replenishing budget to %lld, previously was %lld\n",
ud->udvp->TopSched->Name,
HLSGetCurrentTime (),
--- 549,553 ----
static void ReplenishBudget (struct RES_UD *ud)
{
! HLSDbgPrint (9, ("(%s) now is %ld; replenishing budget to %ld, previously was %ld\n",
ud->udvp->TopSched->Name,
HLSGetCurrentTime (),
***************
*** 604,608 ****
#ifdef HLS_DEBUG
if (Now - ud->Deadline > Inst->TimeIncrement) {
! HLSDbgPrint (4, ("(%s) hrm: replenishing budget at %lld, later than %lu\n",
ud->udvp->TopSched->Name,
Now - ud->Deadline, Inst->TimeIncrement));
--- 609,613 ----
#ifdef HLS_DEBUG
if (Now - ud->Deadline > Inst->TimeIncrement) {
! HLSDbgPrint (4, ("(%s) hrm: replenishing budget at %ld, later than %lu\n",
ud->udvp->TopSched->Name,
Now - ud->Deadline, Inst->TimeIncrement));
***************
*** 636,640 ****
WNT_TIME RelTime = Earliest - Now;
! HLSDbgPrint (9, ("(%s) ResSetTimer: earliest period expiration is in %lld units\n",
Inst->Self->Name, RelTime));
--- 641,645 ----
WNT_TIME RelTime = Earliest - Now;
! HLSDbgPrint (9, ("(%s) ResSetTimer: earliest period expiration is in %ld units\n",
Inst->Self->Name, RelTime));
***************
*** 645,649 ****
HLS_ASSERT (ud->Budget > 0);
RelTime = ud->Budget;
! HLSDbgPrint (9, ("(%s) ResSetTimer: however, running reservation will use up budget in %lld units\n",
Inst->Self->Name, RelTime));
}
--- 650,654 ----
HLS_ASSERT (ud->Budget > 0);
RelTime = ud->Budget;
! HLSDbgPrint (9, ("(%s) ResSetTimer: however, running reservation will use up budget in %ld units\n",
Inst->Self->Name, RelTime));
}
***************
*** 656,660 ****
hls_stop_timer(Inst->Self);
}
! HLSDbgPrint (9, ("(%s) ResSetTimer: setting timer to go off in %lld units\n",
Inst->Self->Name, RelTime));
HLSSetTimer (-RelTime, Inst->Self);
--- 661,665 ----
hls_stop_timer(Inst->Self);
}
! HLSDbgPrint (9, ("(%s) ResSetTimer: setting timer to go off in %ld units\n",
Inst->Self->Name, RelTime));
HLSSetTimer (-RelTime, Inst->Self);
***************
*** 812,816 ****
HLS_ASSERT (res);
! HLSDbgPrint (5, ("(%s) attempting to set reservation parameters to %lld / %lld\n",
Inst->Self->Name, res->Amount, res->Period));
--- 817,821 ----
HLS_ASSERT (res);
! HLSDbgPrint (5, ("(%s) attempting to set reservation parameters to %lu / %lu\n",
Inst->Self->Name, res->Amount, res->Period));
***************
*** 842,851 ****
}
if (res->Period > MAX_RES_PERIOD) {
! HLSDbgPrint (5, ("(%s) rejecting res because period %lld is greater than %lld\n",
Inst->Self->Name, res->Period, MAX_RES_PERIOD));
return HLS_INVALID_PARAMETER;
}
if (res->Period < MIN_RES_PERIOD) {
! HLSDbgPrint (5, ("(%s) rejecting res because period %lld is less than %lld\n",
Inst->Self->Name, res->Period, MIN_RES_PERIOD));
return HLS_INVALID_PARAMETER;
--- 847,856 ----
}
if (res->Period > MAX_RES_PERIOD) {
! HLSDbgPrint (5, ("(%s) rejecting res because period %lu is greater than %lu\n",
Inst->Self->Name, res->Period, MAX_RES_PERIOD));
return HLS_INVALID_PARAMETER;
}
if (res->Period < MIN_RES_PERIOD) {
! HLSDbgPrint (5, ("(%s) rejecting res because period %lu is less than %lu\n",
Inst->Self->Name, res->Period, MIN_RES_PERIOD));
return HLS_INVALID_PARAMETER;
***************
*** 954,958 ****
return HLS_INVALID_PARAMETER;
}
! sscanf(s, "%lld %lld", &res.Amount, &res.Period);
status = BeginRes(Inst, bvp, &res);
}
--- 959,963 ----
return HLS_INVALID_PARAMETER;
}
! sscanf(s, "%lu %lu", &res.Amount, &res.Period);
status = BeginRes(Inst, bvp, &res);
}
Index: hls_sched_rr.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/hls/hls_sched_rr.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** hls_sched_rr.c 25 Feb 2003 09:18:53 -0000 1.11
--- hls_sched_rr.c 8 Nov 2003 10:34:31 -0000 1.12
***************
*** 502,506 ****
while (1) {
! for (i=1; i<MAXIMUM_PRIORITY; i++) {
if (Inst->ReadyMask & (1 << i)) {
if (y == x) {
--- 502,506 ----
while (1) {
! for (i=1; i < HLS_MAXIMUM_PRIORITY; i++) {
if (Inst->ReadyMask & (1 << i)) {
if (y == x) {
***************
*** 928,932 ****
HLS_ASSERT (Inst->ReadyMask & 0x01); // FIXME - WTF?
! for (i=1; i<MAXIMUM_PRIORITY; i++) {
if (Inst->ReadyMask & (1<<i)) {
--- 928,932 ----
HLS_ASSERT (Inst->ReadyMask & 0x01); // FIXME - WTF?
! for (i=1; i < HLS_MAXIMUM_PRIORITY; i++) {
if (Inst->ReadyMask & (1<<i)) {
***************
*** 1082,1086 ****
HLS_ASSERT (ud);
if (m->Pri < 1 ||
! m->Pri > MAXIMUM_PRIORITY) {
HLSDbgPrint (9, ("(%s) oops: pri %d is out of range\n",
Inst->Self->Name, m->Pri));
--- 1082,1086 ----
HLS_ASSERT (ud);
if (m->Pri < 1 ||
! m->Pri > (HLS_MAXIMUM_PRIORITY - 1)) { /* Luca */
HLSDbgPrint (9, ("(%s) oops: pri %d is out of range\n",
Inst->Self->Name, m->Pri));
***************
*** 1171,1175 ****
int i;
! Inst->ReadyList = (LIST_ENTRY *)hls_malloc(sizeof (LIST_ENTRY[MAXIMUM_PRIORITY]));
HLS_ASSERT (Inst->ReadyList);
--- 1171,1175 ----
int i;
! Inst->ReadyList = (LIST_ENTRY *)hls_malloc(sizeof (LIST_ENTRY[HLS_MAXIMUM_PRIORITY]));
HLS_ASSERT (Inst->ReadyList);
***************
*** 1191,1195 ****
Inst->TProcs[i] = NULL;
}
! for (i=0; i<MAXIMUM_PRIORITY; i++) {
INIT_LIST_HEAD(&Inst->ReadyList[i]);
}
--- 1191,1195 ----
Inst->TProcs[i] = NULL;
}
! for (i=0; i < HLS_MAXIMUM_PRIORITY; i++) {
INIT_LIST_HEAD(&Inst->ReadyList[i]);
}
Index: hls_sched_th.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/hls/hls_sched_th.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** hls_sched_th.c 25 Feb 2003 09:18:53 -0000 1.6
--- hls_sched_th.c 8 Nov 2003 10:34:31 -0000 1.7
***************
*** 34,38 ****
// HLS_ASSERT (!HLSProc[vp->Proc].CurrentThread);
!
HLSScheduleThread (Inst->Thread, vp->Proc);
}
--- 34,41 ----
// HLS_ASSERT (!HLSProc[vp->Proc].CurrentThread);
!
! if ((Inst->Thread)->state != 0) {
! hls_printk("Granting CPU to thread with state %ld\n", Inst->Thread->state);
! }
HLSScheduleThread (Inst->Thread, vp->Proc);
}
Index: hls_utils.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/hls/hls_utils.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** hls_utils.c 25 Feb 2003 09:18:53 -0000 1.14
--- hls_utils.c 8 Nov 2003 10:34:31 -0000 1.15
***************
*** 13,16 ****
--- 13,19 ----
#include "thr.h"
+ struct HLS_SCHED_INSTANCE *HLSDefaultSched;
+ struct HLS_SCHED_INSTANCE *hls_rt_sched;
+
int hls_setparam_ascii(struct HLS_SCHED_INSTANCE *inst, char *param)
{
***************
*** 215,221 ****
HLSDefaultSched = p;
if (wasnull) {
! convert_tasks();
}
}
char *hls_instance_name(int i)
--- 218,239 ----
HLSDefaultSched = p;
if (wasnull) {
! hls_convert_tasks();
}
}
+ char *hls_rt_name(void)
+ {
+ if (hls_rt_sched == NULL) {
+ return "";
+ }
+
+ HLSDbgPrint(5, ("RT Scheduler %p: %s\n",
+ hls_rt_sched, hls_rt_sched->Name));
+
+ return hls_rt_sched->Name;
+ }
+ void hls_setrt(void *p)
+ {
+ hls_rt_sched = p;
+ }
char *hls_instance_name(int i)
***************
*** 388,393 ****
#endif
- struct HLS_SCHED_INSTANCE *HLSDefaultSched;
-
#ifdef __INTERNAL_SCHEDULERS__
extern int rr_module_init(void);
--- 406,409 ----
***************
*** 455,458 ****
--- 471,475 ----
#endif
HLSDefaultSched = HLSFP2;
+ hls_rt_sched = HLSFP1;
#endif
}
|
|
From: <lu...@us...> - 2003-11-08 10:34:35
|
Update of /cvsroot/linux-hls/hls/include
In directory sc8-pr-cvs1:/tmp/cvs-serv6094/include
Modified Files:
rsv.h
Log Message:
Lot of changes....
- Unbreak the debugging stuff
- Some random cleanups
- Fixes in the RR scheduler (I hope... MAXIMUM_PRIORITY does not seem to be
a valid priority)
- Allow the RES scheduler to be scheduled (there's a fixme: some functions
still have to be properly implemented)
- change Q e T from long long to long in the RES scheduler
- Implement the "rt scheduler" stuff
Index: rsv.h
===================================================================
RCS file: /cvsroot/linux-hls/hls/include/rsv.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** rsv.h 6 Nov 2002 09:29:02 -0000 1.2
--- rsv.h 8 Nov 2003 10:34:31 -0000 1.3
***************
*** 9,15 ****
HLS_BOOL BeginRes;
HLS_BOOL Soft;
! unsigned long long int Amount;
! unsigned long long int Period;
! void *UserThreadHandle;
};
--- 9,14 ----
HLS_BOOL BeginRes;
HLS_BOOL Soft;
! unsigned long int Amount;
! unsigned long int Period;
};
|
|
From: <lu...@us...> - 2003-08-28 19:52:26
|
Update of /cvsroot/linux-hls/hls/linux
In directory sc8-pr-cvs1:/tmp/cvs-serv8454
Modified Files:
bottom.c m
Log Message:
Fix bug reported by Paul: if a task changed to SCHED_FIFO, it was not possible
to return HLS again...
Index: bottom.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/linux/bottom.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** bottom.c 25 Feb 2003 09:18:55 -0000 1.7
--- bottom.c 28 Aug 2003 19:52:23 -0000 1.8
***************
*** 315,321 ****
--- 315,325 ----
if (policy != SCHED_HLS) {
if (p->private_data != NULL) {
+ #ifdef NOLINUX_TASKS
+ printk("Policy %d != SCHED_HLS. Doing nothing...\n", policy);
+ #else
HLSExitThreadHook(p);
p->policy = SCHED_OTHER;
p->private_data = NULL;
+ #endif
}
***************
*** 349,355 ****
--- 353,365 ----
if (p->private_data == NULL) {
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
}
Index: m
===================================================================
RCS file: /cvsroot/linux-hls/hls/linux/m,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** m 27 Aug 2002 11:26:20 -0000 1.1.1.1
--- m 28 Aug 2003 19:52:23 -0000 1.2
***************
*** 1 ****
! make KERNEL_DIR=/home/luca/src/linux CLI=1 MULDIV=1
--- 1 ----
! make KERNEL_DIR=/home/luca/src/linux-rt CLI=1 MULDIV=1
|
|
From: <lu...@us...> - 2003-08-27 17:52:04
|
Update of /cvsroot/linux-hls/hls/linux
In directory sc8-pr-cvs1:/tmp/cvs-serv31071
Modified Files:
hls_ctl.c
Log Message:
FIX: When moving a task between two schedulers, the Parent field in the
thread scheduler was not properly set to the new value.
As a result, the /proc/HLS/tasks entry was not updated...
Index: hls_ctl.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/linux/hls_ctl.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** hls_ctl.c 25 Feb 2003 09:18:55 -0000 1.6
--- hls_ctl.c 27 Aug 2003 17:52:00 -0000 1.7
***************
*** 101,106 ****
status = th1->vp->TopSched->CB->B_RegisterVP(new_sched, th_inst, th1->vp);
HLS_ASSERT(status == HLS_SUCCESS);
-
HLSDbgPrint(3, ("(infr) registered\n"));
/* This cannot be done until the sched param are set...
--- 101,107 ----
status = th1->vp->TopSched->CB->B_RegisterVP(new_sched, th_inst, th1->vp);
HLS_ASSERT(status == HLS_SUCCESS);
HLSDbgPrint(3, ("(infr) registered\n"));
+
+ th_inst->Parent = new_sched;
/* This cannot be done until the sched param are set...
|
|
From: Luca A. <luc...@em...> - 2003-08-27 08:35:13
|
Hi Paul,
> Luca, we ran schedtest and examined /proc/HLS/tasks while it was
> running: it said that schedtest was using rr2, not res1 as the
> scheduler.
I checked, and it does not seem to be a typo. I think there is something
wrong in hls_setsched()... Thanks for finding and reporting the bug.
I will need to reproduce the problem, and to debug it; I'll do it this
evening. I think I know where the bug is, but I'll need some testing;
maybe something like this patch can fix it:
Index: linux/hls_ctl.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/linux/hls_ctl.c,v
retrieving revision 1.6
diff -u -r1.6 hls_ctl.c
--- linux/hls_ctl.c 25 Feb 2003 09:18:55 -0000 1.6
+++ linux/hls_ctl.c 27 Aug 2003 08:24:48 -0000
@@ -97,10 +97,12 @@
HLS_ASSERT (th1->vp->State == VP_Waiting);
th1->vp->TopSched = new_sched;
-
+
status = th1->vp->TopSched->CB->B_RegisterVP(new_sched, th_inst,
th1->vp);
HLS_ASSERT(status == HLS_SUCCESS);
-
+
+ th->Parent = new_sched;
+
HLSDbgPrint(3, ("(infr) registered\n"));
/* This cannot be done until the sched param are set...
(WARNING: This is a completely untested patch)
If I am right, the bug should not affect the scheduling (only /proc
information are broken).
It would be useful to know if schedtest is behaving correctly for you:
can you send to the list the complete output of schedtest, together with
the contents of /proc/HLS/* ?
Thanks,
Luca
--
_____________________________________________________________________________
Copy this in your signature, if you think it is important:
N O W A R ! ! !
--
Email.it, the professional e-mail, gratis per te: http://www.email.it/f
Sponsor:
Cosa ne pensi della patente a punti? Se vuoi dare la tua opinione clicca qui
Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=1723&d=27-8
|
|
From: <lu...@us...> - 2003-02-25 09:19:29
|
Update of /cvsroot/linux-hls/hls/hls In directory sc8-pr-cvs1:/tmp/cvs-serv25577/hls Modified Files: hls_debug.c hls_hooks.c hls_proc.c hls_sched_join.c hls_sched_lot.c hls_sched_ps.c hls_sched_res.c hls_sched_root.c hls_sched_rr.c hls_sched_th.c hls_utils.c Log Message: Updated the license Index: hls_debug.c =================================================================== RCS file: /cvsroot/linux-hls/hls/hls/hls_debug.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** hls_debug.c 5 Sep 2002 12:29:11 -0000 1.3 --- hls_debug.c 25 Feb 2003 09:18:52 -0000 1.4 *************** *** 1,26 **** ! /*++ ! ! Copyright (c) 2000 John Regehr ! ! Module Name: ! ! hls_debug.c ! ! Abstract: ! ! ! Author: ! ! John Regehr 14-Feb-2000 ! ! Environment: ! ! All of the functions in this module execute in kernel mode except ! the function that raises a user mode alert condition. ! ! Revision History: ! ! ! --*/ #include "hls_common.h" --- 1,11 ---- ! /* ! * Copyright (c) 2000 John Regehr ! * ! * Module Name: hls_debug.c ! * Abstract: Miscellaneous functions used when debugging is enabled ! * Author: John Regehr 14-Feb-2000 ! * ! * This is free software; see BSD.txt ! */ #include "hls_common.h" Index: hls_hooks.c =================================================================== RCS file: /cvsroot/linux-hls/hls/hls/hls_hooks.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** hls_hooks.c 5 Sep 2002 12:29:11 -0000 1.5 --- hls_hooks.c 25 Feb 2003 09:18:52 -0000 1.6 *************** *** 1,23 **** ! /*++ ! ! Copyright (c) 2000 John Regehr ! ! Module Name: ! ! hls_hooks.c ! ! Abstract: ! ! ! Author: ! ! John Regehr 14-Feb-2000 ! ! Environment: ! ! Revision History: ! ! ! --*/ #include "hls_common.h" --- 1,13 ---- ! /* ! * Copyright (c) 2000 John Regehr ! * ! * Module Name: hls_hooks.c ! * Abstract: This is the ``interface'' between HLS and the kernel. The ! * hooks are invoked by the kernel when some important events ! * happen. ! * Author: John Regehr 14-Feb-2000 ! * ! * This is free software; see BSD.txt ! */ #include "hls_common.h" Index: hls_proc.c =================================================================== RCS file: /cvsroot/linux-hls/hls/hls/hls_proc.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** hls_proc.c 28 Aug 2002 14:39:38 -0000 1.2 --- hls_proc.c 25 Feb 2003 09:18:53 -0000 1.3 *************** *** 1,23 **** ! /*++ ! ! Copyright (c) 2000 John Regehr ! ! Module Name: ! ! hls_hooks.c ! ! Abstract: ! ! ! Author: ! ! John Regehr 14-Feb-2000 ! ! Environment: ! ! Revision History: ! ! ! --*/ #include "hls_common.h" --- 1,12 ---- ! /* ! * Copyright (c) 2000 John Regehr ! * ! * Module Name: hls_proc.c ! * Abstract: Processor-related functions... We do not use them, for the ! * moment (this may change with the multiprocessor extension) ! * Author: John Regehr 14-Feb-2000 ! * ! * This is free software; see BSD.txt ! */ #include "hls_common.h" Index: hls_sched_join.c =================================================================== RCS file: /cvsroot/linux-hls/hls/hls/hls_sched_join.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** hls_sched_join.c 25 Nov 2002 11:33:30 -0000 1.5 --- hls_sched_join.c 25 Feb 2003 09:18:53 -0000 1.6 *************** *** 1,23 **** ! /*++ ! ! Copyright (c) 2000 John Regehr ! ! Module Name: ! ! hls_sched_join.c ! ! Abstract: ! ! Uniprocessor join scheduler. ! ! Author: ! ! John Regehr 14-Feb-2000 ! ! Environment: ! ! Revision History: ! ! --*/ #include "hls_common.h" --- 1,11 ---- ! /* ! * Copyright (c) 2000 John Regehr ! * ! * Module Name: hls_sched_join.c ! * Abstract: Uniprocessor Join Scheduler. ! * Author: John Regehr 14-Feb-2000 ! * ! * This is free software; see BSD.txt ! */ #include "hls_common.h" Index: hls_sched_lot.c =================================================================== RCS file: /cvsroot/linux-hls/hls/hls/hls_sched_lot.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** hls_sched_lot.c 20 Dec 2002 12:14:25 -0000 1.1 --- hls_sched_lot.c 25 Feb 2003 09:18:53 -0000 1.2 *************** *** 1,24 **** ! /*++ ! ! Module Name: ! ! hls_sched_lot.c ! ! Abstract: ! ! Uniprocessor CPU reservation scheduler. Schedules tasks EDF, ! tasks can only run when they have positive budget, budgets are ! replenished each period. ! ! Authors: ! ! John Regehr 14-Feb-2000 ! Matt Probst 14-Dec-2002 ! ! Environment: ! ! Revision History: ! ! --*/ #include <hls_interface.h> --- 1,11 ---- ! /* ! * Copyright (c) 2000 John Regehr ! * ! * Module Name: hls_sched_lot.c ! * Abstract: Uniprocessor Lottery Scheduler. ! * Authors: John Regehr 14-Feb-2000, Matt Probst 14-Dec-2002 ! * ! * This is free software; see BSD.txt ! */ #include <hls_interface.h> Index: hls_sched_ps.c =================================================================== RCS file: /cvsroot/linux-hls/hls/hls/hls_sched_ps.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** hls_sched_ps.c 13 Dec 2002 11:13:59 -0000 1.8 --- hls_sched_ps.c 25 Feb 2003 09:18:53 -0000 1.9 *************** *** 1,25 **** ! /*++ ! ! Copyright (c) 2000 John Regehr ! ! Module Name: ! ! hls_sched_res.c ! ! Abstract: ! ! Uniprocessor CPU reservation scheduler. Schedules tasks EDF, ! tasks can only run when they have positive budget, budgets are ! replenished each period. ! ! Author: ! ! John Regehr 14-Feb-2000 ! ! Environment: ! ! Revision History: ! ! --*/ #include <hls_interface.h> --- 1,11 ---- ! /* ! * Copyright (c) 2000 John Regehr ! * ! * Module Name: hls_sched_ps.c ! * Abstract: Uniprocessor Proportional Share Scheduler. ! * Author: John Regehr 14-Feb-2000 ! * ! * This is free software; see BSD.txt ! */ #include <hls_interface.h> Index: hls_sched_res.c =================================================================== RCS file: /cvsroot/linux-hls/hls/hls/hls_sched_res.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** hls_sched_res.c 25 Nov 2002 11:33:31 -0000 1.9 --- hls_sched_res.c 25 Feb 2003 09:18:53 -0000 1.10 *************** *** 1,26 **** ! /*++ ! ! Copyright (c) 2000 John Regehr ! ! Module Name: ! ! hls_sched_res.c ! ! Abstract: ! ! Uniprocessor CPU reservation scheduler. Schedules tasks EDF, ! tasks can only run when they have positive budget, budgets are ! replenished each period. ! ! Author: ! ! John Regehr 14-Feb-2000 ! ! Environment: ! ! Revision History: ! ! ! --*/ #include "hls_interface.h" --- 1,13 ---- ! /* ! * Copyright (c) 2000 John Regehr ! * ! * Module Name: hls_sched_res.c ! * Abstract: Uniprocessor CPU reservation Scheduler. Schedules tasks EDF, ! * tasks can only run when they have positive budget, budgets are ! * replenished each period. ! * Authors: John Regehr 14-Feb-2000 ! * ! * This is free software; see BSD.txt ! */ #include "hls_interface.h" Index: hls_sched_root.c =================================================================== RCS file: /cvsroot/linux-hls/hls/hls/hls_sched_root.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** hls_sched_root.c 25 Nov 2002 11:33:31 -0000 1.5 --- hls_sched_root.c 25 Feb 2003 09:18:53 -0000 1.6 *************** *** 1,23 **** ! /*++ ! ! Copyright (c) 2000 John Regehr ! ! Module Name: ! ! hls_sched.c ! ! Abstract: ! ! ! Author: ! ! John Regehr 14-Feb-2000 ! ! Environment: ! ! Revision History: ! ! ! --*/ #include "hls_common.h" --- 1,11 ---- ! /* ! * Copyright (c) 2000 John Regehr ! * ! * Module Name: hls_sched_root.c ! * Abstract: HLS Root Scheduler. ! * Author: John Regehr 14-Feb-2000 ! * ! * This is free software; see BSD.txt ! */ #include "hls_common.h" Index: hls_sched_rr.c =================================================================== RCS file: /cvsroot/linux-hls/hls/hls/hls_sched_rr.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** hls_sched_rr.c 13 Dec 2002 11:13:59 -0000 1.10 --- hls_sched_rr.c 25 Feb 2003 09:18:53 -0000 1.11 *************** *** 1,25 **** ! /*++ ! ! Copyright (c) 2000 John Regehr ! ! Module Name: ! ! hls_sched_rr.c ! ! Abstract: ! ! Multiprocessor fixed-priority or round-robin (configurable at ! instantiation time) loadable scheduler. ! ! Author: ! ! John Regehr 14-Feb-2000 ! ! Environment: ! ! Revision History: ! ! ! --*/ // FIXME: think about making this scheduler into a space-sharing scheduler --- 1,12 ---- ! /* ! * Copyright (c) 2000 John Regehr ! * ! * Module Name: hls_sched_rr.c ! * Abstract: Multiprocessor Fixed-Priority or Round-Robin ! * (configurable at instantiation time) Scheduler. ! * Author: John Regehr 14-Feb-2000 ! * ! * This is free software; see BSD.txt ! */ // FIXME: think about making this scheduler into a space-sharing scheduler Index: hls_sched_th.c =================================================================== RCS file: /cvsroot/linux-hls/hls/hls/hls_sched_th.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** hls_sched_th.c 17 Oct 2002 08:21:38 -0000 1.5 --- hls_sched_th.c 25 Feb 2003 09:18:53 -0000 1.6 *************** *** 1,25 **** ! /*++ ! ! Copyright (c) 2000 John Regehr ! ! Module Name: ! ! hls_sched_rr.c ! ! Abstract: ! ! Multiprocessor fixed-priority or round-robin (configurable at ! instantiation time) loadable scheduler. ! ! Author: ! ! John Regehr 14-Feb-2000 ! ! Environment: ! ! Revision History: ! ! ! --*/ #include "hls_common.h" --- 1,11 ---- ! /* ! * Copyright (c) 2000 John Regehr ! * ! * Module Name: hls_sched_th.c ! * Abstract: HLS Thread Scheduler. ! * Author: John Regehr 14-Feb-2000 ! * ! * This is free software; see BSD.txt ! */ #include "hls_common.h" Index: hls_utils.c =================================================================== RCS file: /cvsroot/linux-hls/hls/hls/hls_utils.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** hls_utils.c 13 Dec 2002 11:13:59 -0000 1.13 --- hls_utils.c 25 Feb 2003 09:18:53 -0000 1.14 *************** *** 1,23 **** ! /*++ ! ! Copyright (c) 2000 John Regehr ! ! Module Name: ! ! hls_hooks.c ! ! Abstract: ! ! ! Author: ! ! John Regehr 14-Feb-2000 ! ! Environment: ! ! Revision History: ! ! ! --*/ #include "hls_common.h" --- 1,11 ---- ! /* ! * Copyright (c) 2000 John Regehr ! * ! * Module Name: hls_utils.c ! * Abstract: HLS utility functions. ! * Author: John Regehr 14-Feb-2000 ! * ! * This is free software; see BSD.txt ! */ #include "hls_common.h" |
|
From: <lu...@us...> - 2003-02-25 09:19:29
|
Update of /cvsroot/linux-hls/hls/linux
In directory sc8-pr-cvs1:/tmp/cvs-serv25577/linux
Modified Files:
bottom.c export.c hls_ctl.c hls_timers.c init.c procfs.c
sched.c
Log Message:
Updated the license
Index: bottom.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/linux/bottom.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** bottom.c 25 Nov 2002 11:33:32 -0000 1.6
--- bottom.c 25 Feb 2003 09:18:55 -0000 1.7
***************
*** 1,2 ****
--- 1,14 ----
+ /*
+ * Copyright (c) 2002 Luca Abeni
+ *
+ * Module Name: bottom.c
+ * Abstract: This is the low level interface with the Linux kernel,
+ * containing the hooks called by the gensched patch and the
+ * functions used to schedule a task in Linux.
+ * Author: Luca Abeni 2-Feb-2002
+ *
+ * This is free software; see GPL.txt
+ */
+
#include <interface-funcs.h>
#include <linux/smp_lock.h>
Index: export.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/linux/export.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** export.c 25 Nov 2002 11:33:32 -0000 1.1
--- export.c 25 Feb 2003 09:18:55 -0000 1.2
***************
*** 1,2 ****
--- 1,13 ----
+ /*
+ * Copyright (c) 2002 Luca Abeni
+ *
+ * Module Name: export.c
+ * Abstract: This file exports the HLS API to external HLS schedulers,
+ * when they are built as Linux modules.
+ * Author: Luca Abeni 2-Feb-2002
+ *
+ * This is free software; see GPL.txt
+ */
+
#include <interface-funcs.h>
#include <interface-data.h>
Index: hls_ctl.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/linux/hls_ctl.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** hls_ctl.c 25 Nov 2002 11:33:32 -0000 1.5
--- hls_ctl.c 25 Feb 2003 09:18:55 -0000 1.6
***************
*** 1,23 ****
! /*++
!
! Copyright (c) 2000 John Regehr
!
! Module Name:
!
! hls_hooks.c
!
! Abstract:
!
!
! Author:
!
! John Regehr 14-Feb-2000
!
! Environment:
!
! Revision History:
!
!
! --*/
#include "hls_common.h"
--- 1,12 ----
! /*
! * Copyright (c) 2002 Luca Abeni & John Regehr
! *
! * Module Name: hls_ctl.c
! * Abstract: This file implements the user interface for HLS,
! * allowing to move tasks between scheduler instances.
! * Author: Luca Abeni 2002, John Regehr 2000
! *
! * This is free software; see GPL.txt
! */
#include "hls_common.h"
Index: hls_timers.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/linux/hls_timers.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** hls_timers.c 25 Nov 2002 11:33:32 -0000 1.4
--- hls_timers.c 25 Feb 2003 09:18:55 -0000 1.5
***************
*** 1,26 ****
! /*++
!
! Copyright (c) 2000 John Regehr
!
! Module Name:
!
! hls_hooks.c
!
! Abstract:
!
!
! Author:
!
! John Regehr 14-Feb-2000
!
! Environment:
!
! Revision History:
!
!
! --*/
#include <hls_common.h> /* For struct HLS_SCHED_INSTANCE */
- //#include <linux/timer.h>
extern spinlock_t hls_lock;
--- 1,13 ----
! /*
! * Copyright (c) 2002 Luca Abeni & John Regehr
! *
! * Module Name: hls_ctl.c
! * Abstract: Kernel-dependent part of the timers mechanism.
! * Author: Luca Abeni 2002, John Regehr 2000
! *
! * This is free software; see GPL.txt
! */
#include <hls_common.h> /* For struct HLS_SCHED_INSTANCE */
extern spinlock_t hls_lock;
Index: init.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/linux/init.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** init.c 25 Nov 2002 11:33:32 -0000 1.5
--- init.c 25 Feb 2003 09:18:55 -0000 1.6
***************
*** 1,2 ****
--- 1,12 ----
+ /*
+ * Copyright (c) 2002 Luca Abeni
+ *
+ * Module Name: init.c
+ * Abstract: Module initialization and cleanup.
+ * Author: Luca Abeni 2-Feb-2002
+ *
+ * This is free software; see GPL.txt
+ */
+
#include <linux/config.h>
#if defined(CONFIG_MODVERSIONS) && !defined(MODVERSIONS)
***************
*** 23,27 ****
#endif
! MODULE_LICENSE("Dual BSD/GPL");
extern void hls_bottom_vp_request(struct task_struct *t);
--- 33,37 ----
#endif
! MODULE_LICENSE("GPL");
extern void hls_bottom_vp_request(struct task_struct *t);
Index: procfs.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/linux/procfs.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** procfs.c 25 Nov 2002 11:33:32 -0000 1.5
--- procfs.c 25 Feb 2003 09:18:55 -0000 1.6
***************
*** 1,2 ****
--- 1,13 ----
+ /*
+ * Copyright (c) 2002 Luca Abeni
+ *
+ * Module Name: procfs.c
+ * Abstract: ProcFS interface for HLS: allows to create scheduler
+ * instances and to build the schedulers hierarchy.
+ * Author: Luca Abeni 2-Feb-2002
+ *
+ * This is free software; see GPL.txt
+ */
+
#include <linux/config.h>
#if defined(CONFIG_MODVERSIONS) && !defined(MODVERSIONS)
Index: sched.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/linux/sched.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** sched.c 27 Aug 2002 12:41:30 -0000 1.2
--- sched.c 25 Feb 2003 09:18:55 -0000 1.3
***************
*** 1,2 ****
--- 1,12 ----
+ /*
+ * Copyright (c) 2002 Luca Abeni
+ *
+ * Module Name: sched.c
+ * Abstract: Moves tasks between schedulers.
+ * Author: Luca Abeni 2-Feb-2002
+ *
+ * This is free software; see GPL.txt
+ */
+
static inline struct task_struct *find_process_by_pid(pid_t pid)
{
|
Update of /cvsroot/linux-hls/hls/hls/include In directory sc8-pr-cvs1:/tmp/cvs-serv25577/hls/include Modified Files: hls_common.h hls_debug.h hls_interface.h hls_internal.h join.h lot.h ps.h rr.h rsv.h thr.h Log Message: Updated the license Index: hls_common.h =================================================================== RCS file: /cvsroot/linux-hls/hls/hls/include/hls_common.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** hls_common.h 25 Nov 2002 11:33:31 -0000 1.8 --- hls_common.h 25 Feb 2003 09:18:54 -0000 1.9 *************** *** 1,19 **** ! /*++ ! ! Copyright (c) 2000 John Regehr ! ! Module Name: ! ! hls.h ! ! Abstract: ! ! Author: ! ! John Regehr 14-Feb-2000 ! ! Revision History: ! ! --*/ #ifndef _HLS_COMMON_H_ --- 1,11 ---- ! /* ! * Copyright (c) 2000 John Regehr ! * ! * Module Name: hls_common.h ! * Abstract: Common functions used by all the HLS files. ! * Author: John Regehr 14-Feb-2000 ! * ! * This is free software; see BSD.txt ! */ #ifndef _HLS_COMMON_H_ Index: hls_debug.h =================================================================== RCS file: /cvsroot/linux-hls/hls/hls/include/hls_debug.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** hls_debug.h 25 Nov 2002 11:33:31 -0000 1.1 --- hls_debug.h 25 Feb 2003 09:18:54 -0000 1.2 *************** *** 1,2 **** --- 1,12 ---- + /* + * Copyright (c) 2000 John Regehr & Luca Abeni + * + * Module Name: hls_debug.h + * Abstract: HLS debugging functions. + * Author: John Regehr 14-Feb-2000, Luca Abeni 2002 + * + * This is free software; see BSD.txt + */ + #ifndef __HLS_DEBUG__ #define __HLS_DEBUG__ Index: hls_interface.h =================================================================== RCS file: /cvsroot/linux-hls/hls/hls/include/hls_interface.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** hls_interface.h 25 Nov 2002 11:33:31 -0000 1.1 --- hls_interface.h 25 Feb 2003 09:18:54 -0000 1.2 *************** *** 1,2 **** --- 1,12 ---- + /* + * Copyright (c) 2000 John Regehr & Luca Abeni + * + * Module Name: hls_interface.h + * Abstract: Definition of the HLS API. + * Author: John Regehr 14-Feb-2000, Luca Abeni 2002 + * + * This is free software; see BSD.txt + */ + #ifndef __HLS_INTERFACE__ #define __HLS_INTERFACE__ Index: hls_internal.h =================================================================== RCS file: /cvsroot/linux-hls/hls/hls/include/hls_internal.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** hls_internal.h 27 Aug 2002 11:26:20 -0000 1.1.1.1 --- hls_internal.h 25 Feb 2003 09:18:54 -0000 1.2 *************** *** 1,19 **** ! /*++ ! ! Copyright (c) 2000 John Regehr ! ! Module Name: ! ! hls.h ! ! Abstract: ! ! Author: ! ! John Regehr 14-Feb-2000 ! ! Revision History: ! ! --*/ #ifndef _HLS_H_ --- 1,11 ---- ! /* ! * Copyright (c) 2000 John Regehr & Luca Abeni ! * ! * Module Name: hls_internal.h ! * Abstract: HLS internals, not exported to HLS schedulers. ! * Author: John Regehr 14-Feb-2000, Luca Abeni 2002 ! * ! * This is free software; see BSD.txt ! */ #ifndef _HLS_H_ Index: join.h =================================================================== RCS file: /cvsroot/linux-hls/hls/hls/include/join.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** join.h 27 Aug 2002 11:26:20 -0000 1.1.1.1 --- join.h 25 Feb 2003 09:18:54 -0000 1.2 *************** *** 1,2 **** --- 1,12 ---- + /* + * Copyright (c) 2000 John Regehr & Luca Abeni + * + * Module Name: join.h + * Abstract: Definitions used by the Join Scheduler. + * Author: John Regehr 14-Feb-2000, Luca Abeni 2002 + * + * This is free software; see BSD.txt + */ + #ifndef __HLS_JOIN_H__ #define __HLS_JOIN_H__ Index: lot.h =================================================================== RCS file: /cvsroot/linux-hls/hls/hls/include/lot.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** lot.h 20 Dec 2002 12:14:26 -0000 1.1 --- lot.h 25 Feb 2003 09:18:54 -0000 1.2 *************** *** 1,2 **** --- 1,12 ---- + /* + * Copyright (c) 2000 John Regehr + * + * Module Name: lot.h + * Abstract: Definitions used by the Lottery Scheduler. + * Author: John Regehr 14-Feb-2000 + * + * This is free software; see BSD.txt + */ + #ifndef __HLS_LOT_H__ #define __HLS_LOT_H__ Index: ps.h =================================================================== RCS file: /cvsroot/linux-hls/hls/hls/include/ps.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** ps.h 27 Aug 2002 11:26:20 -0000 1.1.1.1 --- ps.h 25 Feb 2003 09:18:54 -0000 1.2 *************** *** 1,2 **** --- 1,12 ---- + /* + * Copyright (c) 2000 John Regehr & Luca Abeni + * + * Module Name: ps.h + * Abstract: Definitions used by the Proportional Share Scheduler. + * Author: John Regehr 14-Feb-2000, Luca Abeni 2002 + * + * This is free software; see BSD.txt + */ + #ifndef __HLS_PS_H__ #define __HLS_PS_H__ Index: rr.h =================================================================== RCS file: /cvsroot/linux-hls/hls/hls/include/rr.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** rr.h 27 Aug 2002 11:26:20 -0000 1.1.1.1 --- rr.h 25 Feb 2003 09:18:54 -0000 1.2 *************** *** 1,2 **** --- 1,12 ---- + /* + * Copyright (c) 2000 John Regehr & Luca Abeni + * + * Module Name: rr.h + * Abstract: Definitions used by the Round Robin Scheduler. + * Author: John Regehr 14-Feb-2000, Luca Abeni 2002 + * + * This is free software; see BSD.txt + */ + #ifndef __HLS_RR_H__ #define __HLS_RR_H__ Index: rsv.h =================================================================== RCS file: /cvsroot/linux-hls/hls/hls/include/rsv.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** rsv.h 25 Nov 2002 11:33:31 -0000 1.2 --- rsv.h 25 Feb 2003 09:18:54 -0000 1.3 *************** *** 1,2 **** --- 1,12 ---- + /* + * Copyright (c) 2000 John Regehr & Luca Abeni + * + * Module Name: rsv.h + * Abstract: Definitions used by the Reservation Scheduler. + * Author: John Regehr 14-Feb-2000, Luca Abeni 2002 + * + * This is free software; see BSD.txt + */ + #ifndef __HLS_RSV_H__ #define __HLS_RSV_H__ Index: thr.h =================================================================== RCS file: /cvsroot/linux-hls/hls/hls/include/thr.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** thr.h 25 Nov 2002 11:33:31 -0000 1.2 --- thr.h 25 Feb 2003 09:18:55 -0000 1.3 *************** *** 1,2 **** --- 1,12 ---- + /* + * Copyright (c) 2000 John Regehr & Luca Abeni + * + * Module Name: thr.h + * Abstract: Definitions used by the Thread Scheduler. + * Author: John Regehr 14-Feb-2000, Luca Abeni 2002 + * + * This is free software; see BSD.txt + */ + #ifndef __HLS_TH_H__ #define __HLS_TH_H__ |
Update of /cvsroot/linux-hls/hls/linux/include In directory sc8-pr-cvs1:/tmp/cvs-serv25577/linux/include Modified Files: bitfields.h data.h debug-funcs.h funcs.h hls.h interface-data.h interface-funcs.h Log Message: Updated the license Index: bitfields.h =================================================================== RCS file: /cvsroot/linux-hls/hls/linux/include/bitfields.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** bitfields.h 25 Nov 2002 11:33:32 -0000 1.2 --- bitfields.h 25 Feb 2003 09:18:55 -0000 1.3 *************** *** 1,2 **** --- 1,12 ---- + /* + * Copyright (c) 2002 Luca Abeni + * + * Module Name: bitfields.h + * Abstract: As said below, a hack! + * Author: Luca Abeni 2002 + * + * This is free software; see GPL.txt + */ + /* This is clearly a hack! */ extern unsigned char KiFindLeftNibbleBitTable[]; Index: data.h =================================================================== RCS file: /cvsroot/linux-hls/hls/linux/include/data.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** data.h 25 Nov 2002 11:33:32 -0000 1.2 --- data.h 25 Feb 2003 09:18:55 -0000 1.3 *************** *** 1,2 **** --- 1,12 ---- + /* + * Copyright (c) 2002 Luca Abeni + * + * Module Name: data.h + * Abstract: HLS data + * Author: Luca Abeni 2002 + * + * This is free software; see GPL.txt + */ + #ifndef __DATA__ #define __DATA__ Index: debug-funcs.h =================================================================== RCS file: /cvsroot/linux-hls/hls/linux/include/debug-funcs.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** debug-funcs.h 25 Nov 2002 11:33:32 -0000 1.1 --- debug-funcs.h 25 Feb 2003 09:18:55 -0000 1.2 *************** *** 1,2 **** --- 1,12 ---- + /* + * Copyright (c) 2002 Luca Abeni + * + * Module Name: debug-funcs.h + * Abstract: Kernel-dependent bits of the debugging functions. + * Author: Luca Abeni 2002 + * + * This is free software; see GPL.txt + */ + #ifndef __DEBUG_FUNCS_H__ #define __DEBUG_FUNCS_H__ Index: funcs.h =================================================================== RCS file: /cvsroot/linux-hls/hls/linux/include/funcs.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** funcs.h 25 Nov 2002 11:33:32 -0000 1.6 --- funcs.h 25 Feb 2003 09:18:55 -0000 1.7 *************** *** 1,2 **** --- 1,12 ---- + /* + * Copyright (c) 2002 Luca Abeni + * + * Module Name: funcs.h + * Abstract: Kernel-dependent functions needed by HLS. + * Author: Luca Abeni 2002 + * + * This is free software; see GPL.txt + */ + #ifndef __FUNCS__ #define __FUNCS__ Index: hls.h =================================================================== RCS file: /cvsroot/linux-hls/hls/linux/include/hls.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** hls.h 27 Aug 2002 11:26:20 -0000 1.1.1.1 --- hls.h 25 Feb 2003 09:18:55 -0000 1.2 *************** *** 1,2 **** --- 1,12 ---- + /* + * Copyright (c) 2002 Luca Abeni + * + * Module Name: hls.h + * Abstract: Kernel-dependent data needed by HLS. + * Author: Luca Abeni 2002 + * + * This is free software; see GPL.txt + */ + #ifndef __HLS_H__ #define __HLS_H__ Index: interface-data.h =================================================================== RCS file: /cvsroot/linux-hls/hls/linux/include/interface-data.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** interface-data.h 25 Nov 2002 11:33:32 -0000 1.1 --- interface-data.h 25 Feb 2003 09:18:55 -0000 1.2 *************** *** 1,2 **** --- 1,12 ---- + /* + * Copyright (c) 2002 Luca Abeni + * + * Module Name: interface-data.h + * Abstract: Kernel-dependent bits of the HLS API - Data. + * Author: Luca Abeni 2002 + * + * This is free software; see GPL.txt + */ + #ifndef __INTERFACE_DATA__ #define __INTERFACE_DATA__ Index: interface-funcs.h =================================================================== RCS file: /cvsroot/linux-hls/hls/linux/include/interface-funcs.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** interface-funcs.h 25 Nov 2002 11:33:32 -0000 1.1 --- interface-funcs.h 25 Feb 2003 09:18:55 -0000 1.2 *************** *** 1,2 **** --- 1,12 ---- + /* + * Copyright (c) 2002 Luca Abeni + * + * Module Name: interface-funcs.h + * Abstract: Kernel-dependent bits of the HLS API - Functions. + * Author: Luca Abeni 2002 + * + * This is free software; see GPL.txt + */ + #ifndef __INTERFACE_FUNCS__ #define __INTERFACE_FUNCS__ |
Update of /cvsroot/linux-hls/hls/simul
In directory sc8-pr-cvs1:/tmp/cvs-serv25577/simul
Modified Files:
Makefile hls_timers.c misc.c sim.c sim_cpu.c sim_events.c
sim_list.c sim_os.c workload.c
Removed Files:
lists.c
Log Message:
Updated the license
Index: Makefile
===================================================================
RCS file: /cvsroot/linux-hls/hls/simul/Makefile,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** Makefile 10 Feb 2003 16:23:45 -0000 1.10
--- Makefile 25 Feb 2003 09:18:55 -0000 1.11
***************
*** 19,23 ****
hls_utils.o hls_sched_rr.o hls_debug.o \
hls_timers.o \
! sim_os.o sim.o sim_events.o sim_cpu.o misc.o lists.o sim_list.o \
workload.o
# \
--- 19,23 ----
hls_utils.o hls_sched_rr.o hls_debug.o \
hls_timers.o \
! sim_os.o sim.o sim_events.o sim_cpu.o misc.o sim_list.o \
workload.o
# \
Index: hls_timers.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/simul/hls_timers.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** hls_timers.c 9 Sep 2002 07:41:46 -0000 1.5
--- hls_timers.c 25 Feb 2003 09:18:56 -0000 1.6
***************
*** 1,5 ****
#include <hls_common.h> /* For struct HLS_SCHED_INSTANCE */
- /* #include "sim.h"*/
#include "heap.h"
#include "event.h"
--- 1,14 ----
+ /*
+ * Copyright (c) 2002 Luca Abeni
+ *
+ * Module Name: hls_timers.c
+ * Abstract: Simulator-dependent part of the timers mechanism.
+ * Author: Luca Abeni 2-Feb-2002
+ *
+ * This is free software; see GPL.txt
+ */
+
#include <hls_common.h> /* For struct HLS_SCHED_INSTANCE */
#include "heap.h"
#include "event.h"
Index: misc.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/simul/misc.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** misc.c 25 Nov 2002 11:33:32 -0000 1.3
--- misc.c 25 Feb 2003 09:18:56 -0000 1.4
***************
*** 1,2 ****
--- 1,13 ----
+ /*
+ * Copyright (c) 2002 Luca Abeni
+ *
+ * Module Name: misc.c
+ * Abstract: Miscellaneous functions, needed to compile the simulator.
+ * This will be eventually removed.
+ * Author: Luca Abeni 2-Feb-2002
+ *
+ * This is free software; see GPL.txt
+ */
+
unsigned char KiFindLeftNibbleBitTable[] = {0, 0, 1, 1, 2, 2, 2, 2,
3, 3, 3, 3, 3, 3, 3, 3};
Index: sim.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/simul/sim.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** sim.c 10 Feb 2003 16:23:45 -0000 1.8
--- sim.c 25 Feb 2003 09:18:57 -0000 1.9
***************
*** 1,2 ****
--- 1,12 ----
+ /*
+ * Copyright (c) 2002 Luca Abeni
+ *
+ * Module Name: sim.c
+ * Abstract: Core of the simulator backend.
+ * Author: Luca Abeni 2-Feb-2002
+ *
+ * This is free software; see GPL.txt
+ */
+
#include <stdio.h>
#include <stdlib.h>
Index: sim_cpu.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/simul/sim_cpu.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** sim_cpu.c 10 Feb 2003 16:23:45 -0000 1.10
--- sim_cpu.c 25 Feb 2003 09:18:57 -0000 1.11
***************
*** 1,2 ****
--- 1,12 ----
+ /*
+ * Copyright (c) 2002 Luca Abeni & John Regehr
+ *
+ * Module Name: sim_cpu.c
+ * Abstract: Simulator backend: CPU management.
+ * Author: Luca Abeni 2002, John Regehr 2000
+ *
+ * This is free software; see GPL.txt
+ */
+
#include <stdio.h>
Index: sim_events.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/simul/sim_events.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** sim_events.c 10 Feb 2003 16:23:45 -0000 1.12
--- sim_events.c 25 Feb 2003 09:18:57 -0000 1.13
***************
*** 1,2 ****
--- 1,12 ----
+ /*
+ * Copyright (c) 2002 Luca Abeni & John Regehr
+ *
+ * Module Name: sim_cpu.c
+ * Abstract: Simulator backend: Event Handling.
+ * Author: Luca Abeni 2002, John Regehr 2000
+ *
+ * This is free software; see GPL.txt
+ */
+
#include <stdio.h>
#include <stdlib.h>
Index: sim_list.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/simul/sim_list.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** sim_list.c 3 Oct 2002 09:19:54 -0000 1.1
--- sim_list.c 25 Feb 2003 09:18:57 -0000 1.2
***************
*** 1,9 ****
! #include <stdlib.h>
! #include <stdio.h>
! struct list_head {
! struct list_head *prev;
! struct list_head *next;
! };
struct eventq_elt {
--- 1,16 ----
! /*
! * Copyright (c) 2002 Luca Abeni
! *
! * Module Name: lists.c
! * Abstract: List management functions.
! * Author: Luca Abeni 2-Feb-2002
! *
! * Part of this file is based on the Linux include/linux/lists.h.
! *
! * This is free software; see GPL.txt
! */
! #include <interface-data.h>
! #include <funcs.h>
struct eventq_elt {
***************
*** 15,92 ****
unsigned long long int time;
void *ptr;
! struct list_head list;
};
! static struct list_head event_list;
!
#define INIT_LIST_HEAD(ptr) do { \
! (ptr)->next = (ptr); (ptr)->prev = (ptr); \
} while (0)
! /*
! * Insert a new entry between two known consecutive entries.
! *
! * This is only for internal list manipulation where we know
! * the prev/next entries already!
! */
! static __inline__ void __list_add(struct list_head * new,
! struct list_head * prev,
! struct list_head * next)
! {
! next->prev = new;
! new->next = next;
! new->prev = prev;
! prev->next = new;
! }
!
! /**
! * list_add - add a new entry
! * @new: new entry to be added
! * @head: list head to add it after
! *
! * Insert a new entry after the specified head.
! * This is good for implementing stacks.
! */
! static __inline__ void list_add(struct list_head *new, struct list_head *head)
! {
! __list_add(new, head, head->next);
! }
!
! /**
! * list_add_tail - add a new entry
! * @new: new entry to be added
! * @head: list head to add it before
! *
! * Insert a new entry before the specified head.
! * This is useful for implementing queues.
! */
! static __inline__ void list_add_tail(struct list_head *new, struct list_head *head)
! {
! __list_add(new, head->prev, head);
! }
!
! /*
! * Delete a list entry by making the prev/next entries
! * point to each other.
! *
! * This is only for internal list manipulation where we know
! * the prev/next entries already!
! */
! static __inline__ void __list_del(struct list_head * prev,
! struct list_head * next)
! {
! next->prev = prev;
! prev->next = next;
! }
!
! /**
! * list_del - deletes entry from list.
! * @entry: the element to delete from the list.
! * Note: list_empty on entry does not return true after this, the entry is in an undefined state.
! */
! static __inline__ void list_del(struct list_head *entry)
{
! __list_del(entry->prev, entry->next);
}
--- 22,37 ----
unsigned long long int time;
void *ptr;
! struct sim_list_head list;
};
! static struct sim_list_head event_list;
#define INIT_LIST_HEAD(ptr) do { \
! (ptr)->flink = (ptr); (ptr)->blink = (ptr); \
} while (0)
! void event_list_init(void)
{
! INIT_LIST_HEAD(&event_list);
}
***************
*** 97,102 ****
*/
#define list_for_each(pos, head) \
! for (pos = (head)->next; pos != (head); \
! pos = pos->next)
/**
--- 42,47 ----
*/
#define list_for_each(pos, head) \
! for (pos = (head)->flink; pos != (head); \
! pos = pos->flink)
/**
***************
*** 110,117 ****
!
! void event_list_init(void)
{
! INIT_LIST_HEAD(&event_list);
}
--- 55,103 ----
! void list_del(struct sim_list_head *entry)
{
! struct sim_list_head *prev, *next;
!
! prev = entry->blink;
! next = entry->flink;
! prev->flink = next;
! next->blink = prev;
! }
!
!
! void event_list_getfirst(struct eventq_elt *min)
! {
! struct eventq_elt tmp;
! struct list_elem *p;
!
! p = list_entry(event_list.flink, struct list_elem, list);
! list_del(event_list.flink);
! tmp.ptr = p->ptr;
! tmp.key = p->time;
! memcpy(min, &tmp, sizeof(struct eventq_elt));
! free(p);
! }
!
! void list_add_tail(struct sim_list_head *new, struct sim_list_head *head)
! {
! struct sim_list_head *prev;
!
! prev = head->blink;
! head->blink = new;
! new->flink = head;
! new->blink = prev;
! prev->flink = new;
! }
!
! void list_add(struct sim_list_head *new, struct sim_list_head *head)
! {
! struct sim_list_head *next;
!
! next = head->flink;
!
! head->flink = new;
! new->blink = head;
! new->flink = next;
! next->blink = new;
}
***************
*** 120,124 ****
{
struct list_elem *e;
! struct list_head *p;
int done;
--- 106,110 ----
{
struct list_elem *e;
! struct sim_list_head *p;
int done;
***************
*** 127,136 ****
e->time = t;
! if (event_list.next == &event_list) {
list_add(&e->list, &event_list);
return 1;
} else {
! p = event_list.next;
done = 0;
while (!done) {
--- 113,122 ----
e->time = t;
! if (event_list.flink == &event_list) {
list_add(&e->list, &event_list);
return 1;
} else {
! p = event_list.flink;
done = 0;
while (!done) {
***************
*** 141,145 ****
done = 1;
} else {
! p = p->next;
}
}
--- 127,131 ----
done = 1;
} else {
! p = p->flink;
}
}
***************
*** 148,152 ****
}
! if (p == event_list.next) {
return 1;
}
--- 134,138 ----
}
! if (p == event_list.flink) {
return 1;
}
***************
*** 155,174 ****
}
- void event_list_getfirst(struct eventq_elt *min)
- {
- struct eventq_elt tmp;
- struct list_elem *p;
-
- p = list_entry(event_list.next, struct list_elem, list);
- list_del(event_list.next);
- tmp.ptr = p->ptr;
- tmp.key = p->time;
- memcpy(min, &tmp, sizeof(struct eventq_elt));
- free(p);
- }
void event_list_remove(void *ptr)
{
! struct list_head *h, *h1;
struct list_elem *p, *p1;
--- 141,148 ----
}
void event_list_remove(void *ptr)
{
! struct sim_list_head *h, *h1;
struct list_elem *p, *p1;
***************
*** 190,192 ****
--- 164,171 ----
exit(-1);
}
+ }
+
+ int list_empty(struct sim_list_head *head)
+ {
+ return head->flink == head;
}
Index: sim_os.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/simul/sim_os.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** sim_os.c 10 Feb 2003 16:23:46 -0000 1.7
--- sim_os.c 25 Feb 2003 09:18:57 -0000 1.8
***************
*** 1,2 ****
--- 1,13 ----
+ /*
+ * Copyright (c) 2002 Luca Abeni & John Regehr
+ *
+ * Module Name: sim_os.c
+ * Abstract: Simulator backend: Scheduler simulation code and thread
+ * management.
+ * Author: Luca Abeni 2002, John Regehr 2000
+ *
+ * This is free software; see GPL.txt
+ */
+
#include <stdio.h>
#include <stdlib.h>
Index: workload.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/simul/workload.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** workload.c 10 Feb 2003 16:23:47 -0000 1.2
--- workload.c 25 Feb 2003 09:18:57 -0000 1.3
***************
*** 1,2 ****
--- 1,15 ----
+ /*
+ * Copyright (c) 2002 Luca Abeni
+ *
+ * Module Name: loads/periodic.c
+ * Abstract: Workload generator for the Simulator Backend.
+ * Task set composed of ``periodic tasks'', that
+ * execute for a fixed time C and then block until the
+ * beginning of the next period.
+ * Author: Luca Abeni 2-Feb-2002
+ *
+ * This is free software; see GPL.txt
+ */
+
#include <stdio.h>
#include <stdlib.h>
--- lists.c DELETED ---
|
Update of /cvsroot/linux-hls/hls/simul/include
In directory sc8-pr-cvs1:/tmp/cvs-serv25577/simul/include
Modified Files:
bitfields.h data.h debug-funcs.h event.h funcs.h heap.h
interface-data.h interface-funcs.h os.h sim.h
Log Message:
Updated the license
Index: bitfields.h
===================================================================
RCS file: /cvsroot/linux-hls/hls/simul/include/bitfields.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** bitfields.h 25 Nov 2002 11:33:33 -0000 1.2
--- bitfields.h 25 Feb 2003 09:18:58 -0000 1.3
***************
*** 1,2 ****
--- 1,12 ----
+ /*
+ * Copyright (c) 2002 Luca Abeni
+ *
+ * Module Name: bitfields.h
+ * Abstract: As said below, a hack!
+ * Author: Luca Abeni 2002
+ *
+ * This is free software; see GPL.txt
+ */
+
/* This is clearly a hack! */
extern unsigned char KiFindLeftNibbleBitTable[];
Index: data.h
===================================================================
RCS file: /cvsroot/linux-hls/hls/simul/include/data.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** data.h 25 Nov 2002 11:33:33 -0000 1.4
--- data.h 25 Feb 2003 09:18:58 -0000 1.5
***************
*** 1,2 ****
--- 1,12 ----
+ /*
+ * Copyright (c) 2002 Luca Abeni
+ *
+ * Module Name: data.h
+ * Abstract: HLS data
+ * Author: Luca Abeni 2002
+ *
+ * This is free software; see GPL.txt
+ */
+
#ifndef __DATA_H__
#define __DATA_H__
Index: debug-funcs.h
===================================================================
RCS file: /cvsroot/linux-hls/hls/simul/include/debug-funcs.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** debug-funcs.h 25 Nov 2002 11:33:33 -0000 1.1
--- debug-funcs.h 25 Feb 2003 09:18:58 -0000 1.2
***************
*** 1,2 ****
--- 1,12 ----
+ /*
+ * Copyright (c) 2002 Luca Abeni
+ *
+ * Module Name: debug-funcs.h
+ * Abstract: Simulator-dependent bits of the debugging functions.
+ * Author: Luca Abeni 2002
+ *
+ * This is free software; see GPL.txt
+ */
+
#ifndef __DEBUG_FUNCS_H__
#define __DEBUG_FUNCS_H__
Index: event.h
===================================================================
RCS file: /cvsroot/linux-hls/hls/simul/include/event.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** event.h 7 Oct 2002 08:25:46 -0000 1.3
--- event.h 25 Feb 2003 09:18:58 -0000 1.4
***************
*** 1,2 ****
--- 1,12 ----
+ /*
+ * Copyright (c) 2002 Luca Abeni
+ *
+ * Module Name: event.h
+ * Abstract: Events for the event based simulator.
+ * Author: Luca Abeni 2002
+ *
+ * This is free software; see GPL.txt
+ */
+
#define EVENT_TYPE_INITIALIZE 1
#define EVENT_TYPE_SHUTDOWN 2
Index: funcs.h
===================================================================
RCS file: /cvsroot/linux-hls/hls/simul/include/funcs.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** funcs.h 25 Nov 2002 11:33:33 -0000 1.7
--- funcs.h 25 Feb 2003 09:18:58 -0000 1.8
***************
*** 1,2 ****
--- 1,12 ----
+ /*
+ * Copyright (c) 2002 Luca Abeni
+ *
+ * Module Name: funcs.h
+ * Abstract: Simulator-dependent data needed by HLS.
+ * Author: Luca Abeni 2002
+ *
+ * This is free software; see GPL.txt
+ */
+
#ifndef __FUNCS_H__
#define __FUNCS_H__
Index: heap.h
===================================================================
RCS file: /cvsroot/linux-hls/hls/simul/include/heap.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** heap.h 9 Sep 2002 12:57:01 -0000 1.2
--- heap.h 25 Feb 2003 09:18:58 -0000 1.3
***************
*** 1,2 ****
--- 1,12 ----
+ /*
+ * Copyright (c) 2002 Luca Abeni & John Regehr
+ *
+ * Module Name: heap.h
+ * Abstract: Heap management functions needed by the simulator backend.
+ * Author: Luca Abeni 2002, John Regehr 2000
+ *
+ * This is free software; see GPL.txt
+ */
+
struct eventq_elt {
long long int key;
Index: interface-data.h
===================================================================
RCS file: /cvsroot/linux-hls/hls/simul/include/interface-data.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** interface-data.h 10 Feb 2003 16:23:47 -0000 1.2
--- interface-data.h 25 Feb 2003 09:18:58 -0000 1.3
***************
*** 1,2 ****
--- 1,12 ----
+ /*
+ * Copyright (c) 2002 Luca Abeni
+ *
+ * Module Name: interface-data.h
+ * Abstract: Simulator-dependent bits of the HLS API - Data.
+ * Author: Luca Abeni 2002
+ *
+ * This is free software; see GPL.txt
+ */
+
#ifndef __INTERFACE_DATA__
#define __INTERFACE_DATA__
Index: interface-funcs.h
===================================================================
RCS file: /cvsroot/linux-hls/hls/simul/include/interface-funcs.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** interface-funcs.h 13 Dec 2002 11:26:13 -0000 1.2
--- interface-funcs.h 25 Feb 2003 09:18:58 -0000 1.3
***************
*** 1,2 ****
--- 1,12 ----
+ /*
+ * Copyright (c) 2002 Luca Abeni
+ *
+ * Module Name: interface-funcs.h
+ * Abstract: Simulator-dependent bits of the HLS API - Functions.
+ * Author: Luca Abeni 2002
+ *
+ * This is free software; see GPL.txt
+ */
+
#ifndef __INTERFACE_FUNCS__
#define __INTERFACE_FUNCS__
Index: os.h
===================================================================
RCS file: /cvsroot/linux-hls/hls/simul/include/os.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** os.h 10 Feb 2003 16:23:47 -0000 1.3
--- os.h 25 Feb 2003 09:18:58 -0000 1.4
***************
*** 1,2 ****
--- 1,12 ----
+ /*
+ * Copyright (c) 2002 Luca Abeni
+ *
+ * Module Name: os.h
+ * Abstract: Scheduler simulation and thread management.
+ * Author: Luca Abeni 2002
+ *
+ * This is free software; see GPL.txt
+ */
+
int random_priority(void);
struct sim_task_struct *make_new_thread(long long int create_time,
Index: sim.h
===================================================================
RCS file: /cvsroot/linux-hls/hls/simul/include/sim.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** sim.h 25 Nov 2002 11:33:33 -0000 1.6
--- sim.h 25 Feb 2003 09:18:58 -0000 1.7
***************
*** 1,2 ****
--- 1,12 ----
+ /*
+ * Copyright (c) 2002 Luca Abeni
+ *
+ * Module Name: sim.h
+ * Abstract: HLS Simulator backend: internal function and data.
+ * Author: Luca Abeni 2-Feb-2002
+ *
+ * This is free software; see GPL.txt
+ */
+
#define SIM_MAX_THREADS 6000
|
|
From: <lu...@us...> - 2003-02-25 09:19:02
|
Update of /cvsroot/linux-hls/hls/simul/loads In directory sc8-pr-cvs1:/tmp/cvs-serv25577/simul/loads Modified Files: continuous.c periodic.c standard.c Log Message: Updated the license Index: continuous.c =================================================================== RCS file: /cvsroot/linux-hls/hls/simul/loads/continuous.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** continuous.c 10 Feb 2003 16:23:47 -0000 1.1 --- continuous.c 25 Feb 2003 09:18:58 -0000 1.2 *************** *** 1,2 **** --- 1,14 ---- + /* + * Copyright (c) 2002 Luca Abeni + * + * Module Name: loads/continuous.c + * Abstract: Workload generator for the Simulator Backend. + * Task set composed of ``continuous tasks'', that + * are always backlogged (never block or unblock). + * Author: Luca Abeni 2-Feb-2002 + * + * This is free software; see GPL.txt + */ + #include <stdio.h> #include <stdlib.h> Index: periodic.c =================================================================== RCS file: /cvsroot/linux-hls/hls/simul/loads/periodic.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** periodic.c 10 Feb 2003 16:23:48 -0000 1.1 --- periodic.c 25 Feb 2003 09:18:58 -0000 1.2 *************** *** 1,2 **** --- 1,15 ---- + /* + * Copyright (c) 2002 Luca Abeni + * + * Module Name: loads/periodic.c + * Abstract: Workload generator for the Simulator Backend. + * Task set composed of ``periodic tasks'', that + * execute for a fixed time C and then block until the + * beginning of the next period. + * Author: Luca Abeni 2-Feb-2002 + * + * This is free software; see GPL.txt + */ + #include <stdio.h> #include <stdlib.h> Index: standard.c =================================================================== RCS file: /cvsroot/linux-hls/hls/simul/loads/standard.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** standard.c 10 Feb 2003 16:23:49 -0000 1.1 --- standard.c 25 Feb 2003 09:18:58 -0000 1.2 *************** *** 1,2 **** --- 1,13 ---- + /* + * Copyright (c) 2002 Luca Abeni + * + * Module Name: loads/periodic.c + * Abstract: Workload generator for the Simulator Backend. + * Original HLS workload. + * Author: Luca Abeni 2-Feb-2002 + * + * This is free software; see GPL.txt + */ + #include <stdio.h> #include <stdlib.h> |
|
From: <lu...@us...> - 2003-02-10 16:24:26
|
Update of /cvsroot/linux-hls/hls/simul
In directory sc8-pr-cvs1:/tmp/cvs-serv20402/simul
Modified Files:
Makefile sim.c sim_cpu.c sim_events.c sim_os.c workload.c
Log Message:
- Some work in the workload generator
- New docs directory + doc about my power management proposal
Index: Makefile
===================================================================
RCS file: /cvsroot/linux-hls/hls/simul/Makefile,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** Makefile 13 Dec 2002 11:26:12 -0000 1.9
--- Makefile 10 Feb 2003 16:23:45 -0000 1.10
***************
*** 8,14 ****
#CPPFLAGS += -DVERBOSE
! DEBUG = -lefence
CFLAGS += -g
! CPPFLAGS += -DHLS_DEBUG=0
all: simulator
--- 8,15 ----
#CPPFLAGS += -DVERBOSE
! #DEBUG = -lefence
CFLAGS += -g
! CPPFLAGS += -DHLS_DEBUG=10
! CPPFLAGS += -D__SIM_VERBOSE__
all: simulator
Index: sim.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/simul/sim.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** sim.c 17 Oct 2002 08:21:42 -0000 1.7
--- sim.c 10 Feb 2003 16:23:45 -0000 1.8
***************
*** 85,88 ****
--- 85,89 ----
int finished;
+ printf("Blah!\n");
switch (argc) {
case 2:
Index: sim_cpu.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/simul/sim_cpu.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** sim_cpu.c 25 Nov 2002 11:33:32 -0000 1.9
--- sim_cpu.c 10 Feb 2003 16:23:45 -0000 1.10
***************
*** 30,34 ****
thread_init();
for (i=0; i < NR_CPUS; i++) {
! processors[i].idle.pid = -i;
processors[i].idle.sim_state = THREAD_SM_NEVERENDING;
}
--- 30,34 ----
thread_init();
for (i=0; i < NR_CPUS; i++) {
! processors[i].idle.pid = -1 -i;
processors[i].idle.sim_state = THREAD_SM_NEVERENDING;
}
***************
*** 77,89 ****
long long int sim_time = sim_get_time();
if (ot) {
! fprintf(outfile, "%s\t\t%lld %lld\n", ThreadStr(ot),
! processors[proc].dispatch_time, sim_time);
if (ot != &processors[proc].idle) {
! ot->total_remaining_cpu_time -= (sim_time - processors[proc].dispatch_time);
! ot->time_until_blocking -= (sim_time - processors[proc].dispatch_time);
sim_printf("[%d] ---> %lld\t", ot->pid, ot->total_remaining_cpu_time);
! sim_printf("(bt) ---> %lld\n", ot->time_until_blocking);
}
}
--- 77,95 ----
long long int sim_time = sim_get_time();
+ sim_printf("Start Running Thread\n");
if (ot) {
! fprintf(outfile, "%s\t\t%lld %lld\t\t%lld\n", ThreadStr(ot),
! processors[proc].dispatch_time, sim_time,
! sim_time - processors[proc].dispatch_time);
if (ot != &processors[proc].idle) {
! if (ot->total_remaining_cpu_time != -1) {
! ot->total_remaining_cpu_time -= (sim_time - processors[proc].dispatch_time);
! }
! if (ot->ci != -1) {
! ot->ci -= (sim_time - processors[proc].dispatch_time);
! }
sim_printf("[%d] ---> %lld\t", ot->pid, ot->total_remaining_cpu_time);
! sim_printf("(bt) ---> %lld\n", ot->ci);
}
}
Index: sim_events.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/simul/sim_events.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** sim_events.c 13 Dec 2002 11:26:12 -0000 1.11
--- sim_events.c 10 Feb 2003 16:23:45 -0000 1.12
***************
*** 10,14 ****
/* TODO: Check all of these!!! */
- long long int max_run_time_until_blocking;
long long int max_blocking_time;
long long int max_res_time;
--- 10,13 ----
***************
*** 87,90 ****
--- 86,90 ----
{
struct sim_event *e;
+ long long int max_time_until_quit;
sim_printf("seed = %u\n", seed);
***************
*** 99,103 ****
! workload_generate();
/*
* first timer interrupt - each interrupt puts in the next one
--- 99,103 ----
! max_time_until_quit = workload_generate();
/*
* first timer interrupt - each interrupt puts in the next one
***************
*** 107,110 ****
--- 107,113 ----
insert_event(e, (long long int)time_increment);
+ e = new_event(EVENT_TYPE_SHUTDOWN, sim_rand() % sim_nr_cpus());
+ e->u.event_thread.t = NULL;
+ insert_event(e, sim_rand() % max_time_until_quit);
}
***************
*** 144,152 ****
}
- #if 1
void next_task_event(int proc, struct sim_task_struct *ot, struct sim_task_struct *nt, long long int sim_time)
{
if (ot != NULL) {
if ((ot->sim_state != THREAD_SM_ENDED) && (ot->sim_state != THREAD_SM_NEVERENDING)) {
sim_printf("removing end...\n");
event_list_remove(&end_e);
--- 147,158 ----
}
void next_task_event(int proc, struct sim_task_struct *ot, struct sim_task_struct *nt, long long int sim_time)
{
if (ot != NULL) {
+ sim_printf("Next Task Event: sim_state = %d total_remaining_cpu_time = %d\n", ot->sim_state, ot->total_remaining_cpu_time);
+ #if 0
if ((ot->sim_state != THREAD_SM_ENDED) && (ot->sim_state != THREAD_SM_NEVERENDING)) {
+ #endif
+ if ((ot->sim_state != THREAD_SM_ENDED) && (ot->total_remaining_cpu_time != -1)) {
sim_printf("removing end...\n");
event_list_remove(&end_e);
***************
*** 158,197 ****
}
! if (nt->kind == BLOCKING) {
! block_e.proc = proc;
! block_e.u.event_thread.t = nt;
sim_printf("posting the block event for %d at %lld = %lld + %lld\n",
! nt->pid, nt->time_until_blocking + sim_time,
! nt->time_until_blocking, sim_time);
! insert_event(&block_e, nt->time_until_blocking + sim_time);
! }
! if (nt->sim_state != THREAD_SM_NEVERENDING) {
! end_e.proc = proc;
! end_e.u.event_thread.t = nt;
! insert_event(&end_e, nt->total_remaining_cpu_time + sim_time);
}
}
- #else
- void next_task_event(int proc, struct sim_task_struct *nt, long long int sim_time)
- {
- struct sim_event *e;
- /*
- * fire an event at the nearest time that we could possibly care
- * about
- */
- e = new_event(EVENT_TYPE_THREAD_EVENT, proc);
- e->u.event_thread.t = nt;
- sim_printf("%lld --- ", sim_time);
- sim_printf("%d, kind:%d) remaining: %lld\tBlocking: %lld\tReady: %lld\n",
- nt->pid, nt->kind,
- sim_time + nt->total_remaining_cpu_time,
- sim_time + nt->time_until_blocking,
- nt->ready_time);
- sim_printf("real... %lld %lld\n", nt->total_remaining_cpu_time,nt->time_until_blocking);
- insert_event(e, min(sim_time + nt->total_remaining_cpu_time,
- (nt->sim_state == THREAD_SM_READY) ?
- sim_time + nt->time_until_blocking : nt->ready_time));
- }
- #endif
static int DoEventSetPri(struct sim_event *ev, long long int time)
--- 164,184 ----
}
! if (nt->pid >= 0) {
! if (nt->kind == BLOCKING) {
! block_e.proc = proc;
! block_e.u.event_thread.t = nt;
sim_printf("posting the block event for %d at %lld = %lld + %lld\n",
! nt->pid, nt->ci + sim_time,
! nt->ci, sim_time);
! insert_event(&block_e, nt->ci + sim_time);
! }
! /* if (nt->sim_state != THREAD_SM_NEVERENDING) {*/
! if (nt->total_remaining_cpu_time != -1) {
! end_e.proc = proc;
! end_e.u.event_thread.t = nt;
! insert_event(&end_e, nt->total_remaining_cpu_time + sim_time);
! }
}
}
static int DoEventSetPri(struct sim_event *ev, long long int time)
***************
*** 222,226 ****
t->sim_state = THREAD_SM_BLOCKED;
! t->ready_time = time + (sim_rand() % max_blocking_time) + 10;
t->state = TASK_INTERRUPTIBLE;
e = new_event(EVENT_TYPE_THREAD_UNBLOCK, (PROCT)sim_rand() % sim_nr_cpus());
--- 209,214 ----
t->sim_state = THREAD_SM_BLOCKED;
! /* t->ready_time = time + (sim_rand() % max_blocking_time) + 10;*/
! t->ready_time = t->ready_time + t->iat();
t->state = TASK_INTERRUPTIBLE;
e = new_event(EVENT_TYPE_THREAD_UNBLOCK, (PROCT)sim_rand() % sim_nr_cpus());
***************
*** 248,254 ****
t->sim_state = THREAD_SM_READY;
if (t->kind == BLOCKING) {
! t->time_until_blocking = (sim_rand() % max_run_time_until_blocking) + 10;
} else {
! t->time_until_blocking = t->total_remaining_cpu_time;
}
thread_unblock(t);
--- 236,242 ----
t->sim_state = THREAD_SM_READY;
if (t->kind == BLOCKING) {
! t->ci = t->c();
} else {
! t->ci = -1;
}
thread_unblock(t);
***************
*** 281,285 ****
if (t->ready_time == time) {
t->sim_state = THREAD_SM_READY;
! t->time_until_blocking = (sim_rand() % max_run_time_until_blocking) + 10;
thread_unblock(t);
} else {
--- 269,273 ----
if (t->ready_time == time) {
t->sim_state = THREAD_SM_READY;
! t->ci = t->c();
thread_unblock(t);
} else {
***************
*** 300,303 ****
--- 288,292 ----
if (t->sim_state != THREAD_SM_READY) {
+ printf("End Task %s\n", ThreadStr(t));
printf("Error: End task with state = %d != THREAD_SM_READY\n",
t->sim_state);
***************
*** 321,325 ****
printf("End: There is a problem...\n");
printf("Kind = %d, time_until_blocking = %lld, exec_time = %lld\n",
! t->kind, t->time_until_blocking, exec_time);
exit(-1);
}
--- 310,314 ----
printf("End: There is a problem...\n");
printf("Kind = %d, time_until_blocking = %lld, exec_time = %lld\n",
! t->kind, t->ci, exec_time);
exit(-1);
}
***************
*** 352,356 ****
exec_time = time - sim_dispatch_time(SIMCurrentProc);
! if (t->time_until_blocking - exec_time == 0) {
schedule_unblock(t, time); /* Sets the unblocking event... */
thread_block(t);
--- 341,345 ----
exec_time = time - sim_dispatch_time(SIMCurrentProc);
! if (t->ci - exec_time == 0) {
schedule_unblock(t, time); /* Sets the unblocking event... */
thread_block(t);
***************
*** 358,362 ****
printf("[%d] There is a problem...\n", t->pid);
printf("Kind = %d, time_until_blocking = %lld, exec_time = %lld\n",
! t->kind, t->time_until_blocking, exec_time);
exit(-1);
}
--- 347,351 ----
printf("[%d] There is a problem...\n", t->pid);
printf("Kind = %d, time_until_blocking = %lld, exec_time = %lld\n",
! t->kind, t->ci, exec_time);
exit(-1);
}
***************
*** 365,438 ****
}
- #if 0
- static int DoEventThreadEvent(struct sim_evet *ev, long long int time)
- {
- long long int exec_time;
- struct sim_task_struct *t;
-
- t = ev->u.event_thread.t;
-
- sim_printf("(sim) executing thread event for %s (%p) at time %lld\n",
- thread_name(t), t, time);
-
-
-
-
-
-
-
-
- switch (t->sim_state) {
- case THREAD_SM_BLOCKED:
- if (t->ready_time == time) {
- t->sim_state = THREAD_SM_READY;
- if (t->kind == BLOCKING) {
- t->time_until_blocking = (sim_rand() % max_run_time_until_blocking) + 10;
- }
- thread_unblock(t);
- } else {
- /* FIXME: how can this happen? when addresses are reused?? */
- printf("sim is confused: got event for blocked thread %s (%p) at wrong time: %lld\n",
- thread_name(t), t, time);
- exit(-1);
- }
- break;
-
- case THREAD_SM_READY:
- if (sim_exec(SIMCurrentProc) != t) {
- break;
- }
-
- exec_time = time - sim_dispatch_time(SIMCurrentProc);
- if (t->total_remaining_cpu_time - exec_time == 0) {
- thread_end(t, time);
- } else {
- if (t->kind == BLOCKING && t->time_until_blocking - exec_time == 0) {
- sim_printf("Blocking thread %d\n", t->pid);
- schedule_unblock(t, time);
- thread_block(t);
- /* swap_thread(); Not Needed */
- } else {
- printf("There is a problem...\n");
- printf("Kind = %d, time_until_blocking = %d, exec_time = %d\n",
- t->kind, t->time_until_blocking, exec_time);
- /* We do not exit here, because, if there is a context
- * switch the event should be removed, but it is not...
- * so, a strange event fires
- * exit(-1);
- */
- }
- }
- break;
-
- default:
- printf("Error! Strange simulation state: %d\n", t->sim_state);
- exit(-1);
- }
-
- return 0;
- }
- #endif
-
static int DoEventInitialize(struct sim_event *e, long long int time)
{
--- 354,357 ----
***************
*** 502,506 ****
}
- #if 1
static int DoEventIdleLoop(struct sim_event *ev, long long int time)
{
--- 421,424 ----
***************
*** 509,559 ****
return 0;
}
- #else
- static int DoEventIdleLoop(void)
- {
- int res;
- /* PKPRCB p = KeGetCurrentPrcb (); */
-
- if (sim_exec(SIMCurrentProc) == NULL) {
- printf("Exec = NULL???\n");
- }
- if (sim_exec(SIMCurrentProc) != sim_idle_thread(SIMCurrentProc)) {
- printf("idle thread not running now\n");
-
- return;
- }
-
- /* simulate not getting the dispatcher lock ??? */
- if (sim_rand() % 1000 < 300) goto out;
-
- res = HLSCheckFromIdle();
-
- if (res != 0) {
- goto jump_into_middle;
- }
-
- if (!p->NextThread) {
- goto out;
- }
-
- KeAcquireQueuedSpinLockRaiseToSynch(LockQueueDispatcherLock); //lint !e534
-
- jump_into_middle:
-
- start_running_thread(p->CurrentThread, p->NextThread);
- p->CurrentThread = p->NextThread;
- p->CurrentThread->State = Running;
- p->NextThread = NULL;
-
- #ifdef HLS_DEBUG
- HLSCheckInvariants (('F' << 16) | FROM_UNLOCK);
- #endif
- KeReleaseQueuedSpinLock (LockQueueDispatcherLock, SAVED_IRQL);
-
- out:
-
- check_for_idle (p->Number);
- }
- #endif
static int DoEventNewProc(struct sim_event *ev, long long int time)
--- 427,430 ----
Index: sim_os.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/simul/sim_os.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** sim_os.c 13 Dec 2002 11:26:12 -0000 1.6
--- sim_os.c 10 Feb 2003 16:23:46 -0000 1.7
***************
*** 17,24 ****
/*
extern long long int max_res_time;
- extern long long int max_run_time_until_blocking;
extern long long int cpu_time_per_thread;
*/
- extern long long int max_time_until_quit;
extern int res_number;
--- 17,22 ----
***************
*** 94,98 ****
struct sim_task_struct *make_new_thread(long long int create_time,
! long long int cpu_time, long long int job_exec_time, int prio)
{
int id = sim_new_id();
--- 92,98 ----
struct sim_task_struct *make_new_thread(long long int create_time,
! long long int cpu_time, long long int (*job_exec_time)(void),
! long long int (*job_interarrival_time)(void),
! int prio)
{
int id = sim_new_id();
***************
*** 114,120 ****
sim_thread_count++;
!
! /* FIXME: From here on, it does not belong to make_new_thread... */
! t->total_desired_cpu_time = t->total_remaining_cpu_time = cpu_time;
#if 0 /* FIXME: Move this reserve stuff elsewhere... */
if (res_number++ < NUM_RSV) {
--- 114,122 ----
sim_thread_count++;
! if (cpu_time != 0) {
! t->total_desired_cpu_time = t->total_remaining_cpu_time = cpu_time;
! } else {
! t->total_desired_cpu_time = t->total_remaining_cpu_time = -1;
! }
#if 0 /* FIXME: Move this reserve stuff elsewhere... */
if (res_number++ < NUM_RSV) {
***************
*** 126,138 ****
#endif
! if (job_exec_time == 0) { // FIXME
t->kind = CPUBOUND;
! t->time_until_blocking = t->total_remaining_cpu_time;
sim_printf("Task %d is cpu bound: %lld\t%lld\n", t->pid,
t->total_desired_cpu_time,
! t->time_until_blocking);
} else {
t->kind = BLOCKING;
! t->time_until_blocking = sim_rand() % job_exec_time;
}
--- 128,147 ----
#endif
! t->iat = job_interarrival_time;
! if (job_exec_time == NULL) { // FIXME
t->kind = CPUBOUND;
! t->ci = t->total_remaining_cpu_time;
sim_printf("Task %d is cpu bound: %lld\t%lld\n", t->pid,
t->total_desired_cpu_time,
! t->ci);
! t->c = NULL;
} else {
t->kind = BLOCKING;
! t->ci = job_exec_time();
! if (t->iat == NULL) {
! sim_printf("Error: blocking job with IAT = NULL!!!\n");
! exit(-1);
! }
! t->c = job_exec_time;
}
***************
*** 178,186 ****
// make_new_thread(time + 1 + (sim_rand() % 100000));
sim_thread_count--;
- if (sim_thread_count == 0) {
- e = new_event(EVENT_TYPE_SHUTDOWN, sim_rand() % sim_nr_cpus());
- e->u.event_thread.t = t;
- insert_event(e, time + 1 + (sim_rand() % max_time_until_quit));
- }
/* swap_thread(); Not Needed */
}
--- 187,190 ----
Index: workload.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/simul/workload.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** workload.c 13 Dec 2002 11:26:12 -0000 1.1
--- workload.c 10 Feb 2003 16:23:47 -0000 1.2
***************
*** 11,60 ****
- static long long int MAX_TIME_UNTIL_DISPATCH_INTERRUPT;
- static long long int MAX_TIME_UNTIL_IDLE_CHECK;
-
int total_num_threads;
- long long int max_time_until_quit;
extern long long int max_res_time;
- extern long long int max_run_time_until_blocking;
extern long long int cpu_time_per_thread;
extern long long int max_blocking_time;
! void workload_generate(void)
{
int EndNumProcessors;
! int NUM_THREADS;
int i;
- #if 0
- EndNumProcessors = (sim_rand() % 3) + 3;
- #else
EndNumProcessors = 1;
! #endif
! NUM_THREADS = (sim_rand() % 25) + 250;
! total_num_threads = 10 + (sim_rand() % 30);
! /*
! sim_printf ("simulating %d processors and %d threads\n",
! EndNumProcessors, NUM_THREADS);
! */
! sim_printf ("simulating %d threads\n", NUM_THREADS);
! // FIXME: make the simulator create and destroy lots of threads
! // have a max num of threads and create more when current is
! // less than this
!
! max_run_time_until_blocking = ((long long int)(sim_rand()%1000000))+500;
max_blocking_time = ((long long int)(sim_rand()%100000))+500;
- max_time_until_quit = ((long long int)(sim_rand()%10000));
- MAX_TIME_UNTIL_DISPATCH_INTERRUPT = (sim_rand()%50000)+50;
- MAX_TIME_UNTIL_IDLE_CHECK = (sim_rand()%50000)+50;
max_res_time = 100000000;
cpu_time_per_thread = /*HLS_MsToNT * 500*/ /*1000000*/ 500000;
!
! for(i = 0; i < NUM_THREADS; i++) {
! make_new_thread((long long int)((sim_rand() % 10000) + 1000), cpu_time_per_thread, /* max_run_time_until_blocking */0,
! TH_FIXED_PRIO);
}
--- 11,51 ----
int total_num_threads;
extern long long int max_res_time;
extern long long int cpu_time_per_thread;
extern long long int max_blocking_time;
! long long int execution_time(void)
! {
! return 2000000;
! }
!
! long long int period(void)
! {
! return 100000000;
! }
!
! long long int workload_generate(void)
{
int EndNumProcessors;
! int threads;
int i;
EndNumProcessors = 1;
!
! threads = 10;
! total_num_threads = 20;
! sim_printf("simulating %d threads\n", threads);
! #if 0
max_blocking_time = ((long long int)(sim_rand()%100000))+500;
max_res_time = 100000000;
cpu_time_per_thread = /*HLS_MsToNT * 500*/ /*1000000*/ 500000;
! #endif
!
! for(i = 0; i < threads; i++) {
! make_new_thread(100, 0, execution_time, period, TH_FIXED_PRIO);
}
***************
*** 81,83 ****
--- 72,75 ----
#endif
+ return 1000000000;
}
|
|
From: <lu...@us...> - 2003-02-10 16:24:26
|
Update of /cvsroot/linux-hls/hls/simul/include
In directory sc8-pr-cvs1:/tmp/cvs-serv20402/simul/include
Modified Files:
interface-data.h os.h
Log Message:
- Some work in the workload generator
- New docs directory + doc about my power management proposal
Index: interface-data.h
===================================================================
RCS file: /cvsroot/linux-hls/hls/simul/include/interface-data.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** interface-data.h 25 Nov 2002 11:33:33 -0000 1.1
--- interface-data.h 10 Feb 2003 16:23:47 -0000 1.2
***************
*** 56,60 ****
long long int total_remaining_cpu_time;
long long int total_desired_cpu_time;
! long long int time_until_blocking;
long long int ready_time;
int kind;
--- 56,62 ----
long long int total_remaining_cpu_time;
long long int total_desired_cpu_time;
! long long int ci;
! long long int (*c)(void); /* Execution times generator */
! long long int (*iat)(void); /* Interarrival times generator */
long long int ready_time;
int kind;
Index: os.h
===================================================================
RCS file: /cvsroot/linux-hls/hls/simul/include/os.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** os.h 13 Dec 2002 11:26:13 -0000 1.2
--- os.h 10 Feb 2003 16:23:47 -0000 1.3
***************
*** 1,5 ****
int random_priority(void);
struct sim_task_struct *make_new_thread(long long int create_time,
! long long int cpu_time, long long int job_exec_time, int prio);
void thread_unblock(struct sim_task_struct *t);
void thread_block(struct sim_task_struct *t);
--- 1,7 ----
int random_priority(void);
struct sim_task_struct *make_new_thread(long long int create_time,
! long long int cpu_time, long long int (*job_exec_time)(void),
! long long int (*job_interarrival_time)(void),
! int prio);
void thread_unblock(struct sim_task_struct *t);
void thread_block(struct sim_task_struct *t);
|
|
From: <lu...@us...> - 2003-02-10 16:23:52
|
Update of /cvsroot/linux-hls/hls/simul/loads
In directory sc8-pr-cvs1:/tmp/cvs-serv20402/simul/loads
Added Files:
continuous.c periodic.c standard.c
Log Message:
- Some work in the workload generator
- New docs directory + doc about my power management proposal
--- NEW FILE: continuous.c ---
#include <stdio.h>
#include <stdlib.h>
#include "interface-data.h"
#include "os.h"
#include "sim.h"
#include "event.h"
#define TH_FIXED_PRIO 3 /* FIXME: What do we want to do here??? */
int total_num_threads;
extern long long int max_res_time;
extern long long int max_run_time_until_blocking;
extern long long int cpu_time_per_thread;
extern long long int max_blocking_time;
long long int execution_time(void)
{
return 10000;
}
long long int workload_generate(void)
{
int EndNumProcessors;
int threads;
int i;
EndNumProcessors = 1;
threads = 10;
total_num_threads = 20;
sim_printf("simulating %d threads\n", threads);
#if 0
max_run_time_until_blocking = ((long long int)(sim_rand()%1000000))+500;
max_blocking_time = ((long long int)(sim_rand()%100000))+500;
max_res_time = 100000000;
cpu_time_per_thread = /*HLS_MsToNT * 500*/ /*1000000*/ 500000;
#endif
for(i = 0; i < threads; i++) {
make_new_thread(100, 0, /*execution_time*/ NULL, NULL, TH_FIXED_PRIO);
}
{
struct sim_event *e;
long long int tt = 0;
for (i = 1; i < EndNumProcessors; i++) {
e = new_event(EVENT_TYPE_NEW_PROC, 0);
tt += sim_rand() % 500000;
insert_event (e, tt);
}
}
#if 0
e = new_event (EVENT_TYPE_MOVETOPS, 0);
insert_event (e, (long long int)(sim_rand()%100000));
#endif
#if 0
e = new_event (EVENT_TYPE_LOADRES, 0);
insert_event (e, (long long int)(sim_rand()%10000000));
#endif
return 100000000;
}
--- NEW FILE: periodic.c ---
#include <stdio.h>
#include <stdlib.h>
#include "interface-data.h"
#include "os.h"
#include "sim.h"
#include "event.h"
#define TH_FIXED_PRIO 3 /* FIXME: What do we want to do here??? */
int total_num_threads;
extern long long int max_res_time;
extern long long int cpu_time_per_thread;
extern long long int max_blocking_time;
long long int execution_time(void)
{
return 2000000;
}
long long int period(void)
{
return 100000000;
}
long long int workload_generate(void)
{
int EndNumProcessors;
int threads;
int i;
EndNumProcessors = 1;
threads = 10;
total_num_threads = 20;
sim_printf("simulating %d threads\n", threads);
#if 0
max_blocking_time = ((long long int)(sim_rand()%100000))+500;
max_res_time = 100000000;
cpu_time_per_thread = /*HLS_MsToNT * 500*/ /*1000000*/ 500000;
#endif
for(i = 0; i < threads; i++) {
make_new_thread(100, 0, execution_time, period, TH_FIXED_PRIO);
}
{
struct sim_event *e;
long long int tt = 0;
for (i = 1; i < EndNumProcessors; i++) {
e = new_event(EVENT_TYPE_NEW_PROC, 0);
tt += sim_rand() % 500000;
insert_event (e, tt);
}
}
#if 0
e = new_event (EVENT_TYPE_MOVETOPS, 0);
insert_event (e, (long long int)(sim_rand()%100000));
#endif
#if 0
e = new_event (EVENT_TYPE_LOADRES, 0);
insert_event (e, (long long int)(sim_rand()%10000000));
#endif
return 1000000000;
}
--- NEW FILE: standard.c ---
#include <stdio.h>
#include <stdlib.h>
#include "interface-data.h"
#include "os.h"
#include "sim.h"
#include "event.h"
#define TH_FIXED_PRIO 3 /* FIXME: What do we want to do here??? */
static long long int MAX_TIME_UNTIL_DISPATCH_INTERRUPT;
static long long int MAX_TIME_UNTIL_IDLE_CHECK;
int total_num_threads;
long long int max_time_until_quit;
extern long long int max_res_time;
extern long long int max_run_time_until_blocking;
extern long long int cpu_time_per_thread;
extern long long int max_blocking_time;
void workload_generate(void)
{
int EndNumProcessors;
int NUM_THREADS;
int i;
#if 0
EndNumProcessors = (sim_rand() % 3) + 3;
#else
EndNumProcessors = 1;
#endif
NUM_THREADS = (sim_rand() % 25) + 250;
total_num_threads = 10 + (sim_rand() % 30);
/*
sim_printf ("simulating %d processors and %d threads\n",
EndNumProcessors, NUM_THREADS);
*/
sim_printf ("simulating %d threads\n", NUM_THREADS);
// FIXME: make the simulator create and destroy lots of threads
// have a max num of threads and create more when current is
// less than this
max_run_time_until_blocking = ((long long int)(sim_rand()%1000000))+500;
max_blocking_time = ((long long int)(sim_rand()%100000))+500;
max_time_until_quit = ((long long int)(sim_rand()%10000));
MAX_TIME_UNTIL_DISPATCH_INTERRUPT = (sim_rand()%50000)+50;
MAX_TIME_UNTIL_IDLE_CHECK = (sim_rand()%50000)+50;
max_res_time = 100000000;
cpu_time_per_thread = /*HLS_MsToNT * 500*/ /*1000000*/ 500000;
for(i = 0; i < NUM_THREADS; i++) {
make_new_thread((long long int)((sim_rand() % 10000) + 1000), cpu_time_per_thread, /* max_run_time_until_blocking */0,
TH_FIXED_PRIO);
}
{
struct sim_event *e;
long long int tt = 0;
for (i = 1; i < EndNumProcessors; i++) {
e = new_event(EVENT_TYPE_NEW_PROC, 0);
tt += sim_rand() % 500000;
insert_event (e, tt);
}
}
#if 0
e = new_event (EVENT_TYPE_MOVETOPS, 0);
insert_event (e, (long long int)(sim_rand()%100000));
#endif
#if 0
e = new_event (EVENT_TYPE_LOADRES, 0);
insert_event (e, (long long int)(sim_rand()%10000000));
#endif
}
|