ANDROID: uid_sys_stats: remove unnecessary code in procstat switch
authorJin Qian <jinqian@google.com>
Fri, 17 Feb 2017 02:07:05 +0000 (18:07 -0800)
committerDanny Wood <danwood76@gmail.com>
Sun, 31 Mar 2019 08:48:11 +0000 (09:48 +0100)
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 <jinqian@google.com>
Signed-off-by: Francisco Franco <franciscofranco.1990@gmail.com>
drivers/misc/uid_sys_stats.c

index f9ab8c6d299a6736e1de260c7f9e6dec7af4f7f5..0b26866617ae5953cdb577f87f46fe01a65c09c4 100644 (file)
@@ -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;