summaryrefslogtreecommitdiffstats
path: root/sys/boot/alpha/common
diff options
context:
space:
mode:
authormsmith <msmith@FreeBSD.org>1998-11-02 23:28:11 +0000
committermsmith <msmith@FreeBSD.org>1998-11-02 23:28:11 +0000
commit7ff854a690d0b1907eb91aa8563be0d65545984d (patch)
tree4b5368009c1e11ed85475d58f2f379071897c96a /sys/boot/alpha/common
parent459dfe3332e2fac684dc0f5ce1af023d9101c0b0 (diff)
downloadFreeBSD-src-7ff854a690d0b1907eb91aa8563be0d65545984d.zip
FreeBSD-src-7ff854a690d0b1907eb91aa8563be0d65545984d.tar.gz
Implement a simple LRU block cache. By default this is initialised to 16k,
and will bypass transfers for more than 8k. Blocks are invalidated after 2 seconds, so removable media should not confuse the cache. The 8k threshold is a compromise; all UFS transfers performed by libstand are 8k or less, so large file reads thrash the cache. However many filesystem metadata operations are also performed using 8k blocks, so using a lower threshold gives poor performance. Those of you with an eye for cache algorithms are welcome to tell me how badly this one sucks; you can start with the 'bcachestats' command which will print the contents of the cache and access statistics.
Diffstat (limited to 'sys/boot/alpha/common')
-rw-r--r--sys/boot/alpha/common/main.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/boot/alpha/common/main.c b/sys/boot/alpha/common/main.c
index 2776b08..4140024 100644
--- a/sys/boot/alpha/common/main.c
+++ b/sys/boot/alpha/common/main.c
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: main.c,v 1.7 1998/10/24 00:31:21 msmith Exp $
+ * $Id: main.c,v 1.8 1998/10/31 17:12:32 dfr Exp $
*/
@@ -142,6 +142,11 @@ main(void)
OSFpal();
/*
+ * Initialise the block cache
+ */
+ bcache_init(32, 512); /* 16k XXX tune this */
+
+ /*
* March through the device switch probing for things.
*/
for (i = 0; devsw[i] != NULL; i++)
OpenPOWER on IntegriCloud