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
F115144886: D13595.id.diff
Sun, Apr 20, 9:54 PM
Unknown Object (File)
Tue, Mar 25, 4:59 AM
Unknown Object (File)
Feb 21 2025, 7:29 AM
Unknown Object (File)
Feb 20 2025, 2:14 AM
Unknown Object (File)
Feb 17 2025, 5:23 AM
Unknown Object (File)
Feb 17 2025, 3:49 AM
Unknown Object (File)
Jan 23 2025, 3:20 AM
Unknown Object (File)
Dec 12 2024, 4:34 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.)