]> git.baikalelectronics.ru Git - kernel.git/commit
drm/nouveau/instmem/gk20a: fix race conditions
authorAlexandre Courbot <acourbot@nvidia.com>
Mon, 9 Nov 2015 07:37:53 +0000 (16:37 +0900)
committerBen Skeggs <bskeggs@redhat.com>
Mon, 11 Jan 2016 01:17:40 +0000 (11:17 +1000)
commitdd16efe4cc0ac9fc0e9ad021f7b361af11066661
treedf761423858cb9a629aedc7bbda0003d4b096633
parent8d62b16b3c192df7d37e7ddd4c0fd2469b32e3d0
drm/nouveau/instmem/gk20a: fix race conditions

The LRU list used for recycling CPU mappings was handling concurrency
very poorly. For instance, if an instobj was acquired twice before being
released once, it would end up into the LRU list even though there is
still a client accessing it.

This patch fixes this by properly counting how many clients are
currently using a given instobj.

While at it, we also raise errors when inconsistencies are detected, and
factorize some code.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nvkm/subdev/instmem/gk20a.c