原因在于kgsl_mmu.c中,定义了gpu使用的内存大小,7x30中限定了256MB,当显存耗光而内存尚剩余很多的时候就会发生问题:不能触发LMK或OOM来释放内存,而又没有显存可用,进而可能引起各进程watchdogtimeout,如果系统进程发生watchdogtimeout,会导致system serverrestart,而restart之后也不能释放gpu显存,会一直反复重启:
unsigned int kgsl_mmu_get_ptsize(void)
{
/*
* For IOMMU, we could do up to 4G virtual range if we wanted to, but
* it makes more sense to return a smaller range and leave the rest of
* the virtual range for future improvements
*/
if (KGSL_MMU_TYPE_GPU == kgsl_mmu_type)
return CONFIG_MSM_KGSL_PAGE_TABLE_SIZE;
else if (KGSL_MMU_TYPE_IOMMU == kgsl_mmu_type)
return SZ_2G - KGSL_PAGETABLE_BASE;
else
return 0;
}
Lowmemorykiller.c 添加一个新函数
void lowmem_shrink_gpu(void)
{
struct task_struct *tsk;
struct task_struct *selected = NULL;
int tasksize;
int selected_tasksize = 0;
rcu_read_lock();
for_each_process(tsk) {
struct task_struct *p;
if (ts

当高通平台GPU-MMU限制的256MB显存耗尽,而系统内存仍有剩余时,由于无法触发LMK或OOM释放内存,将引发进程watchdogtimeout,可能导致system server重启并陷入反复重启的循环。解决方案是在Lowmemorykiller.c中添加新函数,并在kgsl_mmu_map中调用来解决显存不足的问题。

835

被折叠的 条评论
为什么被折叠?



