diff options
author | Xianzhong <b07117@freescale.com> | 2014-06-06 02:00:38 +0800 |
---|---|---|
committer | Xianzhong <b07117@freescale.com> | 2014-06-06 02:33:28 +0800 |
commit | ba7cdcf3b6723bd1630ec5cd5a061292e0d1807e (patch) | |
tree | b29c45e13b90666b5cbae292c073c02bac5b1a1f | |
parent | 96aa8b7af5f43853b1afdf23426ccf4c3c2241c7 (diff) |
ENGR00316978 [#1162] force_sig crash in GPU lower memory killer
it is caused when multiple thread try to kill same one process,
the global semaphore is used to avoid this conflict.
Date: Jun 05, 2014
Signed-off-by: Xianzhong <b07117@freescale.com>
Acked-by: Jason Liu
-rw-r--r-- | drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c index ae7ca5ea1f88..c627d7c85bff 100644 --- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c +++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c @@ -872,7 +872,15 @@ _AllocateMemory_Retry: #ifdef CONFIG_GPU_LOW_MEMORY_KILLER if(forceContiguous == gcvTRUE) { - if(force_contiguous_lowmem_shrink(Kernel) == 0) + int ret; + /* Acquire the mutex. */ + gcmkVERIFY_OK(gckOS_AcquireMutex(Kernel->os, Kernel->vidmemMutex, gcvINFINITE)); + + ret = force_contiguous_lowmem_shrink(Kernel); + + gcmkVERIFY_OK(gckOS_ReleaseMutex(Kernel->os, Kernel->vidmemMutex)); + + if(ret == 0) { /* Sleep 1 millisecond. */ gckOS_Delay(gcvNULL, 1); |