Page MenuHomeFreeBSD

Add a VM flag to prevent reclaim on a failed contig allocation
ClosedPublic

Authored by rstone on Jan 29 2021, 9:17 PM.
Tags
None
Referenced Files
F102215982: D28422.diff
Sat, Nov 9, 2:05 AM
Unknown Object (File)
Fri, Oct 25, 2:24 PM
Unknown Object (File)
Fri, Oct 25, 12:28 PM
Unknown Object (File)
Tue, Oct 22, 1:04 PM
Unknown Object (File)
Sep 25 2024, 1:53 AM
Unknown Object (File)
Sep 23 2024, 2:04 PM
Unknown Object (File)
Sep 23 2024, 2:04 PM
Unknown Object (File)
Sep 23 2024, 2:02 PM
Subscribers

Details

Summary

If a M_WAITOK contig alloc fails, the VM subsystem will try to
reclaim contiguous memory twice before actually failing the
request. On a system with 64GB of RAM I've observed this take
400-500ms before it finally gives up, and I believe that this
will only be worse on systems with even more memory.

In certain contexts this delay is extremely harmful, so add a flag
that will skip reclaim for allocation requests to allow those
paths to opt-out of doing an expensive reclaim.

Sponsored by: Dell Inc

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 36654
Build 33543: arc lint + arc unit

Event Timeline

sys/sys/malloc.h
55

I think it is time to use 8 digits for M_ constants. Or use the flags from low byte, they are available I believe.

sys/vm/vm_page.h
552

Doesn't the value conflict with VM_ALLOC_COUNT() ?

sys/vm/vm_page.h
552

Oh jeez, I didn't even notice. Should I take 0x04 as bit 2 is supposed to be free or do we need to do something else here?

sys/vm/vm_page.h
552

I would take 0x80 or 0x800.

Fix overflap between new flag and count field

Change the value of M_NORECLAIM to avoid the style issue

This revision is now accepted and ready to land.Feb 1 2021, 8:15 PM