<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<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:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
code
        {mso-style-priority:99;
        font-family:"Courier New";}
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.EmailStyle22
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;
        mso-ligatures:none;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
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]-->
</head>
<body lang="EN-IN" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> Ghimiray, Himal Prasad <himal.prasad.ghimiray@intel.com>
<br>
<b>Sent:</b> Wednesday, September 6, 2023 3:18 PM<br>
<b>To:</b> Upadhyay, Tejas <tejas.upadhyay@intel.com>; intel-xe@lists.freedesktop.org<br>
<b>Cc:</b> Iddamsetty, Aravind <aravind.iddamsetty@intel.com><br>
<b>Subject:</b> Re: [PATCH 4/7] drm/xe: Record each drm client with its VM<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 31-08-2023 14:35, Tejas Upadhyay wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre>Enable accounting of indirect client memory usage.<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>Signed-off-by: Tejas Upadhyay <a href="mailto:tejas.upadhyay@intel.com"><tejas.upadhyay@intel.com></a><o:p></o:p></pre>
<pre>---<o:p></o:p></pre>
<pre> drivers/gpu/drm/xe/xe_vm.c       | 1 +<o:p></o:p></pre>
<pre> drivers/gpu/drm/xe/xe_vm_types.h | 2 ++<o:p></o:p></pre>
<pre> 2 files changed, 3 insertions(+)<o:p></o:p></pre>
<pre><o:p> </o:p></pre>
<pre>diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c<o:p></o:p></pre>
<pre>index 9cbf2f63d641..f5f832c8ed42 100644<o:p></o:p></pre>
<pre>--- a/drivers/gpu/drm/xe/xe_vm.c<o:p></o:p></pre>
<pre>+++ b/drivers/gpu/drm/xe/xe_vm.c<o:p></o:p></pre>
<pre>@@ -2057,6 +2057,7 @@ int xe_vm_create_ioctl(struct drm_device *dev, void *data,<o:p></o:p></pre>
<pre>        }<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre>        args->vm_id = id;<o:p></o:p></pre>
<pre>+       vm->xef = xef;<o:p></o:p></pre>
</blockquote>
<p class="MsoNormal">shouldn't it be applicable only if <code><span style="font-size:10.0pt">CONFIG_PROC_FS is enabled ?
<o:p></o:p></span></code></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Tracking VM is not dependent on proc fs so it does not give relation.  Adding bo and FDINFO read/parse is only dependent on procfs otherwise dummy calls. So I do not think it is necessary. Please let me know if you think otherwise.<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">Tejas <o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre><o:p> </o:p></pre>
<pre> <o:p></o:p></pre>
<pre> #if IS_ENABLED(CONFIG_DRM_XE_DEBUG_MEM)<o:p></o:p></pre>
<pre>        /* Warning: Security issue - never enable by default */<o:p></o:p></pre>
<pre>diff --git a/drivers/gpu/drm/xe/xe_vm_types.h b/drivers/gpu/drm/xe/xe_vm_types.h<o:p></o:p></pre>
<pre>index fd2178dbde3a..db8523d81d0f 100644<o:p></o:p></pre>
<pre>--- a/drivers/gpu/drm/xe/xe_vm_types.h<o:p></o:p></pre>
<pre>+++ b/drivers/gpu/drm/xe/xe_vm_types.h<o:p></o:p></pre>
<pre>@@ -336,6 +336,8 @@ struct xe_vm {<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre>        /** @batch_invalidate_tlb: Always invalidate TLB before batch start */<o:p></o:p></pre>
<pre>        bool batch_invalidate_tlb;<o:p></o:p></pre>
<pre>+       /** @xef: XE file handle for tracking this VM's drm client */<o:p></o:p></pre>
<pre>+       struct xe_file *xef;<o:p></o:p></pre>
</blockquote>
<p class="MsoNormal">Same comment as above.<br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre><o:p> </o:p></pre>
<pre> };<o:p></o:p></pre>
<pre> <o:p></o:p></pre>
<pre> /** struct xe_vma_op_map - VMA map operation */<o:p></o:p></pre>
</blockquote>
</div>
</div>
</body>
</html>