<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=utf-8" http-equiv=Content-Type><!-- flashmail style begin -->
<STYLE type=text/css>
body {border-width:0;margin:0}
img {border:0;margin:0;padding:0}
</STYLE>
<BASE target=_blank><!-- flashmail style end -->
<META name=GENERATOR content="MSHTML 11.00.10586.545"></HEAD>
<BODY
style="BORDER-LEFT-WIDTH: 0px; FONT-SIZE: 10.5pt; FONT-FAMILY: times new roman; BORDER-RIGHT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; COLOR: #000000; MARGIN: 12px; LINE-HEIGHT: 1.5; BORDER-TOP-WIDTH: 0px"
marginheight="0" marginwidth="0">
<DIV>Hello:</DIV>
<DIV>The reason why I ask the last question is that I am trying to implement the
'help mechanism' of MrsP.</DIV>
<DIV>The resource-holding task can be preempted by other higher priority normal
execution task, but it still holds the resource. So I need to find out, is there
any task in other processor is spinning and waitting for that resource. Sothat
this processor can do the 'help'. Of cource, such task have been enqueued on the
wait queue of that semaphore. But how can I locate that task when it locates on
the middle of that queue?(traverse all the wait queue and compare to all the
processors' spinning tasks?)</DIV>
<DIV> </DIV>
<DIV><STATIONERY>
<DIV>
<STYLE type=text/css>
body {
font-size:12.1pt; font-family:simsun,serif;
}
</STYLE>
<!-- flashmail style begin -->
<STYLE type=text/css> <!--@import url(D:\网易闪电邮\\data\scrollbar.css); -->
blockquote {
margin-top:0; margin-bottom:0; margin-left:2em;
}
body {
padding:0; margin:0;
}
</STYLE>
<BASE target=_blank><!-- flashmail style end -->
<META name=GENERATOR content="MSHTML 11.00.9600.17207"><STATIONERY>
<DIV>
<STYLE type=text/css>
body {
font-size:12.1pt; font-family:simsun,serif;
}
</STYLE>
<!-- flashmail style begin -->
<STYLE type=text/css> <!--@import url(D:\网易闪电邮\\data\scrollbar.css); -->
blockquote {
margin-top:0; margin-bottom:0; margin-left:2em;
}
body {
padding:0; margin:0;
}
</STYLE>
<BASE target=_blank><!-- flashmail style end -->
<META name=GENERATOR content="MSHTML 11.00.9600.16521"><STATIONERY>
<DIV>
<STYLE type=text/css>
body {
font-size:12.1pt; font-family:simsun,serif;
}
</STYLE>
<!-- flashmail style begin -->
<STYLE type=text/css> <!--@import url(D:\网易闪电邮\\data\scrollbar.css); -->
blockquote {
margin-top:0; margin-bottom:0; margin-left:2em;
}
body {
padding:0; margin:0;
}
</STYLE>
<BASE target=_blank><!-- flashmail style end -->
<META name=GENERATOR content="MSHTML 11.00.9600.16521"><STATIONERY>
<DIV>
<STYLE type=text/css>
body {
font-size:12.1pt; font-family:simsun,serif;
}
</STYLE>
<!-- flashmail style begin -->
<STYLE type=text/css> <!--@import url(D:\网易闪电邮\\data\scrollbar.css); -->
blockquote {
margin-top:0; margin-bottom:0; margin-left:2em;
}
body {
padding:0; margin:0;
}
</STYLE>
<BASE target=_blank><!-- flashmail style end -->
<META name=GENERATOR content="MSHTML 11.00.9600.16518"><STATIONERY>
<DIV>
<DIV
style="WHITE-SPACE: normal; WORD-SPACING: 0px; TEXT-TRANSFORM: none; COLOR: rgb(0,0,17); FONT: 13px Tahoma; LETTER-SPACING: normal; TEXT-INDENT: 2em; -webkit-text-stroke-width: 0px"
align=right><FONT face="Times New Roman">Best Wishes!</FONT></DIV>
<DIV
style="WHITE-SPACE: normal; WORD-SPACING: 0px; TEXT-TRANSFORM: none; COLOR: rgb(0,0,17); FONT: 13px Tahoma; LETTER-SPACING: normal; TEXT-INDENT: 2em; -webkit-text-stroke-width: 0px"
align=right><FONT face=宋体><I><BR></I></FONT></DIV>
<DIV
style="WHITE-SPACE: normal; WORD-SPACING: 0px; TEXT-TRANSFORM: none; COLOR: rgb(0,0,17); FONT: 13px Tahoma; LETTER-SPACING: normal; TEXT-INDENT: 2em; -webkit-text-stroke-width: 0px"
align=right><FONT face=宋体><I><BR></I></FONT></DIV>
<DIV
style="WHITE-SPACE: normal; WORD-SPACING: 0px; TEXT-TRANSFORM: none; COLOR: rgb(0,0,17); FONT: 13px Tahoma; LETTER-SPACING: normal; TEXT-INDENT: 2em; -webkit-text-stroke-width: 0px"
align=right><FONT face="Times New Roman"><I>You Sincerely!</I></FONT></DIV>
<DIV
style="WHITE-SPACE: normal; WORD-SPACING: 0px; TEXT-TRANSFORM: none; COLOR: rgb(0,0,17); FONT: 13px Tahoma; LETTER-SPACING: normal; TEXT-INDENT: 2em; -webkit-text-stroke-width: 0px"
align=right><FONT
face="Times New Roman"><B>SHI Junjie</B></FONT></DIV></DIV></STATIONERY></DIV></STATIONERY></DIV></STATIONERY></DIV></STATIONERY></DIV></STATIONERY></DIV>
<DIV> </DIV>
<DIV style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; COLOR: #c0c0c0"
align=left>2016-08-30
<HR id=SignNameHR
style="BORDER-TOP: #c0c0c0 1px solid; HEIGHT: 1px; BORDER-RIGHT: 0px; WIDTH: 122px; BORDER-BOTTOM: 0px; BORDER-LEFT: 0px"
align=left>
<SPAN id=_FlashSignName>shijunjie92</SPAN> </DIV>
<HR
style="BORDER-TOP: #c0c0c0 1px solid; HEIGHT: 1px; BORDER-RIGHT: 0px; BORDER-BOTTOM: 0px; BORDER-LEFT: 0px">
<BLOCKQUOTE id=ntes-flashmail-quote
style="FONT-SIZE: 10pt; FONT-FAMILY: Verdana; PADDING-LEFT: 0px; MARGIN-LEFT: 0px">
<DIV><STRONG>发件人:</STRONG>Björn Brandenburg <bbb@mpi-sws.org></DIV>
<DIV><STRONG>发送时间:</STRONG>2016-08-30 17:00</DIV>
<DIV><STRONG>主题:</STRONG>Re: [LITMUS^RT] Synchronization of resources</DIV>
<DIV><STRONG>收件人:</STRONG>"litmus-dev"<litmus-dev@lists.litmus-rt.org></DIV>
<DIV><STRONG>抄送:</STRONG></DIV>
<DIV> </DIV>
<DIV><BR>
<DIV>
<BLOCKQUOTE type="cite">
<DIV>On 30 Aug 2016, at 15:21, shijunjie92 <<A
href="mailto:shijunjie92@gmail.com">shijunjie92@gmail.com</A>>
wrote:</DIV><BR class=Apple-interchange-newline>
<DIV>
<DIV
style="FONT-SIZE: 14px; FONT-FAMILY: 'times new roman'; WHITE-SPACE: normal; WORD-SPACING: 0px; TEXT-TRANSFORM: none; FONT-WEIGHT: normal; FONT-STYLE: normal; LETTER-SPACING: normal; TEXT-INDENT: 0px; font-variant-caps: normal; -webkit-text-stroke-width: 0px">When
we simulate the critical section within one task using 'rtspin'. We will
enter the resource id. But there is no such id information included by
semaphore. So how can we know the semaphore locks which resource. (Different
resources use different wait_queues?)</DIV></DIV></BLOCKQUOTE>
<DIV><BR></DIV>
<DIV>The FDSO interface (“file-descriptor-attached shared objects”) maps the
user-space provided IDs to objects. To share a semaphore between two
processes, both need to open the same file (= name space), and reference the
same ID (= index in object table attached to file). </DIV><BR>
<BLOCKQUOTE type="cite">
<DIV>
<DIV
style="FONT-SIZE: 14px; FONT-FAMILY: 'times new roman'; WHITE-SPACE: normal; WORD-SPACING: 0px; TEXT-TRANSFORM: none; FONT-WEIGHT: normal; FONT-STYLE: normal; LETTER-SPACING: normal; TEXT-INDENT: 0px; font-variant-caps: normal; -webkit-text-stroke-width: 0px">Why the
function pfp_mpcp_lock( as well as other lock
function) calls 'init_waitqueue_entry' everytime when
the resource is occupied. When more then two tasks try to get the
resource, the wait_queue will be initialized more than once? How to explain
that?<BR></DIV></DIV></BLOCKQUOTE>
<DIV><BR></DIV>
<DIV>It initializes a wait queue *entry*, not the entire wait queue. Every
blocked task allocates such an entry on its stack.</DIV><BR>
<BLOCKQUOTE type="cite">
<DIV>
<DIV
style="FONT-SIZE: 14px; FONT-FAMILY: 'times new roman'; WHITE-SPACE: normal; WORD-SPACING: 0px; TEXT-TRANSFORM: none; FONT-WEIGHT: normal; FONT-STYLE: normal; LETTER-SPACING: normal; TEXT-INDENT: 0px; font-variant-caps: normal; -webkit-text-stroke-width: 0px">The
last question is about the MPCP_VS protocol in P-FP plugin.</DIV>
<DIV
style="FONT-SIZE: 14px; FONT-FAMILY: 'times new roman'; WHITE-SPACE: normal; WORD-SPACING: 0px; TEXT-TRANSFORM: none; FONT-WEIGHT: normal; FONT-STYLE: normal; LETTER-SPACING: normal; TEXT-INDENT: 0px; font-variant-caps: normal; -webkit-text-stroke-width: 0px">When
we use MPCP_VS protocol:</DIV>
<DIV
style="FONT-SIZE: 14px; FONT-FAMILY: 'times new roman'; WHITE-SPACE: normal; WORD-SPACING: 0px; TEXT-TRANSFORM: none; FONT-WEIGHT: normal; FONT-STYLE: normal; LETTER-SPACING: normal; TEXT-INDENT: 0px; font-variant-caps: normal; -webkit-text-stroke-width: 0px">cpu_0:
task_0 is excuting by holding the resource_0<SPAN
class=Apple-converted-space> </SPAN><BR>cpu_1: task_1 is excuting by
holding the resource_1<SPAN
class=Apple-converted-space> </SPAN><BR>cpu_2: task_2 is spinning but
not excuting for waitting one resource (resource_0 or resource_1)</DIV>
<DIV
style="FONT-SIZE: 14px; FONT-FAMILY: 'times new roman'; WHITE-SPACE: normal; WORD-SPACING: 0px; TEXT-TRANSFORM: none; FONT-WEIGHT: normal; FONT-STYLE: normal; LETTER-SPACING: normal; TEXT-INDENT: 0px; font-variant-caps: normal; -webkit-text-stroke-width: 0px"> </DIV>
<DIV
style="FONT-SIZE: 14px; FONT-FAMILY: 'times new roman'; WHITE-SPACE: normal; WORD-SPACING: 0px; TEXT-TRANSFORM: none; FONT-WEIGHT: normal; FONT-STYLE: normal; LETTER-SPACING: normal; TEXT-INDENT: 0px; font-variant-caps: normal; -webkit-text-stroke-width: 0px">Now,
task_0 is preempted by one higher priority task, but it still hold the
semaphore of resource_0.<BR></DIV></DIV></BLOCKQUOTE>
<DIV><BR></DIV>
<DIV>Isn’t a resource-holding task priority-boosted?</DIV><BR>
<BLOCKQUOTE type="cite">
<DIV
style="FONT-SIZE: 14px; FONT-FAMILY: 'times new roman'; WHITE-SPACE: normal; WORD-SPACING: 0px; TEXT-TRANSFORM: none; FONT-WEIGHT: normal; FONT-STYLE: normal; LETTER-SPACING: normal; TEXT-INDENT: 0px; font-variant-caps: normal; -webkit-text-stroke-width: 0px">Is
there any possible that lets task_0 know whether the task_2 is waitting for
resource_0 or resource_1 or not?</DIV></BLOCKQUOTE></DIV><BR>
<DIV>In the kernel, you can always lock and look at the wait queue associated
with the semaphore. All tasks blocked on the lock are queued.</DIV>
<DIV><BR></DIV>
<DIV>Regards,</DIV>
<DIV>Björn</DIV>
<DIV><BR></DIV></DIV></BLOCKQUOTE></BODY></HTML>