Page MenuHomeFreeBSD

Handle vm_phys returning NULL in vm_page_alloc()
Needs ReviewPublic

Authored by adrian on Apr 30 2015, 5:12 AM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 4 2024, 12:13 PM
Unknown Object (File)
Dec 20 2023, 3:49 AM
Unknown Object (File)
Nov 23 2023, 10:23 PM
Unknown Object (File)
Oct 22 2023, 2:24 PM
Unknown Object (File)
Oct 17 2023, 4:05 PM
Unknown Object (File)
Jul 30 2023, 12:39 AM
Unknown Object (File)
Jul 25 2023, 4:24 AM
Unknown Object (File)
Jun 20 2023, 11:50 PM
Subscribers

Details

Reviewers
kib
kmacy
alc
Group Reviewers
manpages
Summary

When using VM domains, it's possible that unbalanced VM domain memory pressure
(or even different sized memory domains) may lead to the global VM thresholds saying
there's memory, but vm_phys returning NULL. In this instance, a NULL page
is dereferenced, and things blow up.

This change has it return NULL, which prevents the system from crashing.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage

Event Timeline

adrian retitled this revision from to Handle vm_phys returning NULL in vm_page_alloc().
adrian updated this object.
adrian edited the test plan for this revision. (Show Details)
adrian added reviewers: alc, kmacy, kib.

Is this something that happens in the stock sources, or the situation to occur requires patches to limit allocation of a new page to the specific domain ? I think that if applied to the HEAD, it would defeat the KASSERT(m != NULL) right after the cited block, and break invariants.

I haven't triggered it in stock sources - this happens in my VM policy branch. There are some use cases where the memory must come from a particular domain, so VM phys memory allocation can get unbalanced.

I think that this change should be abandoned.