Messages in this thread Patch in this message | | | Date | Fri, 18 Sep 1998 16:02:04 +0000 | From | Petko Manolov <> | Subject | Re: Interesting scheduling times |
| |
Petko Manolov wrote: > > Hi, > > here are some tests in kernel mode (in schedule()): > > kernel 2.1.122 min-378(2.27us), max-1757(10.58us) > kernel 2.0.35 min-376(2.27us), max-6386(38.46us)
Excuse me, last line must be: kernel 2.0.35 min-376(2.26us), max-6386(38.46us)
Petkan
-- Petko Manolov - petkan@varel.bg http://www.varel.bg/~petkan --- linux/kernel/sched.c.orig Fri Sep 4 16:13:29 1998 +++ linux/kernel/sched.c Fri Sep 18 14:24:37 1998 @@ -103,6 +103,15 @@ void scheduling_functions_start_here(void) { } +static inline void RTSC( int *lsi, int *msi ) { + __asm__ __volatile__ ( + ".byte 0x0f, 0x31\n\t" + :"=a" (*lsi), "=d" (*msi) + :/* no input */ + :"eax", "edx" + ); +} + static inline void reschedule_idle(struct task_struct * p) { @@ -460,7 +469,10 @@ struct task_struct * prev, * next; unsigned long timeout; int this_cpu; + static int msi1, msi2, lsi1, lsi2; + int flag; + RTSC( &lsi1, &msi1 ); prev = current; this_cpu = prev->processor; if (in_interrupt()) @@ -551,6 +563,7 @@ if (prev != next) { struct timer_list timer; + flag = 1; kstat.context_swtch++; if (timeout) { @@ -565,7 +578,8 @@ if (timeout) del_timer(&timer); - } + } else + flag = 0; spin_unlock(&scheduler_lock); @@ -575,6 +589,10 @@ * prev) */ reacquire_kernel_lock(prev); + RTSC( &lsi2, &msi2 ); + if ( flag && (msi2 == msi1) ) { + printk("schedule: %u\n", lsi2-lsi1 ); + } return; scheduling_in_interrupt: | |