|
|
|
|
@@ -5,6 +5,7 @@
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include <sys/mman.h>
|
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
|
|
#define ARR_LEN(ARR) sizeof(ARR) / sizeof(*ARR)
|
|
|
|
|
@@ -47,6 +48,8 @@ extern "C" void read_32x2_simd_offset(char *buffer, u64 size);
|
|
|
|
|
extern "C" void read_32x2_simd_no_offset(char *buffer, u64 size);
|
|
|
|
|
extern "C" void read_16x4_simd(char *buffer, u64 size);
|
|
|
|
|
extern "C" void read_32x4_simd(char *buffer, u64 size);
|
|
|
|
|
extern "C" void cache_test(char *buffer, u64 size, u64 mask);
|
|
|
|
|
extern "C" void cache_test_unaligned(char *buffer, u64 size, u64 mask);
|
|
|
|
|
|
|
|
|
|
void test_fread(reptester *tester, alloc_type type);
|
|
|
|
|
void test_read(reptester *tester, alloc_type type);
|
|
|
|
|
@@ -89,6 +92,23 @@ void test_read_32x2_simd_offset(reptester *tester, alloc_type type);
|
|
|
|
|
void test_read_32x2_simd_no_offset(reptester *tester, alloc_type type);
|
|
|
|
|
void test_read_16x4_simd(reptester *tester, alloc_type type);
|
|
|
|
|
void test_read_32x4_simd(reptester *tester, alloc_type type);
|
|
|
|
|
void test_cache_test_16k(reptester *tester, alloc_type type);
|
|
|
|
|
void test_cache_test_16k_unaligned(reptester *tester, alloc_type type);
|
|
|
|
|
void test_cache_test_32k(reptester *tester, alloc_type type);
|
|
|
|
|
void test_cache_test_32k_unaligned(reptester *tester, alloc_type type);
|
|
|
|
|
void test_cache_test_64k(reptester *tester, alloc_type type);
|
|
|
|
|
void test_cache_test_128k(reptester *tester, alloc_type type);
|
|
|
|
|
void test_cache_test_256k(reptester *tester, alloc_type type);
|
|
|
|
|
void test_cache_test_512k(reptester *tester, alloc_type type);
|
|
|
|
|
void test_cache_test_1m(reptester *tester, alloc_type type);
|
|
|
|
|
void test_cache_test_2m(reptester *tester, alloc_type type);
|
|
|
|
|
void test_cache_test_4m(reptester *tester, alloc_type type);
|
|
|
|
|
void test_cache_test_8m(reptester *tester, alloc_type type);
|
|
|
|
|
void test_cache_test_16m(reptester *tester, alloc_type type);
|
|
|
|
|
void test_cache_test_32m(reptester *tester, alloc_type type);
|
|
|
|
|
void test_cache_test_64m(reptester *tester, alloc_type type);
|
|
|
|
|
void test_cache_test_512m(reptester *tester, alloc_type type);
|
|
|
|
|
void test_cache_test_full(reptester *tester, alloc_type type);
|
|
|
|
|
u64 get_file_length(FILE *fp);
|
|
|
|
|
|
|
|
|
|
int main(int argc, char *argv[]) {
|
|
|
|
|
@@ -182,22 +202,58 @@ int main(int argc, char *argv[]) {
|
|
|
|
|
// {{"READ 2x2", "READ 2x2 WITH MALLOC"}, test_read_2x2},
|
|
|
|
|
// {{"READ 4x2", "READ 4x2 WITH MALLOC"}, test_read_4x2},
|
|
|
|
|
// {{"READ 8x2", "READ 8x2 WITH MALLOC"}, test_read_8x2},
|
|
|
|
|
{{"READ 4x2_simd", "READ 4x2_simd WITH MALLOC"}, test_read_4x2_simd},
|
|
|
|
|
{{"READ 8x2_simd", "READ 8x2_simd WITH MALLOC"}, test_read_8x2_simd},
|
|
|
|
|
{{"READ 16x2_simd", "READ 16x2_simd WITH MALLOC"}, test_read_16x2_simd},
|
|
|
|
|
{{"READ 32x2_simd_offset", "READ 32x2_simd_offset WITH MALLOC"},
|
|
|
|
|
test_read_32x2_simd_offset},
|
|
|
|
|
{{"READ 32x2_simd_no_offset", "READ 32x2_simd_no_offset WITH MALLOC"},
|
|
|
|
|
test_read_32x2_simd_no_offset},
|
|
|
|
|
{{"READ 16x4_simd", "READ 16x4_simd WITH MALLOC"}, test_read_16x4_simd},
|
|
|
|
|
{{"READ 32x4_simd", "READ 32x4_simd WITH MALLOC"}, test_read_32x4_simd},
|
|
|
|
|
// {{"READ 4x2_simd", "READ 4x2_simd WITH MALLOC"}, test_read_4x2_simd},
|
|
|
|
|
// {{"READ 8x2_simd", "READ 8x2_simd WITH MALLOC"}, test_read_8x2_simd},
|
|
|
|
|
// {{"READ 16x2_simd", "READ 16x2_simd WITH MALLOC"},
|
|
|
|
|
// test_read_16x2_simd},
|
|
|
|
|
// {{"READ 32x2_simd_offset", "READ 32x2_simd_offset WITH MALLOC"},
|
|
|
|
|
// test_read_32x2_simd_offset},
|
|
|
|
|
// {{"READ 32x2_simd_no_offset", "READ 32x2_simd_no_offset WITH MALLOC"},
|
|
|
|
|
// test_read_32x2_simd_no_offset},
|
|
|
|
|
// {{"READ 16x4_simd", "READ 16x4_simd WITH MALLOC"},
|
|
|
|
|
// test_read_16x4_simd},
|
|
|
|
|
// {{"READ 32x4_simd", "READ 32x4_simd WITH MALLOC"},
|
|
|
|
|
// test_read_32x4_simd},
|
|
|
|
|
{{"CACHE TEST 16K", "CACHE TEST 16K WITH MALLOC"}, test_cache_test_16k},
|
|
|
|
|
{{"CACHE TEST 16K UNALIGNED", "CACHE TEST 16K UNALIGNED WITH MALLOC"},
|
|
|
|
|
test_cache_test_16k_unaligned},
|
|
|
|
|
// {{"CACHE TEST 32K", "CACHE TEST 32K WITH MALLOC"},
|
|
|
|
|
// test_cache_test_32k},
|
|
|
|
|
// {{"CACHE TEST 64K", "CACHE TEST 64K WITH MALLOC"},
|
|
|
|
|
// test_cache_test_64k},
|
|
|
|
|
// {{"CACHE TEST 128K", "CACHE TEST 128K WITH MALLOC"},
|
|
|
|
|
// test_cache_test_128k},
|
|
|
|
|
// {{"CACHE TEST 256K", "CACHE TEST 256K WITH MALLOC"},
|
|
|
|
|
// test_cache_test_256k},
|
|
|
|
|
// {{"CACHE TEST 512K", "CACHE TEST 512K WITH MALLOC"},
|
|
|
|
|
// test_cache_test_512k},
|
|
|
|
|
// {{"CACHE TEST 1M", "CACHE TEST 1M WITH MALLOC"}, test_cache_test_1m},
|
|
|
|
|
// {{"CACHE TEST 2M", "CACHE TEST 2M WITH MALLOC"}, test_cache_test_2m},
|
|
|
|
|
// {{"CACHE TEST 4M", "CACHE TEST 4M WITH MALLOC"}, test_cache_test_4m},
|
|
|
|
|
// {{"CACHE TEST 8M", "CACHE TEST 8M WITH MALLOC"}, test_cache_test_8m},
|
|
|
|
|
// {{"CACHE TEST 16M", "CACHE TEST 16M WITH MALLOC"},
|
|
|
|
|
// test_cache_test_16m},
|
|
|
|
|
// {{"CACHE TEST 32M", "CACHE TEST 32M WITH MALLOC"},
|
|
|
|
|
// test_cache_test_32m},
|
|
|
|
|
// {{"CACHE TEST 64M", "CACHE TEST 64M WITH MALLOC"},
|
|
|
|
|
// test_cache_test_64m},
|
|
|
|
|
// {{"CACHE TEST 512M", "CACHE TEST 512M WITH MALLOC"},
|
|
|
|
|
// test_cache_test_512m},
|
|
|
|
|
// {{"CACHE TEST FULL", "CACHE TEST FULL WITH MALLOC"},
|
|
|
|
|
// test_cache_test_full},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
tester.params.read_size = get_file_length(fp);
|
|
|
|
|
tester.params.read_count = 1;
|
|
|
|
|
tester.params.buffer = (char *)malloc(tester.params.read_size + 1);
|
|
|
|
|
tester.params.buffer =
|
|
|
|
|
(char *)mmap(NULL, tester.params.read_size + 1, PROT_READ | PROT_WRITE,
|
|
|
|
|
MAP_ANON | MAP_SHARED | MAP_NORESERVE, -1, 0);
|
|
|
|
|
memset(tester.params.buffer, 0, tester.params.read_size + 1);
|
|
|
|
|
|
|
|
|
|
for (u64 i = 0; i < tester.params.read_size; ++i) {
|
|
|
|
|
tester.params.buffer[i] = (char)i;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (u64 i = 0; i < waves; ++i) {
|
|
|
|
|
for (u64 j = 0; j < ARR_LEN(funcs); ++j) {
|
|
|
|
|
for (u64 k = 0; k < ALLOC_TYPE_WITH_MALLOC; ++k) {
|
|
|
|
|
@@ -208,7 +264,7 @@ int main(int argc, char *argv[]) {
|
|
|
|
|
|
|
|
|
|
fclose(fp);
|
|
|
|
|
|
|
|
|
|
free(tester.params.buffer);
|
|
|
|
|
munmap(tester.params.buffer, tester.params.read_size + 1);
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
@@ -586,7 +642,6 @@ void test_align63_loop(reptester *tester, alloc_type type) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void test_align75_loop(reptester *tester, alloc_type type) {
|
|
|
|
|
|
|
|
|
|
u64 start = read_cpu_timer();
|
|
|
|
|
u64 fault_count_start = page_fault_count();
|
|
|
|
|
|
|
|
|
|
@@ -612,7 +667,6 @@ void test_align75_loop(reptester *tester, alloc_type type) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void test_align90_loop(reptester *tester, alloc_type type) {
|
|
|
|
|
|
|
|
|
|
u64 start = read_cpu_timer();
|
|
|
|
|
u64 fault_count_start = page_fault_count();
|
|
|
|
|
|
|
|
|
|
@@ -1112,7 +1166,6 @@ void test_read_4x2_simd(reptester *tester, alloc_type type) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void test_read_8x2_simd(reptester *tester, alloc_type type) {
|
|
|
|
|
|
|
|
|
|
u64 start = read_cpu_timer();
|
|
|
|
|
u64 fault_count_start = page_fault_count();
|
|
|
|
|
|
|
|
|
|
@@ -1138,7 +1191,6 @@ void test_read_8x2_simd(reptester *tester, alloc_type type) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void test_read_16x2_simd(reptester *tester, alloc_type type) {
|
|
|
|
|
|
|
|
|
|
u64 start = read_cpu_timer();
|
|
|
|
|
u64 fault_count_start = page_fault_count();
|
|
|
|
|
|
|
|
|
|
@@ -1264,6 +1316,431 @@ void test_read_32x4_simd(reptester *tester, alloc_type type) {
|
|
|
|
|
handle_free(tester, type);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void test_cache_test_16k(reptester *tester, alloc_type type) {
|
|
|
|
|
u64 start = read_cpu_timer();
|
|
|
|
|
u64 fault_count_start = page_fault_count();
|
|
|
|
|
|
|
|
|
|
handle_alloc(tester, type);
|
|
|
|
|
|
|
|
|
|
u64 total_size = tester->params.read_size * tester->params.read_count;
|
|
|
|
|
|
|
|
|
|
cache_test(tester->params.buffer, total_size, 0x3fff);
|
|
|
|
|
|
|
|
|
|
u64 fault_count_end = page_fault_count();
|
|
|
|
|
u64 end = read_cpu_timer();
|
|
|
|
|
|
|
|
|
|
u64 read_time = end - start;
|
|
|
|
|
u64 page_faults = fault_count_end - fault_count_start;
|
|
|
|
|
|
|
|
|
|
tester->results = {
|
|
|
|
|
total_size,
|
|
|
|
|
read_time,
|
|
|
|
|
page_faults,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
handle_free(tester, type);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void test_cache_test_16k_unaligned(reptester *tester, alloc_type type) {
|
|
|
|
|
u64 start = read_cpu_timer();
|
|
|
|
|
u64 fault_count_start = page_fault_count();
|
|
|
|
|
|
|
|
|
|
handle_alloc(tester, type);
|
|
|
|
|
|
|
|
|
|
u64 total_size = tester->params.read_size * tester->params.read_count;
|
|
|
|
|
|
|
|
|
|
cache_test_unaligned(tester->params.buffer, total_size, 0x3fff);
|
|
|
|
|
|
|
|
|
|
u64 fault_count_end = page_fault_count();
|
|
|
|
|
u64 end = read_cpu_timer();
|
|
|
|
|
|
|
|
|
|
u64 read_time = end - start;
|
|
|
|
|
u64 page_faults = fault_count_end - fault_count_start;
|
|
|
|
|
|
|
|
|
|
tester->results = {
|
|
|
|
|
total_size,
|
|
|
|
|
read_time,
|
|
|
|
|
page_faults,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
handle_free(tester, type);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void test_cache_test_32k(reptester *tester, alloc_type type) {
|
|
|
|
|
u64 start = read_cpu_timer();
|
|
|
|
|
u64 fault_count_start = page_fault_count();
|
|
|
|
|
|
|
|
|
|
handle_alloc(tester, type);
|
|
|
|
|
|
|
|
|
|
u64 total_size = tester->params.read_size * tester->params.read_count;
|
|
|
|
|
|
|
|
|
|
cache_test(tester->params.buffer, total_size, 0x7fff);
|
|
|
|
|
|
|
|
|
|
u64 fault_count_end = page_fault_count();
|
|
|
|
|
u64 end = read_cpu_timer();
|
|
|
|
|
|
|
|
|
|
u64 read_time = end - start;
|
|
|
|
|
u64 page_faults = fault_count_end - fault_count_start;
|
|
|
|
|
|
|
|
|
|
tester->results = {
|
|
|
|
|
total_size,
|
|
|
|
|
read_time,
|
|
|
|
|
page_faults,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
handle_free(tester, type);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void test_cache_test_32k_unaligned(reptester *tester, alloc_type type) {
|
|
|
|
|
u64 start = read_cpu_timer();
|
|
|
|
|
u64 fault_count_start = page_fault_count();
|
|
|
|
|
|
|
|
|
|
handle_alloc(tester, type);
|
|
|
|
|
|
|
|
|
|
u64 total_size = tester->params.read_size * tester->params.read_count;
|
|
|
|
|
|
|
|
|
|
cache_test_unaligned(tester->params.buffer, total_size, 0x7fff);
|
|
|
|
|
|
|
|
|
|
u64 fault_count_end = page_fault_count();
|
|
|
|
|
u64 end = read_cpu_timer();
|
|
|
|
|
|
|
|
|
|
u64 read_time = end - start;
|
|
|
|
|
u64 page_faults = fault_count_end - fault_count_start;
|
|
|
|
|
|
|
|
|
|
tester->results = {
|
|
|
|
|
total_size,
|
|
|
|
|
read_time,
|
|
|
|
|
page_faults,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
handle_free(tester, type);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void test_cache_test_64k(reptester *tester, alloc_type type) {
|
|
|
|
|
u64 start = read_cpu_timer();
|
|
|
|
|
u64 fault_count_start = page_fault_count();
|
|
|
|
|
|
|
|
|
|
handle_alloc(tester, type);
|
|
|
|
|
|
|
|
|
|
u64 total_size = tester->params.read_size * tester->params.read_count;
|
|
|
|
|
|
|
|
|
|
cache_test(tester->params.buffer, total_size, 0xffff);
|
|
|
|
|
|
|
|
|
|
u64 fault_count_end = page_fault_count();
|
|
|
|
|
u64 end = read_cpu_timer();
|
|
|
|
|
|
|
|
|
|
u64 read_time = end - start;
|
|
|
|
|
u64 page_faults = fault_count_end - fault_count_start;
|
|
|
|
|
|
|
|
|
|
tester->results = {
|
|
|
|
|
total_size,
|
|
|
|
|
read_time,
|
|
|
|
|
page_faults,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
handle_free(tester, type);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void test_cache_test_128k(reptester *tester, alloc_type type) {
|
|
|
|
|
u64 start = read_cpu_timer();
|
|
|
|
|
u64 fault_count_start = page_fault_count();
|
|
|
|
|
|
|
|
|
|
handle_alloc(tester, type);
|
|
|
|
|
|
|
|
|
|
u64 total_size = tester->params.read_size * tester->params.read_count;
|
|
|
|
|
|
|
|
|
|
cache_test(tester->params.buffer, total_size, 0x1ffff);
|
|
|
|
|
|
|
|
|
|
u64 fault_count_end = page_fault_count();
|
|
|
|
|
u64 end = read_cpu_timer();
|
|
|
|
|
|
|
|
|
|
u64 read_time = end - start;
|
|
|
|
|
u64 page_faults = fault_count_end - fault_count_start;
|
|
|
|
|
|
|
|
|
|
tester->results = {
|
|
|
|
|
total_size,
|
|
|
|
|
read_time,
|
|
|
|
|
page_faults,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
handle_free(tester, type);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void test_cache_test_256k(reptester *tester, alloc_type type) {
|
|
|
|
|
u64 start = read_cpu_timer();
|
|
|
|
|
u64 fault_count_start = page_fault_count();
|
|
|
|
|
|
|
|
|
|
handle_alloc(tester, type);
|
|
|
|
|
|
|
|
|
|
u64 total_size = tester->params.read_size * tester->params.read_count;
|
|
|
|
|
|
|
|
|
|
cache_test(tester->params.buffer, total_size, 0x3ffff);
|
|
|
|
|
|
|
|
|
|
u64 fault_count_end = page_fault_count();
|
|
|
|
|
u64 end = read_cpu_timer();
|
|
|
|
|
|
|
|
|
|
u64 read_time = end - start;
|
|
|
|
|
u64 page_faults = fault_count_end - fault_count_start;
|
|
|
|
|
|
|
|
|
|
tester->results = {
|
|
|
|
|
total_size,
|
|
|
|
|
read_time,
|
|
|
|
|
page_faults,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
handle_free(tester, type);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void test_cache_test_512k(reptester *tester, alloc_type type) {
|
|
|
|
|
u64 start = read_cpu_timer();
|
|
|
|
|
u64 fault_count_start = page_fault_count();
|
|
|
|
|
|
|
|
|
|
handle_alloc(tester, type);
|
|
|
|
|
|
|
|
|
|
u64 total_size = tester->params.read_size * tester->params.read_count;
|
|
|
|
|
|
|
|
|
|
cache_test(tester->params.buffer, total_size, 0x7ffff);
|
|
|
|
|
|
|
|
|
|
u64 fault_count_end = page_fault_count();
|
|
|
|
|
u64 end = read_cpu_timer();
|
|
|
|
|
|
|
|
|
|
u64 read_time = end - start;
|
|
|
|
|
u64 page_faults = fault_count_end - fault_count_start;
|
|
|
|
|
|
|
|
|
|
tester->results = {
|
|
|
|
|
total_size,
|
|
|
|
|
read_time,
|
|
|
|
|
page_faults,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
handle_free(tester, type);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void test_cache_test_1m(reptester *tester, alloc_type type) {
|
|
|
|
|
u64 start = read_cpu_timer();
|
|
|
|
|
u64 fault_count_start = page_fault_count();
|
|
|
|
|
|
|
|
|
|
handle_alloc(tester, type);
|
|
|
|
|
|
|
|
|
|
u64 total_size = tester->params.read_size * tester->params.read_count;
|
|
|
|
|
|
|
|
|
|
cache_test(tester->params.buffer, total_size, 0xfffff);
|
|
|
|
|
|
|
|
|
|
u64 fault_count_end = page_fault_count();
|
|
|
|
|
u64 end = read_cpu_timer();
|
|
|
|
|
|
|
|
|
|
u64 read_time = end - start;
|
|
|
|
|
u64 page_faults = fault_count_end - fault_count_start;
|
|
|
|
|
|
|
|
|
|
tester->results = {
|
|
|
|
|
total_size,
|
|
|
|
|
read_time,
|
|
|
|
|
page_faults,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
handle_free(tester, type);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void test_cache_test_2m(reptester *tester, alloc_type type) {
|
|
|
|
|
u64 start = read_cpu_timer();
|
|
|
|
|
u64 fault_count_start = page_fault_count();
|
|
|
|
|
|
|
|
|
|
handle_alloc(tester, type);
|
|
|
|
|
|
|
|
|
|
u64 total_size = tester->params.read_size * tester->params.read_count;
|
|
|
|
|
|
|
|
|
|
cache_test(tester->params.buffer, total_size, 0x1fffff);
|
|
|
|
|
|
|
|
|
|
u64 fault_count_end = page_fault_count();
|
|
|
|
|
u64 end = read_cpu_timer();
|
|
|
|
|
|
|
|
|
|
u64 read_time = end - start;
|
|
|
|
|
u64 page_faults = fault_count_end - fault_count_start;
|
|
|
|
|
|
|
|
|
|
tester->results = {
|
|
|
|
|
total_size,
|
|
|
|
|
read_time,
|
|
|
|
|
page_faults,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
handle_free(tester, type);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void test_cache_test_4m(reptester *tester, alloc_type type) {
|
|
|
|
|
u64 start = read_cpu_timer();
|
|
|
|
|
u64 fault_count_start = page_fault_count();
|
|
|
|
|
|
|
|
|
|
handle_alloc(tester, type);
|
|
|
|
|
|
|
|
|
|
u64 total_size = tester->params.read_size * tester->params.read_count;
|
|
|
|
|
|
|
|
|
|
cache_test(tester->params.buffer, total_size, 0x3fffff);
|
|
|
|
|
|
|
|
|
|
u64 fault_count_end = page_fault_count();
|
|
|
|
|
u64 end = read_cpu_timer();
|
|
|
|
|
|
|
|
|
|
u64 read_time = end - start;
|
|
|
|
|
u64 page_faults = fault_count_end - fault_count_start;
|
|
|
|
|
|
|
|
|
|
tester->results = {
|
|
|
|
|
total_size,
|
|
|
|
|
read_time,
|
|
|
|
|
page_faults,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
handle_free(tester, type);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void test_cache_test_8m(reptester *tester, alloc_type type) {
|
|
|
|
|
u64 start = read_cpu_timer();
|
|
|
|
|
u64 fault_count_start = page_fault_count();
|
|
|
|
|
|
|
|
|
|
handle_alloc(tester, type);
|
|
|
|
|
|
|
|
|
|
u64 total_size = tester->params.read_size * tester->params.read_count;
|
|
|
|
|
|
|
|
|
|
cache_test(tester->params.buffer, total_size, 0x7fffff);
|
|
|
|
|
|
|
|
|
|
u64 fault_count_end = page_fault_count();
|
|
|
|
|
u64 end = read_cpu_timer();
|
|
|
|
|
|
|
|
|
|
u64 read_time = end - start;
|
|
|
|
|
u64 page_faults = fault_count_end - fault_count_start;
|
|
|
|
|
|
|
|
|
|
tester->results = {
|
|
|
|
|
total_size,
|
|
|
|
|
read_time,
|
|
|
|
|
page_faults,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
handle_free(tester, type);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void test_cache_test_16m(reptester *tester, alloc_type type) {
|
|
|
|
|
u64 start = read_cpu_timer();
|
|
|
|
|
u64 fault_count_start = page_fault_count();
|
|
|
|
|
|
|
|
|
|
handle_alloc(tester, type);
|
|
|
|
|
|
|
|
|
|
u64 total_size = tester->params.read_size * tester->params.read_count;
|
|
|
|
|
|
|
|
|
|
cache_test(tester->params.buffer, total_size, 0xffffff);
|
|
|
|
|
|
|
|
|
|
u64 fault_count_end = page_fault_count();
|
|
|
|
|
u64 end = read_cpu_timer();
|
|
|
|
|
|
|
|
|
|
u64 read_time = end - start;
|
|
|
|
|
u64 page_faults = fault_count_end - fault_count_start;
|
|
|
|
|
|
|
|
|
|
tester->results = {
|
|
|
|
|
total_size,
|
|
|
|
|
read_time,
|
|
|
|
|
page_faults,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
handle_free(tester, type);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void test_cache_test_32m(reptester *tester, alloc_type type) {
|
|
|
|
|
u64 start = read_cpu_timer();
|
|
|
|
|
u64 fault_count_start = page_fault_count();
|
|
|
|
|
|
|
|
|
|
handle_alloc(tester, type);
|
|
|
|
|
|
|
|
|
|
u64 total_size = tester->params.read_size * tester->params.read_count;
|
|
|
|
|
|
|
|
|
|
cache_test(tester->params.buffer, total_size, 0x1ffffff);
|
|
|
|
|
|
|
|
|
|
u64 fault_count_end = page_fault_count();
|
|
|
|
|
u64 end = read_cpu_timer();
|
|
|
|
|
|
|
|
|
|
u64 read_time = end - start;
|
|
|
|
|
u64 page_faults = fault_count_end - fault_count_start;
|
|
|
|
|
|
|
|
|
|
tester->results = {
|
|
|
|
|
total_size,
|
|
|
|
|
read_time,
|
|
|
|
|
page_faults,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
handle_free(tester, type);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void test_cache_test_64m(reptester *tester, alloc_type type) {
|
|
|
|
|
u64 start = read_cpu_timer();
|
|
|
|
|
u64 fault_count_start = page_fault_count();
|
|
|
|
|
|
|
|
|
|
handle_alloc(tester, type);
|
|
|
|
|
|
|
|
|
|
u64 total_size = tester->params.read_size * tester->params.read_count;
|
|
|
|
|
|
|
|
|
|
cache_test(tester->params.buffer, total_size, 0x3ffffff);
|
|
|
|
|
|
|
|
|
|
u64 fault_count_end = page_fault_count();
|
|
|
|
|
u64 end = read_cpu_timer();
|
|
|
|
|
|
|
|
|
|
u64 read_time = end - start;
|
|
|
|
|
u64 page_faults = fault_count_end - fault_count_start;
|
|
|
|
|
|
|
|
|
|
tester->results = {
|
|
|
|
|
total_size,
|
|
|
|
|
read_time,
|
|
|
|
|
page_faults,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
handle_free(tester, type);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void test_cache_test_512m(reptester *tester, alloc_type type) {
|
|
|
|
|
u64 start = read_cpu_timer();
|
|
|
|
|
u64 fault_count_start = page_fault_count();
|
|
|
|
|
|
|
|
|
|
handle_alloc(tester, type);
|
|
|
|
|
|
|
|
|
|
u64 total_size = tester->params.read_size * tester->params.read_count;
|
|
|
|
|
|
|
|
|
|
cache_test(tester->params.buffer, total_size, 0x1fffffff);
|
|
|
|
|
|
|
|
|
|
u64 fault_count_end = page_fault_count();
|
|
|
|
|
u64 end = read_cpu_timer();
|
|
|
|
|
|
|
|
|
|
u64 read_time = end - start;
|
|
|
|
|
u64 page_faults = fault_count_end - fault_count_start;
|
|
|
|
|
|
|
|
|
|
tester->results = {
|
|
|
|
|
total_size,
|
|
|
|
|
read_time,
|
|
|
|
|
page_faults,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
handle_free(tester, type);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void test_cache_test_full(reptester *tester, alloc_type type) {
|
|
|
|
|
u64 start = read_cpu_timer();
|
|
|
|
|
u64 fault_count_start = page_fault_count();
|
|
|
|
|
|
|
|
|
|
handle_alloc(tester, type);
|
|
|
|
|
|
|
|
|
|
u64 total_size = tester->params.read_size * tester->params.read_count;
|
|
|
|
|
|
|
|
|
|
cache_test(tester->params.buffer, total_size, 0xffffffffffffffff);
|
|
|
|
|
|
|
|
|
|
u64 fault_count_end = page_fault_count();
|
|
|
|
|
u64 end = read_cpu_timer();
|
|
|
|
|
|
|
|
|
|
u64 read_time = end - start;
|
|
|
|
|
u64 page_faults = fault_count_end - fault_count_start;
|
|
|
|
|
|
|
|
|
|
tester->results = {
|
|
|
|
|
total_size,
|
|
|
|
|
read_time,
|
|
|
|
|
page_faults,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
handle_free(tester, type);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
u64 get_file_length(FILE *fp) {
|
|
|
|
|
if (!fp) {
|
|
|
|
|
return 0;
|