This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
dev_size = 2048 * 1024 * 1024 # 1T | |
block_size = 2048 * 1 | |
nr_blocks = dev_size / block_size | |
io_size = 128 | |
#---------------------------------------------------------------- | |
def calc_cows(n, nr_blocks) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef CONTAINER_H | |
#define CONTAINER_H | |
/*----------------------------------------------------------------*/ | |
struct container; | |
/* | |
* The container presents a 64bit address space. The client decides where | |
* data goes in this address space. This address space is virtual and |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef THIN_SCRIPT_PROGRAM_H | |
#define THIN_SCRIPT_PROGRAM_H | |
static struct instruction provision_code[] = { | |
{i_quiesce}, | |
{i_alloc_block}, | |
{i_dup, {.u = 1}}, | |
{i_cmp, {.u = 0}}, | |
{i_branch_if, {.u = 100}}, | |
{i_dup, {.u = 1}}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def mk_hash(multiplier, shift, nr_buckets): | |
def hash(n): | |
h1 = (n * multiplier) >> (2 + shift) | |
h2 = h1 >> shift | |
return (h1 ^ h2) % nr_buckets | |
return hash | |
def run_test(hash_fn, nr_buckets, stride): |