diff options
author | Bob Beck <beck@cvs.openbsd.org> | 2019-05-09 20:36:45 +0000 |
---|---|---|
committer | Bob Beck <beck@cvs.openbsd.org> | 2019-05-09 20:36:45 +0000 |
commit | 69bab805ea49d83b4d1735ddb52a138daefbf0d8 (patch) | |
tree | eef1eb7674a7921032771e4aef0ff9147b16148c /sys/kern | |
parent | 981fa52553b64e69aacd11d8358fc3540f1492d2 (diff) |
Ensure that pagedaemon wakeups as a result of failed UVM_PLA_NOWAIT
allocations will recover some memory from the dma_constraint range.
The allocation still fails, the intent is to ensure that the
pagedaemon will free some memory to possibly allow a subsequent
allocation to succeed.
This also adds a UVM_PLA_NOWAKE flag to allow special cases in the
buffer cache to not wake up the pagedaemon until they want to.
ok kettenis@
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/vfs_biomem.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/vfs_biomem.c b/sys/kern/vfs_biomem.c index 0f761c976c2..8bdd583fe58 100644 --- a/sys/kern/vfs_biomem.c +++ b/sys/kern/vfs_biomem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_biomem.c,v 1.40 2019/05/08 12:40:57 beck Exp $ */ +/* $OpenBSD: vfs_biomem.c,v 1.41 2019/05/09 20:36:44 beck Exp $ */ /* * Copyright (c) 2007 Artur Grabowski <art@openbsd.org> @@ -288,7 +288,7 @@ buf_alloc_pages(struct buf *bp, vsize_t size) */ do { i = uvm_pagealloc_multi(buf_object, offs, size, - UVM_PLA_NOWAIT); + UVM_PLA_NOWAIT | UVM_PLA_NOWAKE); if (i == 0) break; } while (bufbackoff(&dma_constraint, size) == 0); @@ -359,7 +359,7 @@ buf_realloc_pages(struct buf *bp, struct uvm_constraint_range *where, do { r = uvm_pagerealloc_multi(bp->b_pobj, bp->b_poffs, - bp->b_bufsize, UVM_PLA_NOWAIT, where); + bp->b_bufsize, UVM_PLA_NOWAIT | UVM_PLA_NOWAKE, where); if (r == 0) break; } while ((bufbackoff(where, atop(bp->b_bufsize)) == 0)); |