Private resident count in procstat(1)

From: Arka Sharma <arka.sw1988_at_gmail.com>
Date: Mon, 18 Jul 2022 07:00:59 UTC
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