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)
Dec 20 2023, 12:23 AM
Unknown Object (File)
Nov 23 2023, 12:27 AM
Unknown Object (File)
Nov 13 2023, 6:00 PM
Unknown Object (File)
Oct 19 2023, 11:27 PM
Unknown Object (File)
Sep 6 2023, 12:13 AM
Unknown Object (File)
Sep 6 2023, 12:12 AM
Unknown Object (File)
Sep 6 2023, 12:10 AM
Unknown Object (File)
Sep 6 2023, 12:10 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

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