<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p>your patch looks good, do you think we should also do this:</p>
<p><br>
</p>
<p></p>
<div> void amd_sched_fence_scheduled(struct amd_sched_fence *fence)<br>
{<br>
- int ret = fence_signal(&fence->scheduled);<br>
+ int ret;<br>
+<br>
+ fence_get(&fence->scheduled;)<br>
+ ret = fence_signal(&fence->scheduled);<br>
<br>
if (!ret)<br>
FENCE_TRACE(&fence->scheduled, "signaled from irq context\n");<br>
else<br>
FENCE_TRACE(&fence->scheduled, "was already signaled\n");<br>
+ fence_put(&fence->scheduled);<br>
}</div>
<br>
<p></p>
<p><br>
</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Koenig, Christian<br>
<b>Sent:</b> Friday, October 13, 2017 5:00:27 PM<br>
<b>To:</b> Liu, Monk; Nicolai Hähnle; amd-gfx@lists.freedesktop.org<br>
<b>Subject:</b> Re: regression with d6c650c0a8f6f671e49553725e1db541376d95f2</font>
<div> </div>
</div>
<div>
<div class="moz-cite-prefix">
<blockquote type="cite">
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:等线;color:windowtext" lang="EN-US">There is chance that free_job() called before that </span><span style="font-size:10.5pt;font-family:等线;color:windowtext">“<span lang="EN-US">trace_amd_sched_process_job</span>”<span lang="EN-US">,
correct?</span></span></p>
<span style="font-size:10.5pt;font-family:等线;color:windowtext" lang="EN-US"></span></blockquote>
Correct, but that is harmless.<br>
<br>
Take a look what trace_amd_sched_process_job actually does, it just prints the pointer of the fence structure (but the pointer might be stale at this point).<br>
<br>
Nevertheless you are right that this is really ugly.<br>
<br>
How about the attached patch to fix the issue?<br>
<br>
Regards,<br>
Christian. <br>
<br>
Am 13.10.2017 um 10:51 schrieb Liu, Monk:<br>
</div>
<blockquote type="cite" cite="mid:BLUPR12MB044908B9AECE89D7E942EC7F84480@BLUPR12MB0449.namprd12.prod.outlook.com">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:宋体;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:等线;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"\@宋体";
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:"\@等线";
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:"Courier New \;color\:\#D4D4D4";
panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"Courier New \;color\:\#569CD6";
panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"Courier New \;color\:\#DCDCAA";
panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"Courier New \;color\:\#9CDCFE";
panose-1:0 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"Courier New \;color\:\#C586C0";
panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:宋体;
color:black;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:宋体;
color:black;}
span.EmailStyle18
{mso-style-type:personal;
font-family:等线;
color:windowtext;}
span.EmailStyle19
{mso-style-type:personal;
font-family:等线;
color:windowtext;}
span.EmailStyle22
{mso-style-type:personal-reply;
font-family:等线;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@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 style="font-size:10.5pt;font-family:等线;color:windowtext" lang="EN-US">The free_job() is called in sched_job_finish() which is queued on a WORK and scheduled from that
</span><span style="font-size:10.5pt;font-family:等线;color:windowtext">“<span lang="EN-US">amd_sched_fence_finished()</span>”<span lang="EN-US"><o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:等线;color:windowtext" lang="EN-US">So the finishing timing of free_job() is asynchronized with sched_process_job()<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:等线;color:windowtext" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:等线;color:windowtext" lang="EN-US">There is chance that free_job() called before that </span><span style="font-size:10.5pt;font-family:等线;color:windowtext">“<span lang="EN-US">trace_amd_sched_process_job</span>”<span lang="EN-US">,
correct?<o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:等线;color:windowtext" lang="EN-US">And if so the s_fence referred by it maybe a wild pointer
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:等线;color:windowtext" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:等线;color:windowtext" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:等线;color:windowtext" lang="EN-US">BR Monk<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:等线;color:windowtext" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:等线;color:windowtext" lang="EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1
1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext" lang="EN-US">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext" lang="EN-US"> Liu, Monk
<br>
<b>Sent:</b> 2017</span><span style="font-size:11.0pt;color:windowtext">年</span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext" lang="EN-US">10</span><span style="font-size:11.0pt;color:windowtext">月</span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext" lang="EN-US">13</span><span style="font-size:11.0pt;color:windowtext">日</span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext" lang="EN-US">
16:49<br>
<b>To:</b> Koenig, Christian <a class="moz-txt-link-rfc2396E" href="mailto:Christian.Koenig@amd.com">
<Christian.Koenig@amd.com></a>; Nicolai Hähnle <a class="moz-txt-link-rfc2396E" href="mailto:nhaehnle@gmail.com">
<nhaehnle@gmail.com></a>; <a class="moz-txt-link-abbreviated" href="mailto:amd-gfx@lists.freedesktop.org">
amd-gfx@lists.freedesktop.org</a><br>
<b>Subject:</b> RE: regression with d6c650c0a8f6f671e49553725e1db541376d95f2<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:等线;color:windowtext" lang="EN-US">No that</span><span style="font-size:10.5pt;font-family:等线;color:windowtext">’<span lang="EN-US">s not true<o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:等线;color:windowtext" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:等线;color:windowtext" lang="EN-US">The free_job() is called in sched_job_finish() which is queued on a WORK and scheduled from that
</span><span style="font-size:10.5pt;font-family:等线;color:windowtext">“<span lang="EN-US">amd_sched_fence_finished()</span>”<span lang="EN-US"><o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:等线;color:windowtext" lang="EN-US">So the finishing timing of free_job() is asynchronized with sched_process_job()<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:等线;color:windowtext" lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:等线;color:windowtext" lang="EN-US">How can you sure free_job() must before
</span><span style="font-size:10.5pt;font-family:等线;color:windowtext">“<span lang="EN-US">trace_amd_sched_process_job</span>”<span lang="EN-US"> ?<o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:等线;color:windowtext" lang="EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1
1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext" lang="EN-US">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext" lang="EN-US"> Koenig, Christian
<br>
<b>Sent:</b> 2017</span><span style="font-size:11.0pt;color:windowtext">年</span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext" lang="EN-US">10</span><span style="font-size:11.0pt;color:windowtext">月</span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext" lang="EN-US">13</span><span style="font-size:11.0pt;color:windowtext">日</span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext" lang="EN-US">
16:43<br>
<b>To:</b> Liu, Monk <<a href="mailto:Monk.Liu@amd.com" moz-do-not-send="true">Monk.Liu@amd.com</a>>; Nicolai Hähnle <<a href="mailto:nhaehnle@gmail.com" moz-do-not-send="true">nhaehnle@gmail.com</a>>;
<a href="mailto:amd-gfx@lists.freedesktop.org" moz-do-not-send="true">amd-gfx@lists.freedesktop.org</a><br>
<b>Subject:</b> Re: regression with d6c650c0a8f6f671e49553725e1db541376d95f2<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US">The free_job() callback is called only way after the job has finished.<br>
<br>
That is one change actually made by you to the code :)<br>
<br>
Christian.<br>
<br>
Am 13.10.2017 um 10:39 schrieb Liu, Monk:<o:p></o:p></span></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:等线;color:windowtext" lang="EN-US">I doubt it would always work fine</span><span style="font-size:10.5pt;font-family:等线;color:windowtext">…</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:等线;color:windowtext" lang="EN-US"> </span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:等线;color:windowtext" lang="EN-US">First, we have FENCE_TRACE reference s_fence->finished after
</span><span style="font-size:10.5pt;font-family:等线;color:windowtext">“<span lang="EN-US">fence_signal(&fence->finished)</span>”</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:等线;color:windowtext" lang="EN-US">Second, we have trace_amd_sched_proess_job(s_fence) after
</span><span style="font-size:10.5pt;font-family:等线;color:windowtext">“<span lang="EN-US">amd_sched_fence_finished()</span>”<span lang="EN-US">,</span></span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:等线;color:windowtext" lang="EN-US"> </span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:等线;color:windowtext" lang="EN-US">If you put the finished before free_job() and by coincidence the job_finish() get very soon executed you</span><span style="font-size:10.5pt;font-family:等线;color:windowtext">’<span lang="EN-US">ll
have odds to hit wild pointer on above two cases</span></span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:等线;color:windowtext" lang="EN-US"> </span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:等线;color:windowtext" lang="EN-US">BR Monk</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:等线;color:windowtext" lang="EN-US"> </span><span lang="EN-US"><o:p></o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1
1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext" lang="EN-US">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext" lang="EN-US"> Koenig, Christian
<br>
<b>Sent:</b> 2017</span><span style="font-size:11.0pt;color:windowtext">年</span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext" lang="EN-US">10</span><span style="font-size:11.0pt;color:windowtext">月</span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext" lang="EN-US">13</span><span style="font-size:11.0pt;color:windowtext">日</span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext" lang="EN-US">
16:17<br>
<b>To:</b> Liu, Monk <a href="mailto:Monk.Liu@amd.com" moz-do-not-send="true"><Monk.Liu@amd.com></a>; Nicolai Hähnle
<a href="mailto:nhaehnle@gmail.com" moz-do-not-send="true"><nhaehnle@gmail.com></a>;
<a href="mailto:amd-gfx@lists.freedesktop.org" moz-do-not-send="true">amd-gfx@lists.freedesktop.org</a><br>
<b>Subject:</b> Re: regression with d6c650c0a8f6f671e49553725e1db541376d95f2</span><span lang="EN-US"><o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-US"> <o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US">Yeah, that change is actually incorrect and should be reverted.<br>
<br>
What we really need to do is remove dropping sched_job->s_fence from amd_sched_process_job() into amd_sched_job_finish() directly before the call to free_job().<br>
<br>
Regards,<br>
Christian.<br>
<br>
Am 13.10.2017 um 09:24 schrieb Liu, Monk:<o:p></o:p></span></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div id="divtagdefaultwrapper">
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-family:"Calibri",sans-serif" lang="EN-US">commit d6c650c0a8f6f671e49553725e1db541376d95f2<br>
Author: Nicolai Hähnle <a href="mailto:nicolai.haehnle@amd.com" moz-do-not-send="true">
<nicolai.haehnle@amd.com></a><br>
@@ -611,6 +611,10 @@ static int amd_sched_main(void *param)<br>
<br>
fence = sched->ops->run_job(sched_job);<br>
amd_sched_fence_scheduled(s_fence);<br>
+<br>
+ /* amd_sched_process_job drops the job's reference of the fence. */<br>
+ sched_job->s_fence = NULL;<br>
+<br>
if (fence) {<br>
s_fence->parent = dma_fence_get(fence);<br>
r = dma_fence_add_callback(fence, &s_fence->cb,</span><span lang="EN-US"><o:p></o:p></span></p>
</div>
<p><span style="font-family:"Calibri",sans-serif" lang="EN-US">Hi Nicolai</span><span lang="EN-US"><o:p></o:p></span></p>
<p><span style="font-family:"Calibri",sans-serif" lang="EN-US"> </span><span lang="EN-US"><o:p></o:p></span></p>
<p><span style="font-family:"Calibri",sans-serif" lang="EN-US">with this patch, you will break "amdgpu_sched_hw_job_reset()"routine:</span><span lang="EN-US"><o:p></o:p></span></p>
<div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US"> </span><span lang="EN-US"><o:p></o:p></span></p>
<div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier
New ;color:#569CD6",serif" lang="EN-US">void</span><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US">
</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier
New ;color:#DCDCAA",serif" lang="EN-US">amd_sched_hw_job_reset</span><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US">(</span><span style="font-size:10.5pt;font-family:"Courier
New ;color:#569CD6",serif" lang="EN-US">struct</span><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US">
amd_gpu_scheduler</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US">*sched)</span><span lang="EN-US"><o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US"> </span><span lang="EN-US"><o:p></o:p></span></p>
<div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US">{</span><span lang="EN-US"><o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US"> </span><span lang="EN-US"><o:p></o:p></span></p>
<div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US"> </span><span style="font-size:10.5pt;font-family:"Courier
New ;color:#569CD6",serif" lang="EN-US">struct</span><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US">
amd_sched_job</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US">*s_job;</span><span lang="EN-US"><o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US"> </span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US"> </span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US"> </span><span lang="EN-US"><o:p></o:p></span></p>
<div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US"> </span><span style="font-size:10.5pt;font-family:"Courier
New ;color:#DCDCAA",serif" lang="EN-US">spin_lock</span><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US">(&sched-></span><span style="font-size:10.5pt;font-family:"Courier
New ;color:#9CDCFE",serif" lang="EN-US">job_list_lock</span><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US">);</span><span lang="EN-US"><o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US"> </span><span lang="EN-US"><o:p></o:p></span></p>
<div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US"> </span><span style="font-size:10.5pt;font-family:"Courier
New ;color:#DCDCAA",serif" lang="EN-US">list_for_each_entry_reverse</span><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US">(s_job,</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US">&sched-></span><span style="font-size:10.5pt;font-family:"Courier
New ;color:#9CDCFE",serif" lang="EN-US">ring_mirror_list</span><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US">,
node) {</span><span lang="EN-US"><o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US"> </span><span lang="EN-US"><o:p></o:p></span></p>
<div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US"> </span><span style="font-size:10.5pt;font-family:"Courier
New ;color:#C586C0",serif" lang="EN-US">if</span><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US">
(s_job-></span><span style="font-size:10.5pt;font-family:"Courier
New ;color:#9CDCFE",serif" lang="EN-US">s_fence</span><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US">-></span><span style="font-size:10.5pt;font-family:"Courier
New ;color:#9CDCFE",serif" lang="EN-US">parent</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US">&&</span><span lang="EN-US"><o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US"> </span><span lang="EN-US"><o:p></o:p></span></p>
<div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US">
</span><span style="font-size:10.5pt;font-family:"Courier
New ;color:#DCDCAA",serif" lang="EN-US">fence_remove_callback</span><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US">(s_job-></span><span style="font-size:10.5pt;font-family:"Courier
New ;color:#9CDCFE",serif" lang="EN-US">s_fence</span><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US">-></span><span style="font-size:10.5pt;font-family:"Courier
New ;color:#9CDCFE",serif" lang="EN-US">parent</span><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US">,</span><span lang="EN-US"><o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US"> </span><span lang="EN-US"><o:p></o:p></span></p>
<div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US"> &s_job-></span><span style="font-size:10.5pt;font-family:"Courier
New ;color:#9CDCFE",serif" lang="EN-US">s_fence</span><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US">-></span><span style="font-size:10.5pt;font-family:"Courier
New ;color:#9CDCFE",serif" lang="EN-US">cb</span><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US">))</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US">{</span><span lang="EN-US"><o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US"> </span><span lang="EN-US"><o:p></o:p></span></p>
<div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US"> </span><span style="font-size:10.5pt;font-family:"Courier
New ;color:#DCDCAA",serif" lang="EN-US">fence_put</span><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US">(s_job-></span><span style="font-size:10.5pt;font-family:"Courier
New ;color:#9CDCFE",serif" lang="EN-US">s_fence</span><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US">-></span><span style="font-size:10.5pt;font-family:"Courier
New ;color:#9CDCFE",serif" lang="EN-US">parent</span><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US">);</span><span lang="EN-US"><o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US"> </span><span lang="EN-US"><o:p></o:p></span></p>
<div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US"> s_job-></span><span style="font-size:10.5pt;font-family:"Courier
New ;color:#9CDCFE",serif" lang="EN-US">s_fence</span><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US">-></span><span style="font-size:10.5pt;font-family:"Courier
New ;color:#9CDCFE",serif" lang="EN-US">parent</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US">=
</span><span lang="EN-US"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier
New ;color:#569CD6",serif" lang="EN-US">NULL</span><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US">;</span><span lang="EN-US"><o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US"> </span><span lang="EN-US"><o:p></o:p></span></p>
<div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US"> </span><span style="font-size:10.5pt;font-family:"Courier
New ;color:#DCDCAA",serif" lang="EN-US">atomic_dec</span><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US">(&sched-></span><span style="font-size:10.5pt;font-family:"Courier
New ;color:#9CDCFE",serif" lang="EN-US">hw_rq_count</span><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US">);</span><span lang="EN-US"><o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US"> </span><span lang="EN-US"><o:p></o:p></span></p>
<div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US"> }</span><span lang="EN-US"><o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US"> </span><span lang="EN-US"><o:p></o:p></span></p>
<div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US"> }</span><span lang="EN-US"><o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US"> </span><span lang="EN-US"><o:p></o:p></span></p>
<div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US"> </span><span style="font-size:10.5pt;font-family:"Courier
New ;color:#DCDCAA",serif" lang="EN-US">spin_unlock</span><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US">(&sched-></span><span style="font-size:10.5pt;font-family:"Courier
New ;color:#9CDCFE",serif" lang="EN-US">job_list_lock</span><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US">);</span><span lang="EN-US"><o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US"> </span><span lang="EN-US"><o:p></o:p></span></p>
<div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US">}</span><span lang="EN-US"><o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="line-height:14.25pt;background:#1E1E1E"><span style="font-size:10.5pt;font-family:"Courier
New ;color:#D4D4D4",serif" lang="EN-US"> </span><span lang="EN-US"><o:p></o:p></span></p>
</div>
<p><span style="font-family:"Calibri",sans-serif" lang="EN-US"> </span><span lang="EN-US"><o:p></o:p></span></p>
<p><span style="font-family:"Calibri",sans-serif" lang="EN-US">see that without sched_job->s_fence, you cannot remove the callback from its hw fence,</span><span lang="EN-US"><o:p></o:p></span></p>
<p><span style="font-family:"Calibri",sans-serif" lang="EN-US"> </span><span lang="EN-US"><o:p></o:p></span></p>
<p><span style="font-family:"Calibri",sans-serif" lang="EN-US">any idea??</span><span lang="EN-US"><o:p></o:p></span></p>
<p><span style="font-family:"Calibri",sans-serif" lang="EN-US"> </span><span lang="EN-US"><o:p></o:p></span></p>
<p><span style="font-family:"Calibri",sans-serif" lang="EN-US">BR Monk</span><span lang="EN-US"><o:p></o:p></span></p>
<p><span style="font-family:"Calibri",sans-serif" lang="EN-US"> </span><span lang="EN-US"><o:p></o:p></span></p>
<p><span style="font-family:"Calibri",sans-serif" lang="EN-US"> </span><span lang="EN-US"><o:p></o:p></span></p>
</div>
</blockquote>
<p><span lang="EN-US"> <o:p></o:p></span></p>
</blockquote>
<p><span lang="EN-US"><o:p> </o:p></span></p>
</div>
</blockquote>
<p><br>
</p>
</div>
</body>
</html>