Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • Guided learning
      Receive custom learning paths powered by our AI assistant.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

Which tasks are periodically taking processor time?

April 3, 2014
William Cohen
Related topics:
Linux
Related products:
Red Hat Enterprise Linux

    When running a latency-sensitive application one might notice that on a regular basis (for example every 5 minutes) there is a delay. The SystemTap periodic.stp script can provide some possible causes of that regular delay. The SystemTap periodic.stp script generates a list of the number of times that various scheduled functions run and the time between each scheduled execution. In the case of delay every five minutes one would run the periodic script for tens of minutes and then look through the output list for a function that has a period of approximately 300,000,00 microseconds (5 minutes*60 seconds*1,000,000 microseconds/second).

    Follow the instructions in the SystemTap Beginners Guide to install SystemTap. The SystemTap --all-modules option should be included on the command line when using periodic.stp script so the script can map the kernel module instruction addresses back to function names and make it easier to interpret what is periodically running. The script will collect data until cntrl-c is pressed. Below is an example run of periodic.stp:

    $ /usr/share/doc/systemtap-*/examples/profiling/periodic.stp --all-modules
    #monitoring timer periods (press control-c for output)
    ^C#type   function                                            period(us)     count
    kernel  0xffffffffa0c59200 [stap_eb782113d30627ea6aa3ef949        1000     13552
    kernel  0xffffffffa0c59200 [stap_eb782113d30627ea6aa3ef949        1000     13552
    kernel  0xffffffffa0c59200 [stap_eb782113d30627ea6aa3ef949        1000     13551
    kernel  0xffffffffa0c59200 [stap_eb782113d30627ea6aa3ef949        1000     13550
    work_q  do_dbs_timer                                              9999      1354
    work_q  do_dbs_timer                                              9999      1354
    kernel  0xffffffffa0c590e0 [stap_eb782113d30627ea6aa3ef949        9999      1354
    work_q  do_dbs_timer                                             10000      1354
    work_q  do_dbs_timer                                             10022      1351
    kernel  0xffffffffa0c59020 [stap_eb782113d30627ea6aa3ef949       19999       676
    kernel  monitor_timeout+0x0/0x10 [intel_ips]                    200003        67
    kernel  clocksource_watchdog+0x0/0x230 [kernel]                 500033        26
    kernel  tcp_delack_timer+0x0/0x270 [kernel]                     981240        13
    work_q  i915_gem_retire_work_handler                           1007250        12
    work_q  vmstat_update                                          1000000        12
    kernel  ipmi_timeout+0x0/0x470 [kernel]                        1000002        12
    work_q  vmstat_update                                          1000000        12
    kernel  br_fdb_cleanup+0x0/0x120 [bridge]                       999999        12
    work_q  vmstat_update                                           999999        12
    work_q  vmstat_update                                          1000000        12
    process kslowd000(157)                                            4983         8
    work_q  cache_reap                                             2000001         6
    kernel  e1000_watchdog+0x0/0x20 [e1000e]                       2000001         6
    work_q  cache_reap                                             1999999         6
    work_q  cache_reap                                             1999998         6
    kernel  br_hello_timer_expired+0x0/0x90 [bridge]               1999998         6
    work_q  cache_reap                                             2000000         6
    kernel  tcp_write_timer+0x0/0x200 [kernel]                     2933662         3
    kernel  cfq_idle_slice_timer+0x0/0x100 [kernel]                2037998         3
    work_q  flush_to_ldisc                                         3017627         3
    kernel  dev_watchdog+0x0/0x280 [kernel]                        5000425         2
    process bdi-default(29)                                        5000211         2
    process ips-adjust(892)                                        5000047         2
    kernel  sync_supers_timer_fn+0x0/0x20 [kernel]                 6000000         2
    kernel  inet_twdr_hangman+0x0/0xd0 [kernel]                    7499776         1
    process kslowd000(157)                                            1126         1
    process flush-253:0(1336)                                      4999981         1
    work_q  do_cache_clean                                            4875         1
    process flush-253:4(11335)                                     5000013         1

    The first column is the type of queue that the task periodically runs and can be a process, a kernel, or a work_q. A process entry is a user-space process with the second column listing the process name and the associated PID. A kernel entry is a kernel function scheduled to run with the second column listing the function and module name. A work_q entry is also a function in kernel-space, but it runs in a process context and is able to sleep. The "period(us)" column lists the measured period in microseconds between starts of the task. Variation in the time measurements may cause a timer interval of 10000 (1 millisecond) to be off, for example 9999 microseconds. The data are collated by the kernel timer data structure. A timer data structure may be initialized for each processor. Thus, for a periodic task running on all processors of a four-processor machine there would be four entries in the periodic.stp output (as seen for do_dbs_timer above). The last column is the count which indicates the number of times that the function or process ran.

    The SystemTap runtime needs to do some regular runtime adjustment to keep the time measurements accurate because the processor can change the clock speed. Every microsecond there the SystemTap task is running on each of the four processors of the machine. Those are the first four entries associated with the stap_eb782113d30627ea6aa3ef949 kernel module.

    The periodic.stp script makes clear the tasks the kernel is regularly performing. The do_dbs_timer is part of the kernel code that adjusts the processor clock frequency. It is running every 10 milliseconds (9999 microseconds) to determine whether the processor clock speed needs to be adjusted. The vmstat_update function is running once a second keep track of the virtual memory of system. The cache_reap runs every two seconds to reclaim memory being used to cache files.

    If you're new to SystemTap, see my previous article Starting with SystemTap.

    Last updated: January 10, 2023

    Recent Posts

    • Deploy MemPalace MCP Server on Red Hat OpenShift AI

    • Get ready for Ansible Automation Platform 2.7

    • Manage LLM evaluation workloads at scale with EvalHub and Kueue

    • Troubleshoot application misbehavior after an OpenShift upgrade

    • Preserve OpenShift Pipelines logs with OpenTelemetry

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Chat Support

    Please log in with your Red Hat account to access chat support.