Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All tests should be SMP-safe #14639

Closed
andyross opened this issue Mar 18, 2019 · 1 comment
Closed

All tests should be SMP-safe #14639

andyross opened this issue Mar 18, 2019 · 1 comment
Assignees
Labels
area: SMP Symmetric multiprocessing area: Tests Issues related to a particular existing or missing test Enhancement Changes/Updates/Additions to existing features
Milestone

Comments

@andyross
Copy link
Contributor

Traditionally, Zephyr was a uniprocessor system. But it now has a SMP platform in CI.

Lots and lots of code in our tests was written to assume uniprocessor behavior, for example that lower priority threads will never run if a higher priority thread is runnable (now it can run on another CPU), or that a given thread mode event will never happen until after the return of a interrupt context event like a timeout (the other CPU can wake up before the ISR returns).

So lots and lots of our test code doesn't run correctly or reliably in SMP right now. It should.

Obviously it won't be possible in all cases to change the designs of the tests (for example: sched/preempt is 100% predicated on the idea of testing two threads against each other on one CPU) but they should be isolated/understood and treated with a code-level workaround (e.g. put a known high priority thread on the other CPU and have it spin during a single-CPU test, or use the thread affinity API, or add extra synchronization layers to prevent events from getting ahead of themselves, etc...).

For 1.15, all test code should be running with default SMP settings unless it is explicitly testing for CONFIG_SMP-specific behavior.

@andyross andyross added the Enhancement Changes/Updates/Additions to existing features label Mar 18, 2019
@andyross andyross added this to the v1.15.0 milestone Mar 18, 2019
@wentongwu
Copy link
Contributor

Hope we can get a real platform supporting SMP, not just only QEMU.

andyross pushed a commit to andyross/zephyr that referenced this issue Apr 4, 2019
This test was having trouble earlier (at least with some toolchains),
but whatever was causing that seems to have been fixed.  The only
remaining issue is that neither the IPM console code nor the test are
SMP-safe.  There's a bug (zephyrproject-rtos#14639) tracking the need to get these
working, but for now the straightforward workaround is just to disable
SMP.

And even long term, IPM is an oddball interprocessor communication
mechanism designed for asymmetric multiprocessing devices like Quark
SE and doesn't seem like an obvious fit for a SMP machine.

Fixes zephyrproject-rtos#12478

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
nashif pushed a commit that referenced this issue Apr 5, 2019
This test was having trouble earlier (at least with some toolchains),
but whatever was causing that seems to have been fixed.  The only
remaining issue is that neither the IPM console code nor the test are
SMP-safe.  There's a bug (#14639) tracking the need to get these
working, but for now the straightforward workaround is just to disable
SMP.

And even long term, IPM is an oddball interprocessor communication
mechanism designed for asymmetric multiprocessing devices like Quark
SE and doesn't seem like an obvious fit for a SMP machine.

Fixes #12478

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
@aescolar aescolar added the area: Tests Issues related to a particular existing or missing test label Apr 25, 2019
@nashif nashif added the area: SMP Symmetric multiprocessing label Apr 25, 2019
@ioannisg ioannisg modified the milestones: v2.0.0, v2.1.0 Sep 3, 2019
@dleach02 dleach02 modified the milestones: v2.1.0, v2.2.0 Dec 10, 2019
@nashif nashif closed this as completed Feb 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: SMP Symmetric multiprocessing area: Tests Issues related to a particular existing or missing test Enhancement Changes/Updates/Additions to existing features
Projects
None yet
Development

No branches or pull requests

6 participants