]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commit
gpu: nvgpu: implement sync refcounting
authorDeepak Nibade <dnibade@nvidia.com>
Mon, 18 Apr 2016 10:16:10 +0000 (15:46 +0530)
committermobile promotions <svcmobile_promotions@nvidia.com>
Fri, 6 May 2016 15:58:02 +0000 (08:58 -0700)
commit8305f6c223d3583de6249091f16cbadd4db3f2da
tree23913b5a10aef10c1d6f4f094c746b34e2df765c
parent9b3e4bf9a829fb328a1700ab94428193f9a0b378
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
(cherry picked from commit e0c9da1fe9d8862fc89773208aa170b7c73d093b)
Reviewed-on: http://git-master/r/1139541
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
drivers/gpu/nvgpu/gk20a/channel_gk20a.c
drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c
drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.h
drivers/gpu/nvgpu/vgpu/fifo_vgpu.c