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)
Fri, Dec 27, 7:19 PM
Unknown Object (File)
Sat, Dec 21, 8:46 AM
Unknown Object (File)
Sat, Dec 21, 7:56 AM
Unknown Object (File)
Sat, Dec 21, 6:15 AM
Unknown Object (File)
Fri, Dec 13, 3:42 AM
Unknown Object (File)
Thu, Dec 5, 7:16 AM
Unknown Object (File)
Nov 29 2024, 7:06 PM
Unknown Object (File)
Nov 29 2024, 6:28 AM
Subscribers

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 20090
Build 19588: arc lint + arc unit

Event Timeline

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

sys/vm/memguard.c
315

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

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

302

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

336

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

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

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.