RTEMS | Thread migration is broken on SMP on x86 (#2183)

Mohammed Anees (@DonutAnees) gitlab at rtems.org
Fri Mar 6 20:25:51 UTC 2026




Mohammed Anees commented: https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/2183#note_144707


hi im picking up this, commit `8937f12f` seems to have restructed this closer to the ARM implementation for SMP fix but is still incomplete\
\
There are two remaining issues

1\. When spinning on the heir context, if the scheduler assigns a new heir the code never checks or clears the dispatch_needed flag, making it wait even when something comes up. `PER_CPU_DISPATCH_NEEDED` is defined for i386 so this check is needed. https://gitlab.rtems.org/rtems/rtos/rtems/-/blob/main/cpukit/score/cpu/i386/cpu_asm.S#L147

2\. In cpu.h, `is_executing` is still declared as volatile bool, this has to be changed to uint32_t to match what lock bts (accesses 4 bytes) actually accesses. With bool, this is is reading beyond the struct? - https://pdos.csail.mit.edu/6.828/2005/readings/i386/BTS.htm

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/2183#note_144707
You're receiving this email because of your account on gitlab.rtems.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20260306/354b2c4e/attachment-0001.htm>


More information about the bugs mailing list