aboutsummaryrefslogtreecommitdiff
path: root/drivers/misc/uid_sys_stats.c
Commit message (Collapse)AuthorAgeFilesLines
* ANDROID: uid_sys_stats: fix the commentArtem Borisov2018-01-201-1/+1
| | | | | | | It is not uid_cputime.c anymore. Change-Id: I7effc2a449c1f9cba9d86a7b122a9c05fc266405 Signed-off-by: Artem Borisov <dedsa2002@gmail.com>
* ANDROID: uid_sys_stats: Fix implicit declaration of get_cmdline()Amit Pundir2017-09-161-0/+1
| | | | | | | | | Include linux/mm.h for get_cmdline() declaration. Change-Id: Icad6ef7deef4d93d92d423c96bfa61fb5d66d0b7 Fixes: Change-Id: I30083b757eaef8c61e55a213a883ce8d0c9cf2b1 ("uid_sys_stats: log task io with a debug flag") Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
* uid_sys_stats: log task io with a debug flagYang Jin2017-09-161-60/+260
| | | | | | | | | Add a hashmap inside each uid_entry to keep track of task name and io. Task full name is a combination of thread and process name. Bug: 63739275 Change-Id: I30083b757eaef8c61e55a213a883ce8d0c9cf2b1 Signed-off-by: Yang Jin <yajin@google.com>
* uid_sys_stats: fix overflow when io usage delta is negativeJin Qian2017-08-121-5/+21
| | | | | | | | | Setuid can cause negative delta. Check this and update total usage only if delta is positive. Bug: 64317562 Change-Id: I4818c246db66cabf3b11d277faceedec1678694a Signed-off-by: Jin Qian <jinqian@google.com>
* ANDROID: uid_sys_stats: defer io stats calulation for dead tasksJin Qian2017-05-241-65/+42
| | | | | | | | | Store sum of dead task io stats in uid_entry and defer uid io calulation until next uid proc stat change or dumpsys. Bug: 37754877 Change-Id: I970f010a4c841c5ca26d0efc7e027414c3c952e0 Signed-off-by: Jin Qian <jinqian@google.com>
* ANDROID: uid_sys_stats: fix access of task_uid(task)Ganesh Mahendran2017-05-241-4/+5
| | | | | | | | struct task_struct *task should be proteced by tasklist_lock. Change-Id: Iefcd13442a9b9d855a2bbcde9fd838a4132fee58 Signed-off-by: Ganesh Mahendran <opensource.ganesh@gmail.com> (cherry picked from commit 90d78776c4a0e13fb7ee5bd0787f04a1730631a6)
* ANDROID: uid_sys_stats: reduce update_io_stats overheadJin Qian2017-05-241-10/+51
| | | | | | | | | | | | Replaced read_lock with rcu_read_lock to reduce time that preemption is disabled. Added a function to update io stats for specific uid and moved hash table lookup, user_namespace out of loops. Bug: 37319300 Change-Id: I2b81b5cd3b6399b40d08c3c14b42cad044556970 Signed-off-by: Jin Qian <jinqian@google.com>
* ANDROID: uid_sys_stats: fix typo in initJin Qian2017-05-231-1/+1
| | | | | Change-Id: I8a41b331c973898015d11d2018257727083f7910 Signed-off-by: Jin Qian <jinqian@google.com>
* ANDROID: uid_sys_stats: change to use rt_mutexWei Wang2017-05-231-15/+16
| | | | | | | | | | | | | | | | | | | | | | | | | We see this happens multiple times in heavy workload in systrace and AMS stuck in uid_lock. Running process: Process 953 Running thread: android.ui State: Uninterruptible Sleep Start: 1,025.628 ms Duration: 27,955.949 ms On CPU: Running instead: system_server Args: {kernel callsite when blocked:: "uid_procstat_write+0xb8/0x144"} Changing to rt_mutex can mitigate the priority inversion Bug: 34991231 Bug: 34193533 Change-Id: I481baad840b7bc2dfa9b9a59b4dff93cafb90077 Test: on marlin Signed-off-by: Wei Wang <wvw@google.com>
* ANDROID: uid_sys_stats: account for fsync syscallsJin Qian2017-05-231-2/+9
| | | | | Change-Id: Ie888d8a0f4ec7a27dea86dc4afba8e6fd4203488 Signed-off-by: Jin Qian <jinqian@google.com>
* ANDROID: uid_sys_stats: fix negative write bytes.Jin Qian2017-05-231-4/+10
| | | | | | | | | | | | A task can cancel writes made by other tasks. In rare cases, cancelled_write_bytes is larger than write_bytes if the task itself didn't make any write. This doesn't affect total size but may cause confusion when looking at IO usage on individual tasks. Bug: 35851986 Change-Id: If6cb549aeef9e248e18d804293401bb2b91918ca Signed-off-by: Jin Qian <jinqian@google.com>
* ANDROID: uid_sys_stats: remove unnecessary code in procstat switchJin Qian2017-05-231-14/+1
| | | | | | | | | 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>
* ANDROID: uid_sys_stats: return full size when state is not changed.Jin Qian2017-05-231-1/+1
| | | | | | | Userspace keeps retrying when it sees nothing is written. Bug: 34364961 Change-Id: Ie288c90c6a206fb863dcad010094fcd1373767aa
* ANDROID: uid_sys_stats: allow writing same stateJin Qian2017-05-231-1/+6
| | | | | | Signed-off-by: Jin Qian <jinqian@google.com> Bug: 34360629 Change-Id: Ia748351e07910b1febe54f0484ca1be58c4eb9c7
* ANDROID: uid_sys_stats: rename uid_cputime.c to uid_sys_stats.cJin Qian2017-05-231-0/+489
This module tracks cputime and io stats. Signed-off-by: Jin Qian <jinqian@google.com> Bug: 34198239 Change-Id: I9ee7d9e915431e0bb714b36b5a2282e1fdcc7342