aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavankumar Kondeti <pkondeti@codeaurora.org>2017-06-21 09:22:45 +0530
committerAmit Pundir <amit.pundir@linaro.org>2018-08-28 17:10:42 +0530
commitaab728ca5f823bd65c41940dcbc3bcead4a727b7 (patch)
tree59b3128c204d625f7c5192bed4d39b94ab9778f7
parentb8ab1e4c0d49b2165c05e08d912c91791ea17505 (diff)
downloadlinaro-android-aab728ca5f823bd65c41940dcbc3bcead4a727b7.tar.gz
ANDROID: uid_sys_stats: Replace tasklist lock with RCU in uid_cputime_show
Tasklist lock is acuquired in uid_cputime_show for updating the stats for all tasks in the system. This can potentially disable preemption for several milli seconds. Replace tasklist_lock with RCU read side primitives. Change-Id: Ife69cb577bfdceaae6eb21b9bda09a0fe687e140 Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
-rw-r--r--drivers/misc/uid_sys_stats.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/misc/uid_sys_stats.c b/drivers/misc/uid_sys_stats.c
index fbf7db598d55..88dc1cd3a204 100644
--- a/drivers/misc/uid_sys_stats.c
+++ b/drivers/misc/uid_sys_stats.c
@@ -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 +