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
Unknown Object (File)
Oct 16 2024, 3:15 AM
Unknown Object (File)
Oct 16 2024, 3:14 AM
Unknown Object (File)
Oct 16 2024, 3:14 AM
Unknown Object (File)
Oct 16 2024, 3:14 AM
Unknown Object (File)
Oct 16 2024, 2:52 AM
Unknown Object (File)
Sep 30 2024, 6:35 AM
Unknown Object (File)
Sep 18 2024, 2:12 PM
Unknown Object (File)
Sep 18 2024, 8:27 AM
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

Lint
Lint Skipped
Unit
Tests Skipped

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