Patch for "strict order mutex"

xi yang hiyangxi at gmail.com
Thu Oct 18 14:53:21 UTC 2007


1)What's strict order mutex ?

  In rtems,when a task release a priority_inheritance or
  priority ceiling semaphore,the kernel detect whether
  this task holds priority_inheritance or priority
  ceiling semaphore, if not, set the priority of task
  back to real priority of task.
  This method  is right, but in theory, we would like
  to reset the priority after releasing the mutex if
  releasing it in LIFO order.Do it like this can decrease
  the blocking time of a higher priority task .

2)How to enable "strict order mutex " ?

  When configuring the rtems , add
  ENABLE_STRICT_ORDER_MUTEX=1
  to your configure parameter.

I add sp36 to test the function of "strict order mutex"
3)About this test program

 T0,T1,S0,S1

 T0,priority 4
 T1,priority 1

 S0,priority inheritance
  S1,priority ceiling,priority ceiling 2

 1,T0 obtain S0 then obtain S1, priority of T0 should be improved to 2
 2,T0 try to release S0, but not in strict order, return error code
 3,T0 release S1,the priority of T0 back to 4
 4,T1 try to obtain S0
 5,T1 should be blocked and the priority of T0 should be improved to 1
 6,T0 release S0
 7,T1 obtain S0
 8,OVER.

I test it under bochs , this patch is for rtems that check form CVS as
cvs -d :pserver:anoncvs at www.rtems.com:/usr1/CVS -z 9 co
-rrtems-4-8-branch  rtems

Regards.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: strict_order_mutex.patch
Type: text/x-patch
Size: 3315746 bytes
Desc: not available
URL: <http://lists.rtems.org/pipermail/users/attachments/20071018/72ffffc3/attachment.bin>


More information about the users mailing list