vm_create_anonymous_area(): Allocate the page run for B_CONTIGUOUS areas

before locking the address space. That gives us a bit more flexibility in
vm_page_allocate_page_run().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36486 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2010-04-26 13:28:05 +00:00
parent fd49f4844b
commit c1b8ab4ef0
1 changed files with 14 additions and 14 deletions

View File

@ -1174,20 +1174,6 @@ vm_create_anonymous_area(team_id team, const char* name, void** address,
vm_page_reserve_pages(&reservation, reservedPages, priority);
}
// Lock the address space and, if B_EXACT_ADDRESS and
// CREATE_AREA_UNMAP_ADDRESS_RANGE were specified, ensure the address range
// is not wired.
do {
status = locker.SetTo(team);
if (status != B_OK)
goto err0;
addressSpace = locker.AddressSpace();
} while (addressSpec == B_EXACT_ADDRESS
&& (flags & CREATE_AREA_UNMAP_ADDRESS_RANGE) != 0
&& wait_if_address_range_is_wired(addressSpace, (addr_t)*address, size,
&locker));
if (wiring == B_CONTIGUOUS) {
// we try to allocate the page run here upfront as this may easily
// fail for obvious reasons
@ -1199,6 +1185,20 @@ vm_create_anonymous_area(team_id team, const char* name, void** address,
}
}
// Lock the address space and, if B_EXACT_ADDRESS and
// CREATE_AREA_UNMAP_ADDRESS_RANGE were specified, ensure the address range
// is not wired.
do {
status = locker.SetTo(team);
if (status != B_OK)
goto err1;
addressSpace = locker.AddressSpace();
} while (addressSpec == B_EXACT_ADDRESS
&& (flags & CREATE_AREA_UNMAP_ADDRESS_RANGE) != 0
&& wait_if_address_range_is_wired(addressSpace, (addr_t)*address, size,
&locker));
// create an anonymous cache
// if it's a stack, make sure that two pages are available at least
guardPages = isStack ? ((protection & B_USER_PROTECTION) != 0