From 480d8bea2b81e74b79c4eacaebee47564179ac0a Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 14 Feb 2025 09:20:04 -0500 Subject: [PATCH] zink: put zink_program::reference on separate cacheline Part-of: --- src/gallium/drivers/zink/zink_program.c | 6 +++--- src/gallium/drivers/zink/zink_types.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/zink/zink_program.c b/src/gallium/drivers/zink/zink_program.c index 50283159584..91b701a6d45 100644 --- a/src/gallium/drivers/zink/zink_program.c +++ b/src/gallium/drivers/zink/zink_program.c @@ -994,7 +994,7 @@ zink_pipeline_layout_create(struct zink_screen *screen, VkDescriptorSetLayout *d static void * create_program(struct zink_context *ctx, bool is_compute) { - struct zink_program *pg = rzalloc_size(NULL, is_compute ? sizeof(struct zink_compute_program) : sizeof(struct zink_gfx_program)); + struct zink_program *pg = is_compute ? (void*)CALLOC_STRUCT_CL(zink_compute_program) : (void*)CALLOC_STRUCT_CL(zink_gfx_program); if (!pg) return NULL; @@ -1690,7 +1690,7 @@ zink_destroy_gfx_program(struct zink_screen *screen, zink_gfx_lib_cache_unref(screen, prog->libs); ralloc_free(prog->base.ralloc_ctx); - ralloc_free(prog); + FREE_CL(prog); } void @@ -1717,7 +1717,7 @@ zink_destroy_compute_program(struct zink_screen *screen, zink_destroy_shader_module(screen, comp->module); ralloc_free(comp->base.ralloc_ctx); - ralloc_free(comp); + FREE_CL(comp); } ALWAYS_INLINE static bool diff --git a/src/gallium/drivers/zink/zink_types.h b/src/gallium/drivers/zink/zink_types.h index b41bbf605e9..c9599552319 100644 --- a/src/gallium/drivers/zink/zink_types.h +++ b/src/gallium/drivers/zink/zink_types.h @@ -993,7 +993,7 @@ struct zink_shader_module { }; struct zink_program { - struct pipe_reference reference; + EXCLUSIVE_CACHELINE(struct pipe_reference reference); struct zink_context *ctx; void *ralloc_ctx; blake3_hash blake3;