Re: sched lock/unlock issue on rp2350

2025-05-07 Thread Alan C. Assis
True, so this typo didn't create a side effect, right? Are you git bisecting to find the root cause of the issue? BR, Alan On Wed, May 7, 2025 at 12:08 AM Serg Podtynnyi wrote: > Yeah, but this macro is working because of coincidental match with > variable prev already defined in the scope. >

Re: sched lock/unlock issue on rp2350

2025-05-06 Thread Serg Podtynnyi
Yeah, but this macro is working because of coincidental match with variable prev already defined in the scope. On 5/6/25 23:19, Alan C. Assis wrote: This file: https://github.com/apache/nuttx/commit/9de9f8168d6de8eab8d3a97aac21aacc4e84dd84#diff-ac1d3cade3d9ab380d40fe31f8c006b3035c7b53d04c28e23d

Re: sched lock/unlock issue on rp2350

2025-05-06 Thread Alan C. Assis
This file: https://github.com/apache/nuttx/commit/9de9f8168d6de8eab8d3a97aac21aacc4e84dd84#diff-ac1d3cade3d9ab380d40fe31f8c006b3035c7b53d04c28e23d9f1ce9a176572c On Tue, May 6, 2025 at 1:18 PM Alan C. Assis wrote: > Hi Serg, > > I did an analysis here and this macro was introduced in Jan 10 2024,

Re: sched lock/unlock issue on rp2350

2025-05-06 Thread Alan C. Assis
Hi Serg, I did an analysis here and this macro was introduced in Jan 10 2024, so it was more than 1 year ago: https://github.com/apache/nuttx/commit/9de9f8168d6de8eab8d3a97aac21aacc4e84dd84 BR, Alan On Tue, May 6, 2025 at 1:12 PM Alan C. Assis wrote: > WOW! Nice catch! > > Question to some p

Re: sched lock/unlock issue on rp2350

2025-05-06 Thread Alan C. Assis
WOW! Nice catch! Question to some people with more experience in the scheduler: Why wasn't this issue detected before? It was added more than 9 months ago. Is there some way to test and enforce that nxsched_process_delivered() and other schedule functions are working as expected? BR, Alan On

Re: sched lock/unlock issue on rp2350

2025-05-06 Thread Serg Podtynnyi
Hi, I am still researching the sched problem on my config Found this macro code  from last September,  looks like pre vs prev  typo, right? #definedq_insert_mid(pre,mid,next)\ do\ {\ mid->flink =next;\ mid->blink =prev;\ pre->flink =mid;\ next->blink =mid;\ }\ while(0) On 4/24/25 15:06, huj

Re: Re: sched lock/unlock issue on rp2350

2025-04-24 Thread Kevin Witteveen
Oh something to add; The serial output is typically messed up (usually when "help" is ran, or printf use). I tried to debug it, but the debugger "gives up / skips" on random instructions. Or fails to write variables. People seem to have accepted this behavior as normal, but I am very worried about

Re: Re: sched lock/unlock issue on rp2350

2025-04-24 Thread Kevin Witteveen
Hi, I am just going to share this here too. I experienced ostest fails both on RP2040 and RP2350. Disabling SMP on RP2350 only moved the problem elsewhere. It stopped the ostest fails for a bit, but when adding more applications and threads, the issue comes back. Sometimes it hangs, rarely it halt

Re: sched lock/unlock issue on rp2350

2025-04-24 Thread Serg Podtynnyi
Hi, I tried my best to understand the logic behind unlock and merge_pending routines and come up with this fix that works for me. I split the lockcount handling in 2 parts when lockcount is > 1 just decrement fast as always, but when it's 1 we enter critical section and make it 0 inside it(pre-e

Re: sched lock/unlock issue on rp2350

2025-04-22 Thread Gregory Nutt
The lockcount is thread-specific data and should not require any locking since it is only accessed by a single thread (not true of other SMP lock-related data). This looks like a good clue, but I think does not address the heart of the issue.