Adjust the time slice to 50ms
The original time slice (200ms) is too large for the priority test to generate a satisfactory result in 20s. If we only schedule 5 times a second, there are only 100 pick_next calls to the scheduler. I believe making scheduling more frequently does little harm to the system. Actually more scheduling opportunities may also reveal bugs which are not triggered previously. Adopting smaller time slices also allows us to reduce the time spent on the priority test, which can benefit the autotesting system. Signed-off-by: Junjie Mao <junjie.mao@hotmail.com>
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
|
||||
#define TOTAL 5
|
||||
/* to get enough accuracy, MAX_TIME (the running time of each process) should >1000 mseconds. */
|
||||
#define MAX_TIME 2000
|
||||
#define MAX_TIME 1000
|
||||
#define SLEEP_TIME 400
|
||||
unsigned int acc[TOTAL];
|
||||
int status[TOTAL];
|
||||
@@ -39,7 +39,7 @@ main(void) {
|
||||
spin_delay();
|
||||
++ acc[i];
|
||||
if(acc[i]%4000==0) {
|
||||
if((time=gettime_msec())>MAX_TIME) {
|
||||
if((time=gettime_msec())>SLEEP_TIME+MAX_TIME) {
|
||||
cprintf("child pid %d, acc %d, time %d\n",getpid(),acc[i],time);
|
||||
exit(acc[i]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user