<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p><br>
</p>
<div class="moz-cite-prefix">On 12/11/2024 4:24 PM, Cavitt, Jonathan
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CH0PR11MB5444CF26B806C6784B54AEFBE53E2@CH0PR11MB5444.namprd11.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-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}@font-face
{font-family:Aptos;}@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:12.0pt;
font-family:"Aptos",sans-serif;}a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0in;
font-size:10.0pt;
font-family:"Courier New";}span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;}span.hljs
{mso-style-name:hljs;}span.EmailStyle22
{mso-style-type:personal-reply;
font-family:"Aptos",sans-serif;
color:windowtext;}.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
mso-ligatures:none;}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:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<div>
<div
style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-left:.5in"><b><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif">
Nirmoy Das <a class="moz-txt-link-rfc2396E" href="mailto:nirmoy.das@linux.intel.com"><nirmoy.das@linux.intel.com></a>
<br>
<b>Sent:</b> Friday, December 6, 2024 11:28 PM<br>
<b>To:</b> Cavitt, Jonathan
<a class="moz-txt-link-rfc2396E" href="mailto:jonathan.cavitt@intel.com"><jonathan.cavitt@intel.com></a>;
<a class="moz-txt-link-abbreviated" href="mailto:intel-xe@lists.freedesktop.org">intel-xe@lists.freedesktop.org</a><br>
<b>Cc:</b> Gupta, saurabhg
<a class="moz-txt-link-rfc2396E" href="mailto:saurabhg.gupta@intel.com"><saurabhg.gupta@intel.com></a>; Zuo, Alex
<a class="moz-txt-link-rfc2396E" href="mailto:alex.zuo@intel.com"><alex.zuo@intel.com></a>; Vivi, Rodrigo
<a class="moz-txt-link-rfc2396E" href="mailto:rodrigo.vivi@intel.com"><rodrigo.vivi@intel.com></a><br>
<b>Subject:</b> Re: [PATCH v2] drm/xe/xe_sync: Add debug
printing to check_ufence<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
<p style="margin-left:.5in"><o:p> </o:p></p>
<div>
<p class="MsoNormal" style="margin-left:.5in">On 12/6/2024
7:11 PM, Jonathan Cavitt wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre style="margin-left:.5in">The xe_sync helper function check_ufence can occasionally report EBUSY<o:p></o:p></pre>
<pre style="margin-left:.5in">if the ufence has not been signalled yet. EBUSY is a non-fatal error<o:p></o:p></pre>
<pre style="margin-left:.5in">value for the function, so it is not desireable to warn in cases where<o:p></o:p></pre>
<pre style="margin-left:.5in">EBUSY is reported because it is up to the user to decide if EBUSY is a<o:p></o:p></pre>
<pre style="margin-left:.5in">fatal error in their use cases. However, we can and should report EBUSY<o:p></o:p></pre>
<pre style="margin-left:.5in">to the debug logs for diagnostic purposes.<o:p></o:p></pre>
<pre style="margin-left:.5in"><o:p> </o:p></pre>
<pre style="margin-left:.5in">v2: Use vm_dbg instead of XE_IOCTL_DBG (Rodrigo)<o:p></o:p></pre>
<pre style="margin-left:.5in"><o:p> </o:p></pre>
<pre style="margin-left:.5in">Signed-off-by: Jonathan Cavitt <a
href="mailto:jonathan.cavitt@intel.com" moz-do-not-send="true"><jonathan.cavitt@intel.com></a><o:p></o:p></pre>
<pre style="margin-left:.5in">CC: Rodrigo Vivi <a
href="mailto:rodrigo.vivi@intel.com" moz-do-not-send="true"><rodrigo.vivi@intel.com></a><o:p></o:p></pre>
<pre style="margin-left:.5in">---<o:p></o:p></pre>
<pre style="margin-left:.5in"> drivers/gpu/drm/xe/xe_vm.c | 10 ++++++++--<o:p></o:p></pre>
<pre style="margin-left:.5in"> 1 file changed, 8 insertions(+), 2 deletions(-)<o:p></o:p></pre>
<pre style="margin-left:.5in"><o:p> </o:p></pre>
<pre style="margin-left:.5in">diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c<o:p></o:p></pre>
<pre style="margin-left:.5in">index 74d684708b00..8c770d1b916c 100644<o:p></o:p></pre>
<pre style="margin-left:.5in">--- a/drivers/gpu/drm/xe/xe_vm.c<o:p></o:p></pre>
<pre style="margin-left:.5in">+++ b/drivers/gpu/drm/xe/xe_vm.c<o:p></o:p></pre>
<pre style="margin-left:.5in">@@ -2402,8 +2402,11 @@ static int op_lock_and_prep(struct drm_exec *exec, struct xe_vm *vm,<o:p></o:p></pre>
<pre style="margin-left:.5in"> break;<o:p></o:p></pre>
<pre style="margin-left:.5in"> case DRM_GPUVA_OP_REMAP:<o:p></o:p></pre>
<pre style="margin-left:.5in"> err = check_ufence(gpuva_to_vma(op->base.remap.unmap->va));<o:p></o:p></pre>
<pre style="margin-left:.5in">- if (err)<o:p></o:p></pre>
<pre style="margin-left:.5in">+ if (err) {<o:p></o:p></pre>
<pre style="margin-left:.5in">+ vm_dbg(&vm->xe->drm,<o:p></o:p></pre>
<pre style="margin-left:.5in">+ "REMAP: vma check ufence status = %i\n", err);<o:p></o:p></pre>
</blockquote>
<p style="margin-left:.5in">Move that to <span class="hljs">check_ufence()
instead so there there is only one copy of logging ?
<o:p></o:p></span></p>
<p><span style="font-size:11.0pt">IMO I think there’s value in
knowing which operation is failing, and that information
would<o:p></o:p></span></p>
<p><span style="font-size:11.0pt">be lost if we moved the
logging into check_ufence.</span></p>
</div>
</blockquote>
<p>igt stack strace[1] dumps the operation info and any UMD should
be able know the failed operation but not against as it is now: <br>
</p>
<p>Reviewed-by: Nirmoy Das <a class="moz-txt-link-rfc2396E" href="mailto:nirmoy.das@intel.com"><nirmoy.das@intel.com></a><br>
</p>
<p><br>
</p>
<p>[1]
<a class="moz-txt-link-freetext" href="https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_12052/shard-bmg-8/igt@xe_exec_compute_mode@many-rebind.html">https://intel-gfx-ci.01.org/tree/intel-xe/IGTPW_12052/shard-bmg-8/igt@xe_exec_compute_mode@many-rebind.html</a><br>
</p>
<blockquote type="cite"
cite="mid:CH0PR11MB5444CF26B806C6784B54AEFBE53E2@CH0PR11MB5444.namprd11.prod.outlook.com">
<div class="WordSection1">
<p><span style="font-size:11.0pt"><o:p></o:p></span></p>
<p><span style="font-size:11.0pt">-Jonathan Cavitt<o:p></o:p></span></p>
<p style="margin-left:.5in"><span class="hljs">Regards,</span><o:p></o:p></p>
<p style="margin-left:.5in"><span class="hljs">Nirmoy </span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"><br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre style="margin-left:.5in"><o:p> </o:p></pre>
<pre style="margin-left:.5in"> break;<o:p></o:p></pre>
<pre style="margin-left:.5in">+ }<o:p></o:p></pre>
<pre style="margin-left:.5in"> <o:p></o:p></pre>
<pre style="margin-left:.5in"> err = vma_lock_and_validate(exec,<o:p></o:p></pre>
<pre style="margin-left:.5in"> gpuva_to_vma(op->base.remap.unmap->va),<o:p></o:p></pre>
<pre style="margin-left:.5in">@@ -2415,8 +2418,11 @@ static int op_lock_and_prep(struct drm_exec *exec, struct xe_vm *vm,<o:p></o:p></pre>
<pre style="margin-left:.5in"> break;<o:p></o:p></pre>
<pre style="margin-left:.5in"> case DRM_GPUVA_OP_UNMAP:<o:p></o:p></pre>
<pre style="margin-left:.5in"> err = check_ufence(gpuva_to_vma(op->base.unmap.va));<o:p></o:p></pre>
<pre style="margin-left:.5in">- if (err)<o:p></o:p></pre>
<pre style="margin-left:.5in">+ if (err) {<o:p></o:p></pre>
<pre style="margin-left:.5in">+ vm_dbg(&vm->xe->drm,<o:p></o:p></pre>
<pre style="margin-left:.5in">+ "UNMAP: vma check ufence status = %i\n", err);<o:p></o:p></pre>
<pre style="margin-left:.5in"> break;<o:p></o:p></pre>
<pre style="margin-left:.5in">+ }<o:p></o:p></pre>
<pre style="margin-left:.5in"> <o:p></o:p></pre>
<pre style="margin-left:.5in"> err = vma_lock_and_validate(exec,<o:p></o:p></pre>
<pre style="margin-left:.5in"> gpuva_to_vma(op->base.unmap.va),<o:p></o:p></pre>
</blockquote>
</div>
</blockquote>
</body>
</html>