<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 Prike,<br>
<br>
no, that can lead to massive problems in a real OOM situation and
is not something we can do here.<br>
<br>
Christian.<br>
<br>
Am 15.05.19 um 04:00 schrieb Liang, Prike:<br>
</div>
<blockquote type="cite"
cite="mid:BYAPR12MB35256D8A0583B5DD019C2925FB090@BYAPR12MB3525.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: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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
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;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;}
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">Hi Christian ,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I just wonder when encounter ENOMEM error
during pin amdgpu BOs can we retry validate again as below.<o:p></o:p></p>
<p class="MsoNormal">With the following simply patch the Abaqus
pinned issue not observed.
<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">diff --git
a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c<o:p></o:p></p>
<p class="MsoNormal">index 11cbf63..72a32f5 100644<o:p></o:p></p>
<p class="MsoNormal">---
a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c<o:p></o:p></p>
<p class="MsoNormal">+++
b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c<o:p></o:p></p>
<p class="MsoNormal">@@ -902,11 +902,15 @@ int
amdgpu_bo_pin_restricted(struct amdgpu_bo *bo, u32 domain,<o:p></o:p></p>
<p class="MsoNormal">
bo->placements[i].lpfn = lpfn;<o:p></o:p></p>
<p class="MsoNormal"> bo->placements[i].flags
|= TTM_PL_FLAG_NO_EVICT;<o:p></o:p></p>
<p class="MsoNormal"> }<o:p></o:p></p>
<p class="MsoNormal">-<o:p></o:p></p>
<p class="MsoNormal">+retry:<o:p></o:p></p>
<p class="MsoNormal"> r =
ttm_bo_validate(&bo->tbo, &bo->placement,
&ctx);<o:p></o:p></p>
<p class="MsoNormal"> if (unlikely(r)) {<o:p></o:p></p>
<p class="MsoNormal">- dev_err(adev->dev, "%p
pin failed\n", bo);<o:p></o:p></p>
<p class="MsoNormal">- goto error;<o:p></o:p></p>
<p class="MsoNormal">+ if (r == -ENOMEM){<o:p></o:p></p>
<p class="MsoNormal">+ goto retry;<o:p></o:p></p>
<p class="MsoNormal">+ } else {<o:p></o:p></p>
<p class="MsoNormal">+
dev_err(adev->dev, "%p pin failed\n", bo);<o:p></o:p></p>
<p class="MsoNormal">+ goto error;<o:p></o:p></p>
<p class="MsoNormal">+ }<o:p></o:p></p>
<p class="MsoNormal"> }<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"> bo->pin_count = 1;<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
<p class="MsoNormal">Prike<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1
1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Marek Olšák
<a class="moz-txt-link-rfc2396E" href="mailto:maraeo@gmail.com"><maraeo@gmail.com></a> <br>
<b>Sent:</b> Wednesday, May 15, 2019 3:33 AM<br>
<b>To:</b> Christian König
<a class="moz-txt-link-rfc2396E" href="mailto:ckoenig.leichtzumerken@gmail.com"><ckoenig.leichtzumerken@gmail.com></a><br>
<b>Cc:</b> Zhou, David(ChunMing)
<a class="moz-txt-link-rfc2396E" href="mailto:David1.Zhou@amd.com"><David1.Zhou@amd.com></a>; Liang, Prike
<a class="moz-txt-link-rfc2396E" href="mailto:Prike.Liang@amd.com"><Prike.Liang@amd.com></a>; dri-devel
<a class="moz-txt-link-rfc2396E" href="mailto:dri-devel@lists.freedesktop.org"><dri-devel@lists.freedesktop.org></a>; amd-gfx mailing
list <a class="moz-txt-link-rfc2396E" href="mailto:amd-gfx@lists.freedesktop.org"><amd-gfx@lists.freedesktop.org></a><br>
<b>Subject:</b> Re: [PATCH 11/11] drm/amdgpu: stop
removing BOs from the LRU during CS<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">[CAUTION: External Email] <o:p></o:p></p>
<div>
<div>
<div>
<div>
<p class="MsoNormal">This series fixes the OOM errors.
However, if I torture the kernel driver more, I can
get it to deadlock and end up with unkillable
processes. I can also get an OOM error. I just ran the
test 5 times:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">AMD_DEBUG=testgdsmm glxgears &
AMD_DEBUG=testgdsmm glxgears & AMD_DEBUG=testgdsmm
glxgears & AMD_DEBUG=testgdsmm glxgears &
AMD_DEBUG=testgdsmm glxgears<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Marek<o:p></o:p></p>
</div>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Tue, May 14, 2019 at 8:31 AM
Christian König <<a
href="mailto:ckoenig.leichtzumerken@gmail.com"
moz-do-not-send="true">ckoenig.leichtzumerken@gmail.com</a>>
wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC
1.0pt;padding:0in 0in 0in
6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">This avoids OOM situations when we
have lots of threads<br>
submitting at the same time.<br>
<br>
Signed-off-by: Christian König <<a
href="mailto:christian.koenig@amd.com" target="_blank"
moz-do-not-send="true">christian.koenig@amd.com</a>><br>
---<br>
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 +-<br>
1 file changed, 1 insertion(+), 1 deletion(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c<br>
index fff558cf385b..f9240a94217b 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c<br>
@@ -648,7 +648,7 @@ static int
amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,<br>
}<br>
<br>
r = ttm_eu_reserve_buffers(&p->ticket,
&p->validated, true,<br>
- &duplicates,
true);<br>
+ &duplicates,
false);<br>
if (unlikely(r != 0)) {<br>
if (r != -ERESTARTSYS)<br>
DRM_ERROR("ttm_eu_reserve_buffers failed.\n");<br>
-- <br>
2.17.1<br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
<a href="mailto:amd-gfx@lists.freedesktop.org"
target="_blank" moz-do-not-send="true">amd-gfx@lists.freedesktop.org</a><br>
<a
href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx"
target="_blank" moz-do-not-send="true">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><o:p></o:p></p>
</blockquote>
</div>
</div>
</div>
</blockquote>
<br>
</body>
</html>