Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a21fe9c3 authored by Lingutla Chandrasekhar's avatar Lingutla Chandrasekhar Committed by Satya Durga Srinivasu Prabhala
Browse files

sched: Improve the scheduler



This change is for general scheduler improvements.

Change-Id: I780f52ebc3cb69ee2c497d2d2f8e8fddd789421d
Signed-off-by: default avatarLingutla Chandrasekhar <clingutla@codeaurora.org>
parent eb329acd
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -5627,6 +5627,7 @@ unsigned int sched_lib_mask_force;
bool is_sched_lib_based_app(pid_t pid)
{
	const char *name = NULL;
	char *lib_list, *libname;
	struct vm_area_struct *vma;
	char path_buf[LIB_PATH_LENGTH];
	bool found = false;
@@ -5636,11 +5637,14 @@ bool is_sched_lib_based_app(pid_t pid)
	if (strnlen(sched_lib_name, LIB_PATH_LENGTH) == 0)
		return false;

	lib_list = kstrdup(sched_lib_name, GFP_KERNEL);

	rcu_read_lock();

	p = find_process_by_pid(pid);
	if (!p) {
		rcu_read_unlock();
		kfree(lib_list);
		return false;
	}

@@ -5660,19 +5664,22 @@ bool is_sched_lib_based_app(pid_t pid)
			if (IS_ERR(name))
				goto release_sem;

			if (strnstr(name, sched_lib_name,
			while ((libname = strsep(&lib_list, ","))) {
				if (strnstr(name, libname,
					strnlen(name, LIB_PATH_LENGTH))) {
					found = true;
					break;
				}
			}
		}
	}

release_sem:
	up_read(&mm->mmap_sem);
	mmput(mm);
put_task_struct:
	put_task_struct(p);
	kfree(lib_list);
	return found;
}