diff options
author | jeff <jeff@FreeBSD.org> | 2003-01-21 05:44:52 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2003-01-21 05:44:52 +0000 |
commit | 18309dfabebe791e296990abe7d558eba82724a8 (patch) | |
tree | 0787f6c8182982ce13ac9a14af60a5cbecd9e481 /sys/ia64 | |
parent | a56a74e4b68be38fa9402c627c60820dce36a399 (diff) | |
download | FreeBSD-src-18309dfabebe791e296990abe7d558eba82724a8.zip FreeBSD-src-18309dfabebe791e296990abe7d558eba82724a8.tar.gz |
- Add a VM_WAIT in the appropriate cases where vm_page_alloc() fails and flags
indicate that uma_small_alloc should not. This code should be refactored so
that there is not so much cross arch duplication.
Reviewed by: jake
Spotted by: tmm
Tested on: alpha, sparc64
Pointy hat to: jeff and everyone who cut and pasted the bad code. :-)
Diffstat (limited to 'sys/ia64')
-rw-r--r-- | sys/ia64/ia64/pmap.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/sys/ia64/ia64/pmap.c b/sys/ia64/ia64/pmap.c index 1ffef00..13a42b6 100644 --- a/sys/ia64/ia64/pmap.c +++ b/sys/ia64/ia64/pmap.c @@ -488,14 +488,22 @@ uma_small_alloc(uma_zone_t zone, int bytes, u_int8_t *flags, int wait) pflags = VM_ALLOC_SYSTEM; if (wait & M_ZERO) pflags |= VM_ALLOC_ZERO; - m = vm_page_alloc(NULL, color++, pflags | VM_ALLOC_NOOBJ); - if (m) { - va = (void *)IA64_PHYS_TO_RR7(VM_PAGE_TO_PHYS(m)); - if ((m->flags & PG_ZERO) == 0) - bzero(va, PAGE_SIZE); - return (va); + + for (;;) { + m = vm_page_alloc(NULL, color++, pflags | VM_ALLOC_NOOBJ); + if (m == NULL) { + if (wait & M_NOWAIT) + return (NULL); + else + VM_WAIT; + } else + break; } - return (NULL); + + va = (void *)IA64_PHYS_TO_RR7(VM_PAGE_TO_PHYS(m)); + if ((m->flags & PG_ZERO) == 0) + bzero(va, PAGE_SIZE); + return (va); } void |