Page MenuHomeFreeBSD

Initialize kernel pmap resident_count and resident_wired.
ClosedPublic

Authored by markj on Sep 27 2018, 3:41 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 12 2024, 7:08 PM
Unknown Object (File)
Jan 12 2024, 5:45 PM
Unknown Object (File)
Dec 23 2023, 6:08 AM
Unknown Object (File)
Sep 21 2023, 5:36 PM
Unknown Object (File)
Sep 11 2023, 4:51 AM
Unknown Object (File)
Sep 4 2023, 11:20 PM
Unknown Object (File)
Sep 3 2023, 2:08 PM
Unknown Object (File)
Jul 11 2023, 3:26 PM
Subscribers

Details

Summary

kmem_bootstrap_free() may decrement these stats, and this occasionally
causes panics in INVARIANTS kernels when the resident count underflows.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 19843
Build 19374: arc lint + arc unit

Event Timeline

kib added inline comments.
sys/amd64/amd64/pmap.c
1123

You can remove this blank line as well.

This revision is now accepted and ready to land.Sep 27 2018, 4:20 PM
markj marked an inline comment as done.
  • Remove blank line.
This revision now requires review to proceed.Sep 27 2018, 4:29 PM

My recollection is that we do not set the wired bit in any of the page table entries created by create_pagetables() so we could wind up with a wired mapping count that exceeds the resident count.

In D17340#369770, @alc wrote:

My recollection is that we do not set the wired bit in any of the page table entries created by create_pagetables() so we could wind up with a wired mapping count that exceeds the resident count.

You're right. I was thinking of the page table pages.

  • Only initialize resident_count.

Alan, did you have any other comments on this?

alc added inline comments.
sys/amd64/amd64/pmap.c
1146

I would provide some motivation: "... resident in case any of this data is later unmapped (using pmap_remove()) and freed."

This revision is now accepted and ready to land.Oct 1 2018, 4:33 AM
This revision was automatically updated to reflect the committed changes.
markj marked an inline comment as done.Oct 1 2018, 2:48 PM
markj added inline comments.
sys/amd64/amd64/pmap.c
1146

Sorry, I accidentally committed a stale version of the patch. Will fix. I also remembered after committing that we need the same change on i386. :(