sched: Improve the scheduler

This change is for general scheduler improvements.

Change-Id: I3842c589378ce5bcc54e4c35ebcbfbdfa1f88a8f
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
tirimbino
Pavankumar Kondeti 5 years ago
parent 18b2099880
commit 92daaf50af
  1. 19
      kernel/sched/core.c

@ -4917,8 +4917,10 @@ unsigned int sched_lib_mask_force;
bool is_sched_lib_based_app(pid_t pid)
{
const char *name = NULL;
char *libname, *lib_list;
struct vm_area_struct *vma;
char path_buf[LIB_PATH_LENGTH];
char *tmp_lib_name;
bool found = false;
struct task_struct *p;
struct mm_struct *mm;
@ -4926,11 +4928,16 @@ bool is_sched_lib_based_app(pid_t pid)
if (strnlen(sched_lib_name, LIB_PATH_LENGTH) == 0)
return false;
tmp_lib_name = kmalloc(LIB_PATH_LENGTH, GFP_KERNEL);
if (!tmp_lib_name)
return false;
rcu_read_lock();
p = find_process_by_pid(pid);
if (!p) {
rcu_read_unlock();
kfree(tmp_lib_name);
return false;
}
@ -4950,10 +4957,15 @@ bool is_sched_lib_based_app(pid_t pid)
if (IS_ERR(name))
goto release_sem;
if (strnstr(name, sched_lib_name,
strlcpy(tmp_lib_name, sched_lib_name, LIB_PATH_LENGTH);
lib_list = tmp_lib_name;
while ((libname = strsep(&lib_list, ","))) {
libname = skip_spaces(libname);
if (strnstr(name, libname,
strnlen(name, LIB_PATH_LENGTH))) {
found = true;
break;
found = true;
goto release_sem;
}
}
}
}
@ -4963,6 +4975,7 @@ release_sem:
mmput(mm);
put_task_struct:
put_task_struct(p);
kfree(tmp_lib_name);
return found;
}

Loading…
Cancel
Save