From 52305f0514d29e7fb2cb5e2154188e09faa3fe94 Mon Sep 17 00:00:00 2001 From: Nicolin Chen Date: Mon, 13 Aug 2018 20:22:56 -0700 Subject: gpu: nvgpu: Reduce structure padding waste The gk20a_init_fifo_setup_sw_common() function allocates memory of schannel_gk20a and tsg_gk20a tructures for all 512 channels: Size Caller Module Pages Type 749568 __nvgpu_vzalloc+0x28/0x78 [nvgpu] pages=182 vmalloc 602112 __nvgpu_vzalloc+0x28/0x78 [nvgpu] pages=146 vmalloc This change just simply reorgnizes the member defines in those two structures to reduce padding waste. After this change: Size Caller Module Pages Type 733184 __nvgpu_vzalloc+0x28/0x78 [nvgpu] pages=178 vmalloc 585728 __nvgpu_vzalloc+0x28/0x78 [nvgpu] pages=142 vmalloc In summary, it saves 8 pages in 32KB memory. Bug 2327574 Bug 2284925 Change-Id: I06693e0fef516a145b48dd3a05d756c0feaf3ba5 Signed-off-by: Nicolin Chen Reviewed-on: https://git-master.nvidia.com/r/1803358 Reviewed-by: svc-misra-checker Reviewed-by: svccoveritychecker GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/gr_gk20a.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/gr_gk20a.h') diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h index a60f6f12..3fc7e55f 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h @@ -453,7 +453,6 @@ struct nvgpu_gr_ctx { u32 graphics_preempt_mode; u32 compute_preempt_mode; - bool boosted_ctx; struct nvgpu_mem preempt_ctxsw_buffer; struct nvgpu_mem spill_ctxsw_buffer; @@ -462,11 +461,12 @@ struct nvgpu_gr_ctx { u32 ctx_id; bool ctx_id_valid; bool cilp_preempt_pending; + bool boosted_ctx; + bool golden_img_loaded; #ifdef CONFIG_TEGRA_GR_VIRTUALIZATION u64 virt_ctx; #endif - bool golden_img_loaded; struct patch_desc patch_ctx; struct zcull_ctx_desc zcull_ctx; -- cgit v1.2.2