From c48a3f33ba7aa257248afd95ea073cc8ab935ec3 Mon Sep 17 00:00:00 2001 From: beck Date: Tue, 18 Apr 2017 13:41:32 +0000 Subject: [PATCH] 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 --- sys/kern/vfs_bio.c | 10 +++++++--- 1 file 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 * -- 2.20.1