Skip to content

Commit bd0c77c

Browse files
Frederic WeisbeckerThomas Gleixner
authored andcommitted
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. Signed-off-by: Frederic Weisbecker <frederic@kernel.org> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Tested-by: Shrikanth Hegde <sshegde@linux.ibm.com> Link: https://patch.msgid.link/20260508131647.43868-9-frederic@kernel.org
1 parent cf6444c commit bd0c77c

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

kernel/time/tick-sched.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -795,9 +795,6 @@ static u64 get_cpu_sleep_time_us(int cpu, enum cpu_usage_stat idx,
795795
ktime_t now, idle;
796796
unsigned int seq;
797797

798-
if (!tick_nohz_active)
799-
return -1;
800-
801798
now = ktime_get();
802799
if (last_update_time)
803800
*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,
839836
* This time is measured via accounting rather than sampling,
840837
* and is as accurate as ktime_get() is.
841838
*
842-
* Return: -1 if NOHZ is not enabled, else total idle time of the @cpu
839+
* Return: -1 if generic vtime is enabled, else total idle time of the @cpu
843840
*/
844841
u64 get_cpu_idle_time_us(int cpu, u64 *last_update_time)
845842
{
@@ -863,7 +860,7 @@ EXPORT_SYMBOL_GPL(get_cpu_idle_time_us);
863860
* This time is measured via accounting rather than sampling,
864861
* and is as accurate as ktime_get() is.
865862
*
866-
* Return: -1 if NOHZ is not enabled, else total iowait time of @cpu
863+
* Return: -1 if generic vtime is enabled, else total iowait time of @cpu
867864
*/
868865
u64 get_cpu_iowait_time_us(int cpu, u64 *last_update_time)
869866
{

0 commit comments

Comments
 (0)