Date: Mon, 18 Jul 2022 12:30:59 +0530 From: Arka Sharma <arka.sw1988@gmail.com> To: freebsd-hackers@freebsd.org Subject: Private resident count in procstat(1) Message-ID: <CAPO=kN0CT1EJJ6JCzE_0N-edzX72fG4=k0EujiSPBWBpNmLrGA@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] Hi All, I tracked the PRES field and observed that 'kve->kve_private_resident' is the count of vm_page contained by vm_object if the vm_map entry doesn't contain a shadow object. My question is why this field is called private resident as I understand the underlying vm_object will also contain pages which correspond to other map entries for the same process, and for shared mapping it could be referenced by map entries with other process as well. For the RES field my understanding is, it is the sum of pages of shadow objects and the tail of the object chain for the range of the given map entry and we also have 'ki_rssize' which is 'pm_stats.resident_count' plus the sum of kernel stack pages of the threads. Is there a situation the RES value will be greater than 'ki_rssize' ? Please correct me if above understanding is wrong. Regards, Arka [-- Attachment #2 --] <div dir="ltr">Hi All,<div><br></div><div>I tracked the PRES field and observed that '<span style="font-family:Consolas,"Courier New",monospace;font-size:14px;white-space:pre;color:rgb(0,16,128)">kve</span><span style="color:rgb(0,0,0);font-family:Consolas,"Courier New",monospace;font-size:14px;white-space:pre">-></span><span style="font-family:Consolas,"Courier New",monospace;font-size:14px;white-space:pre;color:rgb(0,16,128)">kve_private_resident</span>' is the count of vm_page contained by vm_object if the vm_map entry doesn't contain a shadow object. My question is why this field is called private resident as I understand the underlying vm_object will also contain pages which correspond to other map entries for the same process, and for shared mapping it could be referenced by map entries with other process as well. </div><div><br></div><div>For the RES field my understanding is, it is the sum of pages of shadow objects and the tail of the object chain for the range of the given map entry and we also have '<span style="color:rgb(0,16,128);font-family:Consolas,"Courier New",monospace;font-size:14px;white-space:pre">ki_rssize</span>' which is '<span style="font-family:Consolas,"Courier New",monospace;font-size:14px;white-space:pre;color:rgb(0,16,128)">pm_stats</span><span style="font-family:Consolas,"Courier New",monospace;font-size:14px;white-space:pre;color:rgb(0,0,255)">.</span><span style="font-family:Consolas,"Courier New",monospace;font-size:14px;white-space:pre;color:rgb(0,16,128)">resident_count</span>' plus the sum of kernel stack pages of the threads. Is there a situation the RES value will be greater than '<span style="color:rgb(0,16,128);font-family:Consolas,"Courier New",monospace;font-size:14px;white-space:pre">ki_rssize</span>' ?</div><div><br></div><div>Please correct me if above understanding is wrong.</div><div><br></div><div>Regards,</div><div>Arka</div></div>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAPO=kN0CT1EJJ6JCzE_0N-edzX72fG4=k0EujiSPBWBpNmLrGA>
