where, during a paradise lost situation, you can go around a whole spin of that while loop without getting interrupts ever turned on.
So you can have two voluntary rescheds in a row, e.g. 5->4->1, where interrupts go off in 5 and don't come back on until 1. Then, ls->save.next_tid is 5, but voluntary_resched_tid is 4.
At the very least, there should be some logic to ensure that the correct stack trace (the old voluntary_resched_stack) gets saved in the PP instead of the one for the spinning (more recent) thread.
the problem is this semaphore implementation
where, during a paradise lost situation, you can go around a whole spin of that while loop without getting interrupts ever turned on.
So you can have two voluntary rescheds in a row, e.g. 5->4->1, where interrupts go off in 5 and don't come back on until 1. Then,
ls->save.next_tid
is 5, butvoluntary_resched_tid
is 4.