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)
Wed, Nov 13, 12:13 AM
Unknown Object (File)
Sep 17 2024, 6:11 PM
Unknown Object (File)
Sep 7 2024, 3:07 AM
Unknown Object (File)
Sep 5 2024, 5:17 AM
Unknown Object (File)
Sep 4 2024, 4:54 AM
Unknown Object (File)
Aug 21 2024, 11:49 PM
Unknown Object (File)
Aug 21 2024, 5:32 PM
Unknown Object (File)
Aug 19 2024, 6:47 AM
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 19850
Build 19380: 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
1145

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
1145

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. :(