Added some comments and fixed a typo.

This commit is contained in:
Jacek Galowicz 2012-09-15 18:20:31 +02:00
parent 93d9540785
commit 7743e4b9ab

View file

@ -188,7 +188,7 @@ static int svm_test(void *arg)
GET_B(i,j) = i+j;
}
kputs("Start sequentiell calculation...\n");
kputs("Start sequential calculation...\n");
start = rdtsc();
start = rdtsc();
@ -340,6 +340,7 @@ static int svm_bench(void *arg)
svm_barrier(svm_flags);
if (!RCCE_IAM) {
start = rdtsc();
// The pages are created by touching them for the first time.
for(i=0; i<size/sizeof(uint32_t); i+=PAGE_SIZE/sizeof(uint32_t))
array[i] = 0;
end = rdtsc();
@ -350,6 +351,9 @@ static int svm_bench(void *arg)
svm_barrier(svm_flags);
if (RCCE_IAM) {
start = rdtsc();
// Touching these pages from another core means moving them
// to another owner as well as mapping them in the other core's
// memory space.
for(i=0; i<size/sizeof(uint32_t); i+=PAGE_SIZE/sizeof(uint32_t))
array[i] = 1;
end = rdtsc();
@ -360,6 +364,8 @@ static int svm_bench(void *arg)
svm_barrier(svm_flags);
if (!RCCE_IAM) {
start = rdtsc();
// Touching the pages from the first core again only involves
// moving the pages without the need to map them again.
for(i=0; i<size/sizeof(uint32_t); i+=PAGE_SIZE/sizeof(uint32_t))
array[i] = 0;
end = rdtsc();
@ -453,6 +459,8 @@ static int measure_ctx_switch(void* arg)
for (i=0; i < REPS && stop == 0; i++) {
while(id == sid && stop == 0) {
t2 = rdtsc();
// Calling rdtsc that often it is better
// to serialize the calls in the pipeline.
cpuid(0,&a,&b,&c,&d);
}