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
F139414946: D13595.id37132.diff
Thu, Dec 11, 8:00 PM
Unknown Object (File)
Tue, Dec 9, 3:51 AM
Unknown Object (File)
Fri, Dec 5, 4:00 AM
Unknown Object (File)
Sun, Nov 30, 2:36 AM
Unknown Object (File)
Sat, Nov 22, 11:22 PM
Unknown Object (File)
Sat, Nov 22, 4:41 PM
Unknown Object (File)
Thu, Nov 20, 11:51 PM
Unknown Object (File)
Thu, Nov 20, 11:48 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 Skipped
Unit
Tests Skipped
Build Status
Buildable 13756

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 ↗(On Diff #37132)

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 ↗(On Diff #37132)

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 ↗(On Diff #37132)

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.)