-
Notifications
You must be signed in to change notification settings - Fork 3k
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
malloc test refactoring #5323
malloc test refactoring #5323
Conversation
8f8b29b
to
970e39e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be split into two separate PRs. One which adds the additional tests and the other which reduces test memory consumption.
Or at least commits |
out of memory fix moved to #5338 |
970e39e
to
df3cd4f
Compare
Update posted, please review |
df3cd4f
to
ec34ba4
Compare
extern uint32_t mbed_heap_size; | ||
static const int test_timeout = 25; | ||
volatile bool thread_should_continue = true; | ||
#define NUM_THREADS 4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did the number of threads need to be decreased to pass testing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could restore back thread count to 5, but it will cause fail on GCC_ARM.
To run 5 threads on GCC_ARM we have to free additional ~300B of heap memory.
To achieve this we could reduce thread allocation to 20B or move part of Thread objects on stack (but can not move all of them because we reach main thread stack limit).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do 5 threads no longer fit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it turns out that refactoring (new test cases, functions, ...) increased static RAM usage by 480B as a result less memory remains for heap and fifth thread stack allocation fails
python tools/memap.py BUILD/tests/nucleo_f070rb/GCC_ARM/TESTS/mbedmicro-rtos-mbed/malloc/malloc.map -t GCC_ARM
befor refactoring
Total Static RAM memory (data + bss): 10172 bytes
after refactoring
Total Static RAM memory (data + bss): 10652 bytes
diff
Total Static RAM memory (data + bss): 480 bytes
extern uint32_t mbed_heap_size;
printf("mbed_heap_size: %lu \r\n", mbed_heap_size);
befor refactoring
mbed_heap_size: 4996
after refactoring
mbed_heap_size: 4516
diff
mbed_heap_size: 480
/morph build |
Build : FAILUREBuild number : 317 |
Looks git clone failure, Saw similar issue on few other PR as well
|
/morph build |
Build : FAILUREBuild number : 324 |
/morph build |
Build : SUCCESSBuild number : 342 Triggering tests/morph test |
Test : FAILUREBuild number : 153 |
@maciejbocianski |
ec34ba4
to
751fa15
Compare
problem fixed - there was lack of thread stack alignment |
/morph build |
Build : SUCCESSBuild number : 354 Triggering tests/morph test |
@maciejbocianski Looking at the commits here. Bad rebase? As I see here changes that went to master previously, and not related to this patch. Please review |
28d201c
to
b2e0788
Compare
b2e0788
to
a7f31c9
Compare
@0xc0170 done |
/morph build |
Build : SUCCESSBuild number : 524 Triggering tests/morph test |
Exporter Build : SUCCESSBuild number : 138 |
Test : SUCCESSBuild number : 328 |
Manually triggered CI uvisor job, should complete soon. This is the last CI that needs t o be completed for this patch. Once done, ready for integration |
@studavekar Waiting for nucleo_f070rb run |
@maciejbocianski As you asked about that nucleo, I could not identify any test run for this device, is that correct? |
@studavekar @0xc0170 |
/morph uvisor-test |
uvisor restarted, jenkins exception in the job |
Description
Test refactoring
Few test added: malloc(0), free(NULL), malloc(large size)
Status
READY