ThomasDebrunner opened a new pull request, #6341:
URL: https://github.com/apache/incubator-nuttx/pull/6341

   ## Summary
   
   Another attempt at fixing c
   Difference to https://github.com/apache/incubator-nuttx/pull/6318 is that in 
this attempt, the reason for the boost (the address of the semaphore causing 
the boost) gets stored in the list of boosts in the tcb. 
   
   Main idea: Instead of just storing an array of priorities but forgetting to 
what tasks they belong to, we store the address of the semaphore as well.
   Then, on every boost we put a (semaphore, new_priority) tuple in the array, 
on every release, we remove the one that corresponds to the released semphore 
with the highest priority, iff we still hold a count on that semaphore, 
otherwise we remove all that correspond to the semaphore.
   At the end, we just set as the priority the maximum value of all boosts on 
all semaphores that are in the array
   
   ## Impact
   This should generally fix the priority inheritance issues seen in 
https://github.com/apache/incubator-nuttx/issues/6310. It passes some 
hand-crafted adverse tests. 
   
   After this patch, memory footprint increases by `n_tasks * 
CONFIG_SEM_NNESTPRIO * 4` bytes more memory. This could potentially be 
mitigated by using a linked list with preallocated holders instead of the array 
in the tcb, (like with the semaphore holders list).
   
   ## Testing
   
   


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to