1 /* Test 71 - full hierachy storage test.
3 * Black box test of storage: test consistent file contents
4 * under various working sets and access patterns.
6 * Using varying working set sizes, exercise various cache
9 * There is a 'smoke test' mode, suitable for running interactively,
10 * and a 'regression test' (big) mode, meant for batch invocation only
11 * as it takes very long.
14 #include <sys/types.h>
15 #include <sys/ioc_memory.h>
24 #include "testcache.h"
27 dowriteblock(int b
, int blocksize
, u32_t seed
, char *data
)
32 get_fd_offset(b
, blocksize
, &offset
, &fd
);
34 if(pwrite(fd
, data
, blocksize
, offset
) < blocksize
) {
43 readblock(int b
, int blocksize
, u32_t seed
, char *data
)
48 get_fd_offset(b
, blocksize
, &offset
, &fd
);
50 if(pread(fd
, data
, blocksize
, offset
) < blocksize
) {
58 void testend(void) { }
61 main(int argc
, char *argv
[])
72 /* Try various combinations working set sizes
73 * and block sizes in order to specifically
74 * target the primary cache, then primary+secondary
75 * cache, then primary+secondary cache+secondary
79 if(dotest(PAGE_SIZE
, 100, iter
)) e(5);
80 if(dotest(PAGE_SIZE
*2, 100, iter
)) e(2);
81 if(dotest(PAGE_SIZE
*3, 100, iter
)) e(3);
82 if(dotest(PAGE_SIZE
, 20000, iter
)) e(5);
85 u32_t totalmem
, freemem
, cachedmem
;
86 if(dotest(PAGE_SIZE
, 150000, iter
)) e(5);
87 getmem(&totalmem
, &freemem
, &cachedmem
);
88 if(dotest(PAGE_SIZE
, totalmem
*1.5, iter
)) e(6);