summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXianzhong <b07117@freescale.com>2014-05-08 18:35:22 +0800
committerJason Liu <r64343@freescale.com>2014-06-06 15:14:14 +0800
commit61af21ed21fd81c0596357d7c1b8763399fabf27 (patch)
treee658cd739bba6ac27d84b62f4447de5557546407
parent443ca8521d9836e55e4c27ef9ecd763ae1920efc (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 (cherry picked from commit 554581201c0a1c2c7caddad5750b1fd678e09c8c) (cherry picked from commit 78ecaf1c6475ee188a6a2a1dfbe954e457a28997)
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c13
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 8cee145f1c15..ccf0277c2bc5 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;