Fix issue noted by alc while reviewing r215938:

The current implementation of vm_page_alloc_freelist() does not handle
order > 0 correctly. Remove order parameter to the function and use it
only for order 0 pages.

Submitted by:	alc
This commit is contained in:
Jayachandran C. 2010-11-28 05:51:31 +00:00
parent 2a89829bde
commit aa54636620
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=215973
3 changed files with 5 additions and 5 deletions

View File

@ -1077,7 +1077,7 @@ pmap_alloc_pte_page(unsigned int index, int req)
{
vm_page_t m;
m = vm_page_alloc_freelist(VM_FREELIST_DIRECT, 0, req);
m = vm_page_alloc_freelist(VM_FREELIST_DIRECT, req);
if (m == NULL)
return (NULL);

View File

@ -1409,12 +1409,12 @@ vm_page_alloc_init(vm_page_t m)
/*
* vm_page_alloc_freelist:
*
* Allocate a page from the specified freelist with specified order.
* Allocate a page from the specified freelist.
* Only the ALLOC_CLASS values in req are honored, other request flags
* are ignored.
*/
vm_page_t
vm_page_alloc_freelist(int flind, int order, int req)
vm_page_alloc_freelist(int flind, int req)
{
struct vnode *drop;
vm_page_t m;
@ -1431,7 +1431,7 @@ vm_page_alloc_freelist(int flind, int order, int req)
cnt.v_free_count + cnt.v_cache_count > cnt.v_interrupt_free_min) ||
(page_req == VM_ALLOC_INTERRUPT &&
cnt.v_free_count + cnt.v_cache_count > 0)) {
m = vm_phys_alloc_freelist_pages(flind, VM_FREEPOOL_DIRECT, order);
m = vm_phys_alloc_freelist_pages(flind, VM_FREEPOOL_DIRECT, 0);
}
if (m == NULL) {
mtx_unlock(&vm_page_queue_free_mtx);

View File

@ -340,7 +340,7 @@ void vm_pageq_remove(vm_page_t m);
void vm_page_activate (vm_page_t);
vm_page_t vm_page_alloc (vm_object_t, vm_pindex_t, int);
vm_page_t vm_page_alloc_freelist(int, int, int);
vm_page_t vm_page_alloc_freelist(int, int);
struct vnode *vm_page_alloc_init(vm_page_t);
vm_page_t vm_page_grab (vm_object_t, vm_pindex_t, int);
void vm_page_cache(vm_page_t);