real-xinu / xinu-galileo

Other
17 stars 6 forks source link

Issue in scheduling #5

Closed gomti089 closed 7 years ago

gomti089 commented 7 years ago

Hello. This is Byungchan An, graduate student at Purdue. This semester, I'm working as CS503 TA, and while preparing lab for CS503, I found some scheduling issue in the latest code.

If I write infinite loop that prints preempt value in main.c, once main process is scheduled, preempt value never decreases. This cause loss of scheduling ability.

/*  main.c  - main */

#include <xinu.h>

process main(void)
{
        while (TRUE) {
            kprintf("preempt: %d\n", preempt);
        }
        return OK;

}

For verification, I made resched() print every time it is called, but it is not called after main process is scheduled.

When I checkout the code with the commit cf20c1ebbd55daf5e0207439e4926759f1654355, this was not an issue. I think this is happening due to HPET support or interrupt sharing.. I can use the code in cf20c1ebbd55daf5e0207439e4926759f1654355, but this issue seems to need more investigation.

avaidyam commented 7 years ago

@douglascomer @rajas-k I can confirm the issue on my end as well.

rajas-k commented 7 years ago

This is fixed in the most recent commit.