History

tick/sched: Remove nohz disabled special case in cputime fetch

Even when nohz is not runtime enabled, the dynticks idle cputime accounting can run and the common idle cputime accessors are still relevant. Remove the nohz disabled special case accordingly.

Frederic Weisbecker committed 6 months ago

Commit bd0c77c1 parent cf6444c1 file · +2 −5Browse files

Showing the changes to kernel (1 of 1 file). Show all

Unified · Split

kernel/time/tick-sched.c+2−5
@@ -795,9 +795,6 @@ static u64 get_cpu_sleep_time_us(int cpu, enum cpu_usage_stat idx, · 794 unmodified lines
795 ktime_t now, idle;795 ktime_t now, idle;
796 unsigned int seq;796 unsigned int seq;
797 797
798 if (!tick_nohz_active)
799 return -1;
800
801 now = ktime_get();798 now = ktime_get();
802 if (last_update_time)799 if (last_update_time)
803 *last_update_time = ktime_to_us(now);800 *last_update_time = ktime_to_us(now);
@@ -839,7 +836,7 @@ static u64 get_cpu_sleep_time_us(int cpu, enum cpu_usage_stat idx, · 35 unmodified lines
839 * This time is measured via accounting rather than sampling,836 * This time is measured via accounting rather than sampling,
840 * and is as accurate as ktime_get() is.837 * and is as accurate as ktime_get() is.
841 *838 *
842 * Return: -1 if NOHZ is not enabled, else total idle time of the @cpu839 * Return: -1 if generic vtime is enabled, else total idle time of the @cpu
843 */840 */
844u64 get_cpu_idle_time_us(int cpu, u64 *last_update_time)841u64 get_cpu_idle_time_us(int cpu, u64 *last_update_time)
845{842{
@@ -863,7 +860,7 @@ EXPORT_SYMBOL_GPL(get_cpu_idle_time_us); · 17 unmodified lines
863 * This time is measured via accounting rather than sampling,860 * This time is measured via accounting rather than sampling,
864 * and is as accurate as ktime_get() is.861 * and is as accurate as ktime_get() is.
865 *862 *
866 * Return: -1 if NOHZ is not enabled, else total iowait time of @cpu863 * Return: -1 if generic vtime is enabled, else total iowait time of @cpu
867 */864 */
868u64 get_cpu_iowait_time_us(int cpu, u64 *last_update_time)865u64 get_cpu_iowait_time_us(int cpu, u64 *last_update_time)
869{866{

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t