<div dir="ltr"><div><div><div>Hi,<br><br></div>I have created a new branch for uniprocessor solution of priority inversion problem caused by nested mutex behavior.<br><br></div>link: <a href="https://github.com/saurabhgadia4/rtems/tree/nested-mutex">https://github.com/saurabhgadia4/rtems/tree/nested-mutex</a><br></div>test case results: <a href="https://drive.google.com/folderview?id=0B44HRKVuGCkFfnFDVmxqQzZZUzljNUg4YmVPZmEybEp2Q0NNclpvS2FvemZ4Tm5Xa19nemM&usp=sharing">https://drive.google.com/folderview?id=0B44HRKVuGCkFfnFDVmxqQzZZUzljNUg4YmVPZmEybEp2Q0NNclpvS2FvemZ4Tm5Xa19nemM&usp=sharing</a><br></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr">Thanks,<div><br></div><div>Saurabh Gadia</div></div></div></div>
<br><div class="gmail_quote">On Thu, Aug 13, 2015 at 9:10 AM, Saurabh Gadia <span dir="ltr"><<a href="mailto:gadia@usc.edu" target="_blank">gadia@usc.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">That is how we were doing in JPF. The validate method was triggered after every release of mutex by any thread and we would check for all the waiting threads on mutex's held by the holder. And if it finds a thread with higher priority blocked then it would panic or give assertion failure.<br></div><div class="gmail_extra"><br clear="all"><div><div><div dir="ltr">Thanks,<div><br></div><div>Saurabh Gadia</div></div></div></div><div><div class="h5">
<br><div class="gmail_quote">On Thu, Aug 13, 2015 at 9:08 AM, Gedare Bloom <span dir="ltr"><<a href="mailto:gedare@rtems.org" target="_blank">gedare@rtems.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks. Would it be possible for you to turn the failure cases into<br>
real test failures? In other words, add some logic to detect the<br>
priority inversion and abort the test?<br>
<span><font color="#888888"><br>
Gedare<br>
</font></span><div><div><br>
On Thu, Aug 13, 2015 at 12:05 PM, Saurabh Gadia <<a href="mailto:gadia@usc.edu" target="_blank">gadia@usc.edu</a>> wrote:<br>
> Hi,<br>
><br>
> Following is the result of spsem04 test without the patch:<br>
><br>
> *** BEGIN OF TEST SPSEM 4 ***<br>
><br>
> init: S0 created<br>
><br>
> init: S1 created<br>
><br>
> init: TA01 created with priority 36<br>
><br>
> init: TA02 created with priority 34<br>
><br>
> init: TA03 created with priority 32<br>
><br>
> TA01: started with priority 36<br>
><br>
> TA01: priority 36, holding S0<br>
><br>
> TA02: started with priority 34<br>
><br>
> TA02: priority 34, holding S1<br>
><br>
> TA01: priority 34, holding S0 and now creating TA03<br>
><br>
> TA03: started with priority 32<br>
><br>
> TA01: priority 34 Releasing s0 (This is priority inheritance problem as TA02<br>
> waits on mutex held by TA01 and has higher priority than TA01. TA03 just<br>
> promotes the priority TA02.)<br>
><br>
> TA02: priority 32, holding S1,S0<br>
><br>
> TA02: priority 32 before releasing S0<br>
><br>
> TA02: priority 32 after releasing S0<br>
><br>
> TA02: priority 32 before releasing S1<br>
><br>
> TA03: priority 32, holding S1<br>
><br>
> TA03: priority 32<br>
><br>
> TA03: suspending<br>
><br>
> TA02: priority 34 after releasing S1<br>
><br>
> TA02: suspending<br>
><br>
> TA01: priority 36<br>
><br>
> TA01: exiting<br>
><br>
> *** END OF TEST SPSEM 4 ***<br>
><br>
> You can see the difference in highlighted portions of both outputs.<br>
><br>
> Thanks,<br>
><br>
> Saurabh Gadia<br>
><br>
> On Thu, Aug 13, 2015 at 8:17 AM, Saurabh Gadia <<a href="mailto:gadia@usc.edu" target="_blank">gadia@usc.edu</a>> wrote:<br>
>><br>
>> Ok. I will mail you back soon.<br>
>><br>
>><br>
>> On Thursday, August 13, 2015, Gedare Bloom <<a href="mailto:gedare@rtems.org" target="_blank">gedare@rtems.org</a>> wrote:<br>
>>><br>
>>> Saurabh,<br>
>>><br>
>>> Please pull from rtems.git again, create a new branch from 'master',<br>
>>> and apply your changes to the branch. It's too hard to review code<br>
>>> that is not all by itself on a branch.<br>
>>><br>
>>> Gedare<br>
>>><br>
>>> On Thu, Aug 13, 2015 at 5:28 AM, Saurabh Gadia <<a href="mailto:gadia@usc.edu" target="_blank">gadia@usc.edu</a>> wrote:<br>
>>> > Hi,<br>
>>> ><br>
>>> > I have implemented uniprocessor model of nested mutex problem in rtems.<br>
>>> > its<br>
>>> > still in basic form. I tried to multiplex it with the existing solution<br>
>>> > but<br>
>>> > was finding hard time. To push ahead, I decided to have separate<br>
>>> > functions<br>
>>> > for uniprocessor and SMP(kept default behavior) and with your review<br>
>>> > comments will know what to do. Following is the link for the git repo:<br>
>>> > <a href="https://github.com/saurabhgadia4/rtems/commits/master" rel="noreferrer" target="_blank">https://github.com/saurabhgadia4/rtems/commits/master</a> and its JPF<br>
>>> > branch:<br>
>>> ><br>
>>> > <a href="https://github.com/saurabhgadia4/lock-model/blob/uniproc-new1/rtems/Mutex.java" rel="noreferrer" target="_blank">https://github.com/saurabhgadia4/lock-model/blob/uniproc-new1/rtems/Mutex.java</a><br>
>>> ><br>
>>> > I have also tested spsem01, 02, 03 test cases. Following are the links<br>
>>> > for<br>
>>> > the test case results which states output before solution and after<br>
>>> > applying<br>
>>> > the solution. I am still not getting whether my code is passing spsem03<br>
>>> > test<br>
>>> > or not. How can I verify that?<br>
>>> ><br>
>>> > Test Case Link:<br>
>>> ><br>
>>> > <a href="https://drive.google.com/folderview?id=0B44HRKVuGCkFfnFDVmxqQzZZUzljNUg4YmVPZmEybEp2Q0NNclpvS2FvemZ4Tm5Xa19nemM&usp=sharing" rel="noreferrer" target="_blank">https://drive.google.com/folderview?id=0B44HRKVuGCkFfnFDVmxqQzZZUzljNUg4YmVPZmEybEp2Q0NNclpvS2FvemZ4Tm5Xa19nemM&usp=sharing</a><br>
>>> ><br>
>>> > Thanks,<br>
>>> ><br>
>>> > Saurabh Gadia<br>
>><br>
>><br>
>><br>
>> --<br>
>> Thanks,<br>
>><br>
>> Saurabh Gadia<br>
>><br>
><br>
</div></div></blockquote></div><br></div></div></div>
</blockquote></div><br></div>