diff options
author | msmith <msmith@FreeBSD.org> | 1998-11-02 23:28:11 +0000 |
---|---|---|
committer | msmith <msmith@FreeBSD.org> | 1998-11-02 23:28:11 +0000 |
commit | 7ff854a690d0b1907eb91aa8563be0d65545984d (patch) | |
tree | 4b5368009c1e11ed85475d58f2f379071897c96a /sys/boot/common/bootstrap.h | |
parent | 459dfe3332e2fac684dc0f5ce1af023d9101c0b0 (diff) | |
download | FreeBSD-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/common/bootstrap.h')
-rw-r--r-- | sys/boot/common/bootstrap.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/boot/common/bootstrap.h b/sys/boot/common/bootstrap.h index 2eb1d80..a373e35 100644 --- a/sys/boot/common/bootstrap.h +++ b/sys/boot/common/bootstrap.h @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: bootstrap.h,v 1.14 1998/10/21 20:07:04 msmith Exp $ + * $Id: bootstrap.h,v 1.15 1998/10/22 20:20:50 msmith Exp $ */ #include <sys/types.h> @@ -72,6 +72,15 @@ extern size_t strlenout(vm_offset_t str); extern char *strdupout(vm_offset_t str); /* + * Disk block cache + */ +struct bcache_devdata +{ + int (*dv_strategy)(void *devdata, int rw, daddr_t blk, size_t size, void *buf, size_t *rsize); + void *dv_devdata; +}; + +/* * Modular console support. */ struct console |