Bug 99401 - /proc/timer_list prints out raw kernel jiffies
Summary: /proc/timer_list prints out raw kernel jiffies
Status: CLOSED INVALID
Alias: None
Product: Timers
Classification: Unclassified
Component: Other (show other bugs)
Hardware: All Linux
: P1 low
Assignee: john stultz
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-03 13:55 UTC by William Breathitt Gray
Modified: 2015-09-14 11:00 UTC (History)
0 users

See Also:
Kernel Version: 4.0.4
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description William Breathitt Gray 2015-06-03 13:55:58 UTC
I noticed that the “jiffies” line from the /proc/timer_list file has a value that is not scaled via the USER_HZ constant. Looking into the source code of the kernel/time/timer_list.c file, I found lines 189-190 to be the cause:

        SEQ_printf(m, "jiffies: %Lu\n",
                                    (unsigned long long)jiffies);

The actual kernel jiffies are printed out directly without scaling. I was under the impression that all kernel jiffies should be scaled via USER_HZ -- e.g. through the jiffies_to_clock_t function provided by include/linux/jiffies.h -- before exposure in userspace.

Is my impression correct? If not, when are kernel jiffies scaled via USER_HZ, and when are they not?
Comment 1 William Breathitt Gray 2015-08-24 23:48:27 UTC
This is not a bug; behaviour is intentional.

To quote TThomas Gleixner (http://lkml.org/lkml/2015/8/22/86):

> All instances which are de facto APIs, syscalls and also various files
> in proc/ must be in USER_HZ because userspace applications depend on
> the USER_HZ value.
> 
> proc/timer_list is exempt from that because its more a debugging
> interface which is not part of the strict kernel API. And we really
> want to see the real values and not the scaled USER_HZ ones for that
> purpose. I hope that answers your question.

Note You need to log in before you can comment on or make changes to this bug.