summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/gk20a.h
diff options
context:
space:
mode:
authorPeter Pipkorn <ppipkorn@nvidia.com>2015-09-28 07:49:53 -0400
committerTerje Bergstrom <tbergstrom@nvidia.com>2016-01-11 12:04:01 -0500
commit2b064ce65e0035a860d1bc3bcccfcf8aac1f31c7 (patch)
tree1f20c0e608efcca51ef321d308df8e8cb059ad8c /drivers/gpu/nvgpu/gk20a/gk20a.h
parenta9c6f595399074e88c16f3557e5acb29db1d52d5 (diff)
gpu: nvgpu: add high priority channel interleave
Interleave all high priority channels between all other channels. This reduces the latency for high priority work when there are a lot of lower priority work present, imposing an upper bound on the latency. Change the default high priority timeslice from 5.2ms to 3.0 in the process, to prevent long running high priority apps from hogging the GPU too much. Introduce a new debugfs node to enable/disable high priority channel interleaving. It is currently enabled by default. Adds new runlist length max register, used for allocating suitable sized runlist. Limit the number of interleaved channels to 32. This change reduces the maximum time a lower priority job is running (one timeslice) before we check that high priority jobs are running. Tested with gles2_context_priority (still passes) Basic sanity testing is done with graphics_submit (one app is high priority) Also more functional testing using lots of parallel runs with: NVRM_GPU_CHANNEL_PRIORITY=3 ./gles2_expensive_draw –drawsperframe 20000 –triangles 50 –runtime 30 –finish plus multiple: NVRM_GPU_CHANNEL_PRIORITY=2 ./gles2_expensive_draw –drawsperframe 20000 –triangles 50 –runtime 30 -finish Previous to this change, the relative performance between high priority work and normal priority work comes down to timeslice value. This means that when there are many low priority channels, the high priority work will still drop quite a lot. But with this change, the high priority work will roughly get about half the entire GPU time, meaning that after the initial lower performance, it is less likely to get lower in performance due to more apps running on the system. This change makes a large step towards real priority levels. It is not perfect and there are no guarantees on anything, but it is a step forwards without any additional CPU overhead or other complications. It will also serve as a baseline to judge other algorithms against. Support for priorities with TSG is future work. Support for interleave mid + high priority channels, instead of just high, is also future work. Bug 1419900 Change-Id: I0f7d0ce83b6598fe86000577d72e14d312fdad98 Signed-off-by: Peter Pipkorn <ppipkorn@nvidia.com> Reviewed-on: http://git-master/r/805961 Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.h')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h
index f7b98e39..da115fa8 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.h
@@ -54,6 +54,8 @@ struct acr_gm20b;
54 32 ns is the resolution of ptimer. */ 54 32 ns is the resolution of ptimer. */
55#define PTIMER_REF_FREQ_HZ 31250000 55#define PTIMER_REF_FREQ_HZ 31250000
56 56
57#define MAX_INTERLEAVED_CHANNELS 32
58
57struct cooling_device_gk20a { 59struct cooling_device_gk20a {
58 struct thermal_cooling_device *gk20a_cooling_dev; 60 struct thermal_cooling_device *gk20a_cooling_dev;
59 unsigned int gk20a_freq_state; 61 unsigned int gk20a_freq_state;
@@ -512,6 +514,10 @@ struct gk20a {
512 u32 timeslice_low_priority_us; 514 u32 timeslice_low_priority_us;
513 u32 timeslice_medium_priority_us; 515 u32 timeslice_medium_priority_us;
514 u32 timeslice_high_priority_us; 516 u32 timeslice_high_priority_us;
517 u32 interleave_high_priority;
518
519 struct mutex interleave_lock;
520 u32 num_interleaved_channels;
515 521
516 bool slcg_enabled; 522 bool slcg_enabled;
517 bool blcg_enabled; 523 bool blcg_enabled;
@@ -533,9 +539,11 @@ struct gk20a {
533 struct dentry *debugfs_disable_bigpage; 539 struct dentry *debugfs_disable_bigpage;
534 struct dentry *debugfs_gr_default_attrib_cb_size; 540 struct dentry *debugfs_gr_default_attrib_cb_size;
535 541
536 struct dentry * debugfs_timeslice_low_priority_us; 542 struct dentry *debugfs_timeslice_low_priority_us;
537 struct dentry * debugfs_timeslice_medium_priority_us; 543 struct dentry *debugfs_timeslice_medium_priority_us;
538 struct dentry * debugfs_timeslice_high_priority_us; 544 struct dentry *debugfs_timeslice_high_priority_us;
545 struct dentry *debugfs_interleave_high_priority;
546
539#endif 547#endif
540 struct gk20a_ctxsw_ucode_info ctxsw_ucode_info; 548 struct gk20a_ctxsw_ucode_info ctxsw_ucode_info;
541 549