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

Commit 2b6a49e9 authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ANDROID: uid_sys_stats: Replace tasklist lock with RCU in uid_cputime_show"

parents dcb91385 c750523f
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -346,13 +346,13 @@ static int uid_cputime_show(struct seq_file *m, void *v)
		uid_entry->active_utime = 0;
	}

	read_lock(&tasklist_lock);
	rcu_read_lock();
	do_each_thread(temp, task) {
		uid = from_kuid_munged(user_ns, task_uid(task));
		if (!uid_entry || uid_entry->uid != uid)
			uid_entry = find_or_register_uid(uid);
		if (!uid_entry) {
			read_unlock(&tasklist_lock);
			rcu_read_unlock();
			rt_mutex_unlock(&uid_lock);
			pr_err("%s: failed to find the uid_entry for uid %d\n",
				__func__, uid);
@@ -362,7 +362,7 @@ static int uid_cputime_show(struct seq_file *m, void *v)
		uid_entry->active_utime += utime;
		uid_entry->active_stime += stime;
	} while_each_thread(temp, task);
	read_unlock(&tasklist_lock);
	rcu_read_unlock();

	hash_for_each(hash_table, bkt, uid_entry, hash) {
		u64 total_utime = uid_entry->utime +