patacongo edited a comment on issue #2935: URL: https://github.com/apache/incubator-nuttx/issues/2935#issuecomment-802839785
> > > @patacongo thanks for including it in the os-tests. > > Yes, I agree, there should be a third thread scheduled with FIFO (like in my test setup) that eats up the remaining cycles. Proposed setup: > > ``` > user_main: Dual sporadic thread test > Sporadic 1: prio high 180, low 20, repl 100000000 ns > Sporadic 2: prio high 180, low 20, repl 100000000 ns > FIFO : prio 100, (busy loop, which does computation all the time) > ``` > > Then, a sporadic thread with a budget of e.g. 30 % shall also result in about 30% processing time, and not any value above 30%. I think with this setup you can properly verify the correctness of the sporadic server scheduling algorithm. I did this in a different way: I added two counts, one when the priority is high and one when the priority is low. The high priority count should be equal to the budget. Low priority counts will occur when the CPU is IDLE and has nothing else to do. Now, I can see the problem more clearly. I will edit this comment and report the results in a few minutes. ... Here are the results of the modified test: user_main: Dual sporadic thread test Sporadic 1: prio high 180, low 20, repl 100000000 ns Sporadic 2: prio high 170, low 30, repl 100000000 ns ``` THREAD BUDGET HI MS LO MS 1 Sporadic 1 000000000 8344 0 Sporadic 2 030000000 41757 50092 2 Sporadic 1 010000000 16706 0 Sporadic 2 030000000 41750 41742 3 Sporadic 1 020000000 25063 0 Sporadic 2 030000000 8352 66786 4 Sporadic 1 030000000 33421 0 Sporadic 2 030000000 0 66782 5 Sporadic 1 040000000 41775 0 Sporadic 2 030000000 0 58426 6 Sporadic 1 050000000 50123 0 Sporadic 2 030000000 0 50079 ``` No you can see that the behavior is the same as your original report: The higher priority budget interval is does not occur after thread 1 budget equals or exceeds the thread 2 budget. The modified test is incubator-nuttx-apps PR 623 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org