summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/tsg_gk20a.h
diff options
context:
space:
mode:
authorNicolin Chen <nicolinc@nvidia.com>2018-08-13 23:22:56 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-08-22 20:33:42 -0400
commit52305f0514d29e7fb2cb5e2154188e09faa3fe94 (patch)
treef5b50db358366692188e008ee2303dc5135e65ea /drivers/gpu/nvgpu/gk20a/tsg_gk20a.h
parentd5473e225decc74f0d6bb015d06365dad15828d0 (diff)
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 <nicolinc@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1803358 Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com> Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/tsg_gk20a.h')
-rw-r--r--drivers/gpu/nvgpu/gk20a/tsg_gk20a.h19
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/tsg_gk20a.h b/drivers/gpu/nvgpu/gk20a/tsg_gk20a.h
index 2f76477f..552c3bb3 100644
--- a/drivers/gpu/nvgpu/gk20a/tsg_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/tsg_gk20a.h
@@ -42,34 +42,33 @@ struct tsg_gk20a *tsg_gk20a_from_ch(struct channel_gk20a *ch);
42struct tsg_gk20a { 42struct tsg_gk20a {
43 struct gk20a *g; 43 struct gk20a *g;
44 44
45 bool in_use; 45 struct vm_gk20a *vm;
46 int tsgid; 46 struct nvgpu_mem *eng_method_buffers;
47
47 48
49 struct nvgpu_gr_ctx gr_ctx;
48 struct nvgpu_ref refcount; 50 struct nvgpu_ref refcount;
49 51
50 struct nvgpu_list_node ch_list; 52 struct nvgpu_list_node ch_list;
51 int num_active_channels; 53 struct nvgpu_list_node event_id_list;
52 struct nvgpu_rwsem ch_list_lock; 54 struct nvgpu_rwsem ch_list_lock;
55 struct nvgpu_mutex event_id_list_lock;
56 int num_active_channels;
53 57
54 unsigned int timeslice_us; 58 unsigned int timeslice_us;
55 unsigned int timeslice_timeout; 59 unsigned int timeslice_timeout;
56 unsigned int timeslice_scale; 60 unsigned int timeslice_scale;
57 61
58 struct vm_gk20a *vm;
59
60 u32 interleave_level; 62 u32 interleave_level;
61 63 int tsgid;
62 struct nvgpu_list_node event_id_list;
63 struct nvgpu_mutex event_id_list_lock;
64 64
65 u32 runlist_id; 65 u32 runlist_id;
66 pid_t tgid; 66 pid_t tgid;
67 struct nvgpu_mem *eng_method_buffers;
68 u32 num_active_tpcs; 67 u32 num_active_tpcs;
69 u8 tpc_pg_enabled; 68 u8 tpc_pg_enabled;
70 bool tpc_num_initialized; 69 bool tpc_num_initialized;
70 bool in_use;
71 71
72 struct nvgpu_gr_ctx gr_ctx;
73}; 72};
74 73
75int gk20a_enable_tsg(struct tsg_gk20a *tsg); 74int gk20a_enable_tsg(struct tsg_gk20a *tsg);