<!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 5/28/2025 1:19 AM, Deng, Emily
wrote:<br>
</div>
<blockquote type="cite" cite="mid:PH0PR12MB54178912FD347C37BF8915388F67A@PH0PR12MB5417.namprd12.prod.outlook.com">
<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:DengXian;
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:Aptos;}@font-face
{font-family:"\@DengXian";
panose-1:2 1 6 0 3 1 1 1 1 1;}@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
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:0cm;
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.EmailStyle23
{mso-style-type:personal-reply;
font-family:"Arial",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]-->
<p style="font-family:Calibri;font-size:10pt;color:#0000FF;margin:5pt;font-style:normal;font-weight:normal;text-decoration:none;" align="Left">
[AMD Official Use Only - AMD Internal Distribution Only]<br>
</p>
<br>
<div>
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<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">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">
amd-gfx
<a class="moz-txt-link-rfc2396E" href="mailto:amd-gfx-bounces@lists.freedesktop.org"><amd-gfx-bounces@lists.freedesktop.org></a>
<b>On Behalf Of </b>Deng, Emily<br>
<b>Sent:</b> Monday, May 26, 2025 9:51 AM<br>
<b>To:</b> Chen, Xiaogang
<a class="moz-txt-link-rfc2396E" href="mailto:Xiaogang.Chen@amd.com"><Xiaogang.Chen@amd.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: [PATCH v2] drm/ttm: Should to
return the evict error<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p style="margin:5.0pt"><span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:blue">[AMD
Official Use Only - AMD Internal Distribution Only]<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p style="margin:5.0pt"><span style="font-size:10.0pt;font-family:"Calibri",sans-serif;color:blue">[AMD
Official Use Only - AMD Internal Distribution Only]<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<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">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">
Chen, Xiaogang <<a href="mailto:Xiaogang.Chen@amd.com" moz-do-not-send="true" class="moz-txt-link-freetext">Xiaogang.Chen@amd.com</a>>
<br>
<b>Sent:</b> Friday, May 23, 2025 6:27 AM<br>
<b>To:</b> Deng, Emily <<a href="mailto:Emily.Deng@amd.com" moz-do-not-send="true" class="moz-txt-link-freetext">Emily.Deng@amd.com</a>>;
<a href="mailto:amd-gfx@lists.freedesktop.org" moz-do-not-send="true" class="moz-txt-link-freetext">amd-gfx@lists.freedesktop.org</a><br>
<b>Subject:</b> Re: [PATCH v2] drm/ttm: Should
to return the evict error<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p><o:p> </o:p></p>
<div>
<p class="MsoNormal">On 5/21/2025 9:42 PM, Deng,
Emily wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>[AMD Official Use Only - AMD Internal Distribution Only]<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>[AMD Official Use Only - AMD Internal Distribution Only]<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Ping......<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Emily Deng<o:p></o:p></pre>
<pre>Best Wishes<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre><o:p> </o:p></pre>
<pre><o:p> </o:p></pre>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>-----Original Message-----<o:p></o:p></pre>
<pre>From: Emily Deng <a href="mailto:Emily.Deng@amd.com" moz-do-not-send="true"><Emily.Deng@amd.com></a><o:p></o:p></pre>
<pre>Sent: Wednesday, May 21, 2025 11:57 AM<o:p></o:p></pre>
<pre>To: <a href="mailto:amd-gfx@lists.freedesktop.org" moz-do-not-send="true" class="moz-txt-link-freetext">amd-gfx@lists.freedesktop.org</a><o:p></o:p></pre>
<pre>Cc: Deng, Emily <a href="mailto:Emily.Deng@amd.com" moz-do-not-send="true"><Emily.Deng@amd.com></a><o:p></o:p></pre>
<pre>Subject: [PATCH v2] drm/ttm: Should to return the evict error<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>For the evict fail case, the evict error should be returned.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>v2: Consider ENOENT case.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Signed-off-by: Emily Deng <a href="mailto:Emily.Deng@amd.com" moz-do-not-send="true"><Emily.Deng@amd.com></a><o:p></o:p></pre>
<pre>---<o:p></o:p></pre>
<pre>drivers/gpu/drm/ttm/ttm_resource.c | 8 ++++----<o:p></o:p></pre>
<pre>1 file changed, 4 insertions(+), 4 deletions(-)<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>diff --git a/drivers/gpu/drm/ttm/ttm_resource.c b/drivers/gpu/drm/ttm/ttm_resource.c<o:p></o:p></pre>
<pre>index 097716bd248a..abf104ae9d35 100644<o:p></o:p></pre>
<pre>--- a/drivers/gpu/drm/ttm/ttm_resource.c<o:p></o:p></pre>
<pre>+++ b/drivers/gpu/drm/ttm/ttm_resource.c<o:p></o:p></pre>
<pre>@@ -511,12 +511,12 @@ int ttm_resource_manager_evict_all(struct ttm_device<o:p></o:p></pre>
<pre>*bdev,<o:p></o:p></pre>
<pre> .force_alloc = true<o:p></o:p></pre>
<pre> };<o:p></o:p></pre>
<pre> struct dma_fence *fence;<o:p></o:p></pre>
<pre>- int ret;<o:p></o:p></pre>
<pre>+ int ret, evict_ret = 0;<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre> do {<o:p></o:p></pre>
<pre>- ret = ttm_bo_evict_first(bdev, man, &ctx);<o:p></o:p></pre>
<pre>+ evict_ret = ttm_bo_evict_first(bdev, man, &ctx);<o:p></o:p></pre>
<pre> cond_resched();<o:p></o:p></pre>
<pre>- } while (!ret);<o:p></o:p></pre>
<pre>+ } while (!evict_ret);<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre> spin_lock(&man->move_lock);<o:p></o:p></pre>
<pre> fence = dma_fence_get(man->move);<o:p></o:p></pre>
<pre>@@ -529,7 +529,7 @@ int ttm_resource_manager_evict_all(struct ttm_device *bdev,<o:p></o:p></pre>
<pre> return ret;<o:p></o:p></pre>
<pre> }<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>- return 0;<o:p></o:p></pre>
<pre>+ return (evict_ret == -ENOENT) ? 0 : evict_ret;<o:p></o:p></pre>
<pre>}<o:p></o:p></pre>
</blockquote>
</blockquote>
<p>Can you explain why you care ENOENT(No such file or
directory) specifically?<o:p></o:p></p>
<p>Regards<o:p></o:p></p>
<p>Xiaogang<o:p></o:p></p>
<p><span style="font-size:11.0pt;font-family:"Arial",sans-serif">For
ENOENT, it simply means the resource or file
doesn't exist—it doesn't indicate an error during
eviction. We only need to focus on actual
eviction-related errors.</span></p>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<p>I think I know what you mean. But I have a different view on
that. ttm_resource_manager_evict_all release all resources
associated with a ttm_resource_manager(man). It is part of memory
manager cleanup sequence. Even it fail(no matter what reason is) I
think the following memory manager cleanup should still continue
going, then the returned error value should not be used to stop
following clean up.</p>
<p>I think @Christian König can give judgment on it.</p>
<p>Regards</p>
<p>Xiaogang<br>
</p>
<blockquote type="cite" cite="mid:PH0PR12MB54178912FD347C37BF8915388F67A@PH0PR12MB5417.namprd12.prod.outlook.com">
<div>
<div class="WordSection1">
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<p><span style="font-size:11.0pt;font-family:"Arial",sans-serif"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;mso-ligatures:standardcontextual">Emily Deng<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;mso-ligatures:standardcontextual">Best Wishes<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<p><span style="font-size:11.0pt;font-family:"Arial",sans-serif"><o:p> </o:p></span></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre><o:p> </o:p></pre>
<pre>EXPORT_SYMBOL(ttm_resource_manager_evict_all);<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>--<o:p></o:p></pre>
<pre>2.34.1<o:p></o:p></pre>
</blockquote>
<pre><o:p> </o:p></pre>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</body>
</html>