Page MenuHomeFreeBSD

Handle vm_phys returning NULL in vm_page_alloc()
Needs ReviewPublic

Authored by adrian on Apr 30 2015, 5:12 AM.

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 OK
Unit
No Unit 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.