You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/11/03 14:13:03 UTC

[GitHub] [incubator-nuttx] masayuki2009 opened a new pull request #2204: sched: irq: Fix enter_critical_section() in an irq handler for SMP

masayuki2009 opened a new pull request #2204:
URL: https://github.com/apache/incubator-nuttx/pull/2204


   ## Summary
   
   - I found a deadlock during Wi-Fi audio streaming test plus stress test
   - The testing environment was spresense:wifi_smp (NCPUS=4)
   - The deadlock happened because two CPUs called up_cpu_pause() almost simultaneously
   - This situation should not happen, because up_cpu_pause() is called in a critical section
   - Actually, the latter call was from nxsem_post() in an IRQ handler
   - And when enter_critical_section() was called, irq_waitlock() detected a deadlock
   - Then it called up_cpu_paused() to break the deadlock
   - However, this resulted in setting g_cpu_irqset on the CPU
   - Even though another CPU had held a g_cpu_irqlock
   - This situation violates the critical section and should be avoided
   - To avoid the situation, if a CPU sets g_cpu_irqset after calling up_cpu_paused()
   - The CPU must release g_cpu_irqlock first
   - Then retry irq_waitlock() to acquire g_cpu_irqlock
   
   ## Impact
   
   - Affect SMP
   
   ## Testing
   
   - Tested with spresense:wifi_smp (NCPUS=2 and 4)
   - Tested with spresense:smp
   - Tested with sim:smp
   - Tested with sabre-6quad:smp (QEMU)
   - Tested with maix-bit:smp (QEMU)
   - Tested with esp32-core:smp (QEMU)
   - Tested with lc823450-xgevk:rndis
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] jerpelea merged pull request #2204: sched: irq: Fix enter_critical_section() in an irq handler for SMP

Posted by GitBox <gi...@apache.org>.
jerpelea merged pull request #2204:
URL: https://github.com/apache/incubator-nuttx/pull/2204


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] masayuki2009 commented on pull request #2204: sched: irq: Fix enter_critical_section() in an irq handler for SMP

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on pull request #2204:
URL: https://github.com/apache/incubator-nuttx/pull/2204#issuecomment-727957061


   @btashton 
   I noticed that the PR also needs to be backported to 10.0
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] jerpelea commented on pull request #2204: sched: irq: Fix enter_critical_section() in an irq handler for SMP

Posted by GitBox <gi...@apache.org>.
jerpelea commented on pull request #2204:
URL: https://github.com/apache/incubator-nuttx/pull/2204#issuecomment-720944257


   LGTM


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] btashton commented on pull request #2204: sched: irq: Fix enter_critical_section() in an irq handler for SMP

Posted by GitBox <gi...@apache.org>.
btashton commented on pull request #2204:
URL: https://github.com/apache/incubator-nuttx/pull/2204#issuecomment-728190331


   
   > I noticed that the PR also needs to be backported to 10.0
   > 
   
   Thanks for catching this. I added the label so I won't miss it this evening.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org