summaryrefslogtreecommitdiffstats
path: root/kmod/cachepc.c
diff options
context:
space:
mode:
authorLouis Burda <quent.burda@gmail.com>2022-08-13 20:05:27 +0200
committerLouis Burda <quent.burda@gmail.com>2022-08-13 20:05:27 +0200
commit476f6c892d90e66fbd17ba616b82b000a990f63e (patch)
tree268efc588158ded4bf88aec234d44baf9584473f /kmod/cachepc.c
parent0f3b9caf389b486541614836bf180b64544615cb (diff)
downloadcachepc-476f6c892d90e66fbd17ba616b82b000a990f63e.tar.gz
cachepc-476f6c892d90e66fbd17ba616b82b000a990f63e.zip
Add cache line ordering that prevents hardware prefetching, fix cachepc counts read
Diffstat (limited to 'kmod/cachepc.c')
-rwxr-xr-xkmod/cachepc.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/kmod/cachepc.c b/kmod/cachepc.c
index ed36ac7..9c896f3 100755
--- a/kmod/cachepc.c
+++ b/kmod/cachepc.c
@@ -46,8 +46,6 @@ cache_ctx *
cachepc_get_ctx(cache_level cache_level)
{
cache_ctx *ctx;
-
- // printk(KERN_WARNING "CachePC: Getting ctx..\n");
ctx = kzalloc(sizeof(cache_ctx), GFP_KERNEL);
BUG_ON(ctx == NULL);
@@ -72,8 +70,6 @@ cachepc_get_ctx(cache_level cache_level)
ctx->set_size = CACHELINE_SIZE * ctx->associativity;
ctx->cache_size = ctx->sets * ctx->set_size;
- // printk(KERN_WARNING "CachePC: Getting ctx done\n");
-
return ctx;
}
@@ -395,6 +391,7 @@ allocate_cache_ds(cache_ctx *ctx)
for (i = 0; i < ctx->nr_of_cachelines; ++i) {
cl_ptr_arr[i] = cl_arr + i;
cl_ptr_arr[i]->cache_set = get_virt_cache_set(ctx, cl_ptr_arr[i]);
+ cl_ptr_arr[i]->cache_line = i / ctx->sets;
}
return cl_ptr_arr;