Thus spake Matthew Dillon <[EMAIL PROTECTED]>:
>     It's not possible to get a wholely accurate count no matter what
>     you do.  For example, to truely know whether a process is using
>     a page you have to run through the process's page table (PMAP),
>     access the vm_page, then locate where in the shadow chain the VM object
>     the vm_page belongs to resides.  But since hardware page tables are
>     throw-away, the system could very well have thrown away whole page
>     tables so this method is no more accurate then any other.

Thanks for the explanations!  I still don't understand why this
doesn't work, assuming you don't care about nonresident pages:

for each process p in the set
        for each map entry e in p->vmspace->vm_map
                for each page m in e->object.vm_object->memq
                        if I haven't seen this m.phys_addr yet in the scan
                                resident_pages++

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to