Page MenuHomeFreeBSD

Reuse kern_proc_vmmap_resident() for procfs_map resident count.
ClosedPublic

Authored by kib on Dec 23 2017, 12:03 PM.
Tags
None
Referenced Files
F166439224: D13595.diff
Thu, Aug 13, 2:14 PM
F166434338: D13595.diff
Thu, Aug 13, 1:42 PM
F166434301: D13595.id37132.diff
Thu, Aug 13, 1:42 PM
F166434124: D13595.id36936.diff
Thu, Aug 13, 1:41 PM
Unknown Object (File)
Tue, Aug 11, 11:59 PM
Unknown Object (File)
Tue, Aug 11, 3:26 PM
Unknown Object (File)
Tue, Aug 11, 11:52 AM
Unknown Object (File)
Mon, Aug 10, 9:40 PM
Subscribers

Details

Summary

The existing algorithm in procfs_map() to calculate count of resident pages in an entry is too primitive, resulting in too long run time for large sparse mapping entries. Re-use the kern_proc_vmmap_resident() from kern_proc.c which only looks at the existing pages in the iterations.

Also, this makes procfs to honor kern.proc_vmmap_skip_resident_count, if user does not need this information.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

No objection from me, but I don't feel competent to review the patch.

This revision was not accepted when it landed; it landed in state Needs Review.Dec 28 2017, 1:16 PM
This revision was automatically updated to reflect the committed changes.
vangyzen added inline comments.
head/sys/kern/kern_proc.c
3142

Was this part added by accident? It doesn't seem related. It was added in the final revision of this review. I don't see any revert or discussion on svn-src-{all,head}.

head/sys/kern/kern_proc.c
3142

I think yes, it was accidental.

Other than that, I believe that chunk was written for a reason, i.e. I saw a real report of P_TOTAL_STOP leakage. Do you have some troubles caused by it ?

head/sys/kern/kern_proc.c
3142

It's not causing any trouble for me. I just stumbled across it and wanted to make sure you were aware of it. What to do is entirely your call. (It looks fine to me.)