From 476f6c892d90e66fbd17ba616b82b000a990f63e Mon Sep 17 00:00:00 2001 From: Louis Burda Date: Sat, 13 Aug 2022 20:05:27 +0200 Subject: Add cache line ordering that prevents hardware prefetching, fix cachepc counts read --- kmod/cachepc.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'kmod/cachepc.c') 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; -- cgit v1.2.3-71-gd317