[BUG] Scheduling stop in the prvCheckForRunStateChange function for SMP

Aperta
#1,328 5 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
28/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
c

Direzione di ricerca

Start in tasks.c, reading vTaskSuspendAll and prvCheckForRunStateChange, and compare their interrupt masking with the port macros portSET_INTERRUPT_MASK and portENABLE_INTERRUPTS in the ARM port. Understanding the SMP run-state logic around prvYieldCore is required before changing anything. Done means the configASSERT on taskTASK_SCHEDULED_TO_YIELD no longer fires under the multi-task, semaphore-heavy reproduction, which needs an SMP target to verify.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

Describe the bug
Running on the SMP system, the system stops scheduling, and an assertion is triggered at configASSERT( pxThisTCB->xTaskRunState == taskTASK_SCHEDULED_TO_YIELD ) in the code of the prvCheckForRunStateChange function.

In the vTaskSuspendAll function, the portSET_INTERRUPT_MASK() macro is used to disable interrupts before calling prvCheckForRunStateChange. However, the prvCheckForRunStateChange function code uses the portENABLE_INTERRUPTS() macro to temporarily enable task switching, which results in task switching not actually being enabled. After calling portENABLE_INTERRUPTS(), the interrupts used for scheduling remain masked.

Target

  • Development board: [user-defined]
  • Instruction Set Architecture: [ARM_CR82]
  • IDE and version: [IAR 9.20]

To Reproduce

  • Use multi-task with xSemaphoreXXX function on multi-core system.
  • Frequent calls to the vTaskSuspendAll function
  • Frequent calls to the prvYieldCore( xCoreID ) macro

Additional context
It might be appropriate to use the portDISABLE_INTERRUPTS() macro instead of the portSET_INTERRUPT_MASK() macro in the vTaskSuspendAll function.

Lingua principale
C
Stelle
4.6k
Fork
1.6k
Merge medio
2g 22h
PR unite (30g)
4

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di FreeRTOS/FreeRTOS-Kernel

Tutte le issue di FreeRTOS/FreeRTOS-Kernel

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.