diff options
author | Xianzhong <b07117@freescale.com> | 2014-05-08 18:35:22 +0800 |
---|---|---|
committer | Richard Liu <r66033@freescale.com> | 2014-05-15 15:08:49 +0800 |
commit | 88397e3badf1539d763c8edc9c537ba79ecbf25a (patch) | |
tree | 5acd0c727b428142bcc8613c8f055e55c349dc9f | |
parent | b80333e3b23437b036ddd3523b8999a14035c14c (diff) |
ENGR00312477 [#1162] fixed gpu lower memory killer
mutex operation is performed in gckKERNEL_QueryProcessDB
remove spinlock for gckKERNEL_QueryProcessDB to avoid scheduling issue
Date: May 08, 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 | 13 |
1 files changed, 8 insertions, 5 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 743858a97e48..d10bf41b6df2 100644 --- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c +++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c @@ -572,30 +572,33 @@ static int force_contiguous_lowmem_shrink(IN gckKERNEL Kernel) struct mm_struct *mm; struct signal_struct *sig; gcuDATABASE_INFO info; - int oom_adj; + int oom_adj, pid; task_lock(p); mm = p->mm; sig = p->signal; + pid = p->pid; if (!mm || !sig) { task_unlock(p); continue; } oom_adj = sig->oom_adj; + task_unlock(p); if (oom_adj < min_adj) { - task_unlock(p); continue; } + read_unlock(&tasklist_lock); + tasksize = 0; - if (gckKERNEL_QueryProcessDB(Kernel, p->pid, gcvFALSE, gcvDB_VIDEO_MEMORY, &info) == gcvSTATUS_OK){ + if (gckKERNEL_QueryProcessDB(Kernel, pid, gcvFALSE, gcvDB_VIDEO_MEMORY, &info) == gcvSTATUS_OK){ tasksize += info.counters.bytes / PAGE_SIZE; } - if (gckKERNEL_QueryProcessDB(Kernel, p->pid, gcvFALSE, gcvDB_CONTIGUOUS, &info) == gcvSTATUS_OK){ + if (gckKERNEL_QueryProcessDB(Kernel, pid, gcvFALSE, gcvDB_CONTIGUOUS, &info) == gcvSTATUS_OK){ tasksize += info.counters.bytes / PAGE_SIZE; } - task_unlock(p); + read_lock(&tasklist_lock); if (tasksize <= 0) continue; |