|
发表于 2020-12-3 10:30:29
5916 浏览 0 回复
Android 7.0 如何修改低内存的时候某些进程不被杀死
kernel-3.18/drivers/staging/android/lowmemorykiller.c
- @@ -149,6 +149,21 @@ static unsigned long lowmem_count(struct shrinker *s,
- global_page_state(NR_INACTIVE_FILE);
- }
-
- +static bool lowmem_whitelist(char *name)
- +{
- + bool ret = false;
- + if (name == NULL)
- + return ret;
- +
- + if ((!strcmp(name, "io.vsim.agent")) ||
- + (!strcmp(name, "io.vsim.bridge"))) {
- + ret = true;
- + }
- +
- + return ret;
- +}
- +
- +
- static unsigned long lowmem_scan(struct shrinker *s, struct shrink_control *sc)
- {
- struct task_struct *tsk;
- @@ -413,7 +428,7 @@ log_again:
- #endif
- #endif
- task_unlock(p);
- - if (tasksize <= 0)
- + if ((tasksize <= 0) || (lowmem_whitelist(p->comm) == true))
- continue;
- if (selected) {
- if (oom_score_adj < selected_oom_score_adj)
复制代码
|
|
手机微信同号:13682654092
|
|
|
|
|
登录或注册
|