Page MenuHomeFreeBSD

Use M_NEXTFIT in memguard.
ClosedPublic

Authored by markj on Sep 18 2018, 6:19 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 5, 3:52 AM
Unknown Object (File)
Thu, Oct 31, 4:07 PM
Unknown Object (File)
Wed, Oct 30, 3:47 AM
Unknown Object (File)
Oct 2 2024, 8:06 AM
Unknown Object (File)
Sep 30 2024, 4:57 PM
Unknown Object (File)
Sep 26 2024, 3:23 PM
Unknown Object (File)
Sep 26 2024, 3:23 PM
Unknown Object (File)
Sep 26 2024, 3:23 PM
Subscribers

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 20089
Build 19587: arc lint + arc unit

Event Timeline

My comments are not about this patch, but other issues with memguard.

sys/vm/memguard.c
317 ↗(On Diff #48182)

If guard pages are enabled, then this significantly overestimates the amount of physical memory being used.

Moreover, if guard pages are enabled, we should block the allocation of superpage reservations in kmem_back(), because the reservations can never be fully populated or mapped as superpages. (Do we really need unmapped guard pages given the "buffer zone" around the returned memory?)

This revision is now accepted and ready to land.Sep 22 2018, 9:40 PM

Don't fall back to vmem_xalloc(). Instead, factor out handling of
resource shortages into vmem_try_fetch() and use that if the nextfit
search fails. This way we ensure that the cursor is updated on all
M_NEXTFIT allocations, so the policy is applied strictly.

This revision now requires review to proceed.Oct 9 2018, 4:12 PM

Don't fall back to vmem_xalloc(). Instead, factor out handling of
resource shortages into vmem_try_fetch() and use that if the nextfit
search fails. This way we ensure that the cursor is updated on all
M_NEXTFIT allocations, so the policy is applied strictly.

Wrong review. I will update this review with the correct diff plus some
local modifications that I've made.

  • Remove some stale comments referencing the use of a vm_map to manage memguard KVA.
  • Reimplement the mapused sysctl so that we can see how much KVA is consumed at a given point in time.
sys/vm/memguard.c
205 ↗(On Diff #48937)

I would suggest: "... of kernel address space that is managed by a vmem arena."

302 ↗(On Diff #48937)

"... so that we use a consistent value throughout this function."

336 ↗(On Diff #48937)

As an aside, when do_guard is true, it would make sense to disable reservation-based allocation, since the guards will block promotion of the mapping.

markj marked 3 inline comments as done.
  • Address feedback.
sys/vm/memguard.c
336 ↗(On Diff #48937)

Hmm, do we have a mechanism to do that here?

  • Address feedback, this time uploading the correct diff.
alc marked an inline comment as done.
alc added inline comments.
sys/vm/memguard.c
336 ↗(On Diff #48937)

Not on an allocation-by-allocation basis, as opposed to the whole object.

This revision is now accepted and ready to land.Nov 25 2018, 6:20 PM
This revision was automatically updated to reflect the committed changes.