From 66839f98f41f5e9226598546a5d1ad07c86f7be5 Mon Sep 17 00:00:00 2001 From: Jin Qian Date: Thu, 16 Feb 2017 18:07:05 -0800 Subject: [PATCH] ANDROID: uid_sys_stats: remove unnecessary code in procstat switch No need to aggregate the switched uid separately since update_io_stats_locked covers all uids. Bug: 34198239 Change-Id: Ifed347264b910de02e3f3c8dec95d1a2dbde58c0 Signed-off-by: Jin Qian Signed-off-by: Francisco Franco --- drivers/misc/uid_sys_stats.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/drivers/misc/uid_sys_stats.c b/drivers/misc/uid_sys_stats.c index f9ab8c6d299..0b26866617a 100644 --- a/drivers/misc/uid_sys_stats.c +++ b/drivers/misc/uid_sys_stats.c @@ -324,9 +324,8 @@ static int uid_procstat_open(struct inode *inode, struct file *file) static ssize_t uid_procstat_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos) { - struct task_struct *task, *temp; struct uid_entry *uid_entry; - uid_t uid, task_uid; + uid_t uid; int argc, state; char input[128]; @@ -358,18 +357,6 @@ static ssize_t uid_procstat_write(struct file *file, return count; } - memset(&uid_entry->io[UID_STATE_TOTAL_CURR], 0, - sizeof(struct io_stats)); - - read_lock(&tasklist_lock); - do_each_thread(temp, task) { - task_uid = from_kuid_munged(current_user_ns(), task_uid(task)); - if (uid != task_uid) - continue; - add_uid_io_curr_stats(uid_entry, task); - } while_each_thread(temp, task); - read_unlock(&tasklist_lock); - update_io_stats_locked(); uid_entry->state = state; -- 2.20.1