<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Hi Monk,<br>
<br>
yeah thinking about those issue currently as well. It indeed looks
like we have some kind of race here.<br>
<br>
When we call backoff_reservation the next iteration of the look
will reserve all BOs again, so that can't be the issue.<br>
<br>
Regards,<br>
Christian.<br>
<br>
Am 28.02.2018 um 11:37 schrieb Liu, Monk:<br>
</div>
<blockquote type="cite"
cite="mid:BLUPR12MB044995B6521FBE9C389BBE7184C70@BLUPR12MB0449.namprd12.prod.outlook.com">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:DengXian;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:DengXian;
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
font-size:10.5pt;
font-family:DengXian;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:DengXian;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:DengXian;}
/* Page Definitions */
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US">Hi Christian <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">In
amdgpu_cs_parser_bos(), it calls
ttm_eu_backoff_reservation() if @need_pages not empty, is it
safe ?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">You see that if two
threads in parallel running in cs_parser_bos(), if the
thread1 did call backoff_reservation and continue, that
leaves
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">All following
reservation functions on root BO executed without protection
from the lock, Meanwhile if this time thread2 call
cs_parser_bos() in parallel, it can
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Get the lock of the
reservation object on root BO (assume thread 1/2 share the
same VM) immediately, so both of those threads consider they
are
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Under protection of lock
of reservation on the root bo. Do you think it’s a race
issue ?<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">You know that I recently
hit BUG() in reservation.c, and also found some weird bugs
can be fixed by removing the kfree(obj->staged)
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">In
reservation_object_reserve_shared(), and I think you right
on the “staged” part that it shouldn’t be freed if
everything go with rules (<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Always held the lock of
the bo)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Thanks <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">/Monk<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
</div>
</blockquote>
<br>
</body>
</html>