<div dir="ltr"><div dir="ltr">On Fri, Aug 25, 2023 at 9:15 AM HAGIO KAZUHITO(萩尾 一仁) <<a href="mailto:k-hagio-ab@nec.com">k-hagio-ab@nec.com</a>> wrote:</div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
>>> -     if (!task_mm(task, TRUE))<br>
>>> +     if (!(addr = task_mm(task, TRUE)))<br>
>>> +             return;<br>
>>> +<br>
>>> +     if (!readmem(addr + OFFSET(mm_struct_mm_count), KVADDR, &mm_count,<br>
>>> +             sizeof(int), "mm_struct mm_count", RETURN_ON_ERROR))<br>
>>> +             return;<br>
<br>
tt->mm_struct is filled in task_mm(), I think we can use this:<br>
<br>
   mm_count = INT(tt->mm_struct + OFFSET(mm_struct_mm_count));<br>
<br>
The following code in get_task_mem_usage() also use this.<br></blockquote><div><br></div><div>Good idea. I will post v2 with this change later.</div><div><br></div><div>Thanks.</div><div>Lianbo</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Thanks,<br>
Kazu</blockquote></div></div>