Closed bSchnepp closed 2 years ago
This should be addressed with 038d4d82dcb6c7d55a10fdb48d5507c8d41d92e9, but there doesnt seem to be a great way to prove this is fair in an SMP environment.
As of 02d61cf1b63078e6d359f1a474d14bd9925b67f7 with the no SMP environment, it appears fair. Once again however, this is difficult to prove in a multi core environment.
Something to note is that in the non-SMP environment, one of the 3 tasks created appears to never be scheduled.
A possible solution is to rework the threads to be scheduled into a temporary priority queue for each scheduler, and keep attempting to pull threads if possible, and if not, re-add the lowest priority thread. This has the unintended side effect of dragging in threads into non-ideal queues (putting more onto one core when it could be distributed), but would at least solve this issue of skipping a thread.
This patch should address this issue complete now. b3ede6eb09a70af36053db09f130a467939025f3
With ca9a1805a413877745222057bee64ee60223c710, this is all now within master.
Issue Checklist
master
branch the bug is present in, with it's commit hash, is listed in this report===================================================== Bug Description The scheduler currently relies upon a race to reschedule a process, where there is a different idle thread found first before the it is picked up, as in 4bd7bee28ce9383d5bae906b50a294c1b1a935de. Correct behavior would show that with a given core and thread is run, after the number of ticks has expired, it picks up a different thread rather than the same one. The current setup always ensures there is at least one idle thread at any given time, so this condition should always occur.
To Reproduce Please list the steps to produce the bug below:
Screenshots If relevant, please provide screenshots here.
Expected behavior The output from kern_idle() should remain fairly similar between all of the threads, with some variance of being within a few thousand.
Additional information Any additional information should be placed here.