summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorBob Beck <beck@cvs.openbsd.org>2017-04-18 13:41:33 +0000
committerBob Beck <beck@cvs.openbsd.org>2017-04-18 13:41:33 +0000
commit0abf541cb35a61bbd67f2e5fe3f2e70c195c9778 (patch)
tree48f3b9b74aee41344a00fd4f664d62d721a6b9d8 /sys/kern
parent90f6e7384a88f37e36497190ab37267db1fce2bf (diff)
ensure the buffer cache backs off all the way with the correct type
of memory, handling the fact that both queues are actually in dma space when not flipping buffers high
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/vfs_bio.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index 30d9c5eb4fc..95bc80bc0e6 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_bio.c,v 1.181 2017/04/16 14:25:42 beck Exp $ */
+/* $OpenBSD: vfs_bio.c,v 1.182 2017/04/18 13:41:32 beck Exp $ */
/* $NetBSD: vfs_bio.c,v 1.44 1996/06/11 11:15:36 pk Exp $ */
/*
@@ -1507,13 +1507,17 @@ bufcache_getcleanbuf_range(int start, int end, int discard)
struct buf *
bufcache_gethighcleanbuf(void)
{
- return bufcache_getcleanbuf_range(DMA_CACHE + 1, NUM_CACHES -1, 0);
+ if (!fliphigh)
+ return NULL;
+ return bufcache_getcleanbuf_range(DMA_CACHE + 1, NUM_CACHES - 1, 0);
}
struct buf *
bufcache_getdmacleanbuf(void)
{
- return bufcache_getcleanbuf_range(DMA_CACHE, DMA_CACHE, 0);
+ if (fliphigh)
+ return bufcache_getcleanbuf_range(DMA_CACHE, DMA_CACHE, 0);
+ return bufcache_getcleanbuf_range(DMA_CACHE, NUM_CACHES - 1, 0);
}
struct buf *