diff options
author | Deepak Nibade <dnibade@nvidia.com> | 2016-04-18 06:16:10 -0400 |
---|---|---|
committer | Terje Bergstrom <tbergstrom@nvidia.com> | 2016-04-19 11:16:13 -0400 |
commit | e0c9da1fe9d8862fc89773208aa170b7c73d093b (patch) | |
tree | f9f0f9edbe7ae1c2f44285b0ce89385d18dc826a /drivers/gpu/nvgpu/vgpu | |
parent | 1c96bc6942cdae7f4e90563687da7d068aea90bc (diff) |
gpu: nvgpu: implement sync refcounting
We currently free sync when we find job list empty
If aggressive_sync is set to true, we try to free
sync during channel unbind() call
But we rarely free sync from channel_unbind() call
since freeing it when job list is empty is
aggressive enough
Hence remove sync free code from channel_unbind()
Implement refcounting for sync:
- get a refcount while submitting a job (and
allocate sync if it is not allocated already)
- put a refcount while freeing the job
- if refcount==0 and if aggressive_sync_destroy is
set, free the sync
- if aggressive_sync_destroy is not set, we will
free the sync during channel close time
Bug 200187553
Change-Id: I74e24adb15dc26a375ebca1fdd017b3ad6d57b61
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1120410
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/vgpu')
-rw-r--r-- | drivers/gpu/nvgpu/vgpu/fifo_vgpu.c | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c b/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c index 535de851..294581b9 100644 --- a/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/fifo_vgpu.c | |||
@@ -59,16 +59,6 @@ static void vgpu_channel_unbind(struct channel_gk20a *ch) | |||
59 | } | 59 | } |
60 | 60 | ||
61 | ch->bound = false; | 61 | ch->bound = false; |
62 | |||
63 | /* | ||
64 | * if we are agrressive then we can destroy the syncpt | ||
65 | * resource at this point | ||
66 | * if not, then it will be destroyed at channel_free() | ||
67 | */ | ||
68 | if (ch->sync && platform->aggressive_sync_destroy) { | ||
69 | ch->sync->destroy(ch->sync); | ||
70 | ch->sync = NULL; | ||
71 | } | ||
72 | } | 62 | } |
73 | 63 | ||
74 | static int vgpu_channel_alloc_inst(struct gk20a *g, struct channel_gk20a *ch) | 64 | static int vgpu_channel_alloc_inst(struct gk20a *g, struct channel_gk20a *ch) |