コード例 #1
0
int
main(int argc, char *argv[])
{
	size_t newblocksize;
	int wss, cs, n = 0, p;

#define ITER 3
#define BLOCKS 200

	start(72);

	lmfs_setquiet(1);

	/* Can the cache handle differently sized blocks? */

	for(p = 1; p <= 3; p++) {
		/* Do not update curblocksize until the cache is flushed. */
		newblocksize = PAGE_SIZE*p;
		lmfs_set_blocksize(newblocksize);
		curblocksize = newblocksize;	/* now it's safe to update */
		lmfs_buf_pool(BLOCKS);
		if(dotest(curblocksize, BLOCKS, ITER)) e(n);
		n++;
	}
	
	/* Can the cache handle various combinations of the working set
	 * being larger and smaller than the cache?
	 */
	for(wss = 2; wss <= 3; wss++) {
		int wsblocks = 10*wss*wss*wss*wss*wss;
		for(cs = wsblocks/4; cs <= wsblocks*3; cs *= 1.5) {
			lmfs_set_blocksize(PAGE_SIZE);
			curblocksize = PAGE_SIZE;	/* same as above */
			lmfs_buf_pool(cs);
		        if(dotest(curblocksize, wsblocks, ITER)) e(n);
			n++;
		}
	}

	quit();

	return 0;
}
コード例 #2
0
ファイル: test72.c プロジェクト: AjeyBohare/minix
int
main(int argc, char *argv[])
{
	int wss, cs, n = 0, p;

#define ITER 3
#define BLOCKS 200

	start(72);

	lmfs_setquiet(1);

	/* Can the cache handle differently sized blocks? */

	for(p = 1; p <= 3; p++) {
		curblocksize = PAGE_SIZE*p;
		lmfs_set_blocksize(curblocksize, MYMAJOR);
		lmfs_buf_pool(BLOCKS);
		if(dotest(curblocksize, BLOCKS, ITER)) e(n);
		n++;
	}
	
	/* Can the cache handle various combinations of the working set
	 * being larger and smaller than the cache?
	 */
	for(wss = 2; wss <= 3; wss++) {
		int wsblocks = 10*wss*wss*wss*wss*wss;
		for(cs = wsblocks/4; cs <= wsblocks*3; cs *= 1.5) {
			curblocksize = PAGE_SIZE;
			lmfs_set_blocksize(curblocksize, MYMAJOR);
			lmfs_buf_pool(cs);
		        if(dotest(curblocksize, wsblocks, ITER)) e(n);
			n++;
		}
	}

	quit();

	return 0;
}