Skip to main content
Redhat Developers  Logo
  • Products

    Platforms

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat AI
      Red Hat AI
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • View All Red Hat Products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat Developer Hub
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat OpenShift Local
    • Red Hat Developer Sandbox

      Try Red Hat products and technologies without setup or configuration fees for 30 days with this shared Openshift and Kubernetes cluster.
    • Try at no cost
  • Technologies

    Featured

    • AI/ML
      AI/ML Icon
    • Linux
      Linux Icon
    • Kubernetes
      Cloud icon
    • Automation
      Automation Icon showing arrows moving in a circle around a gear
    • View All Technologies
    • Programming Languages & Frameworks

      • Java
      • Python
      • JavaScript
    • System Design & Architecture

      • Red Hat architecture and design patterns
      • Microservices
      • Event-Driven Architecture
      • Databases
    • Developer Productivity

      • Developer productivity
      • Developer Tools
      • GitOps
    • Automated Data Processing

      • AI/ML
      • Data Science
      • Apache Kafka on Kubernetes
    • Platform Engineering

      • DevOps
      • DevSecOps
      • Ansible automation for applications and services
    • Secure Development & Architectures

      • Security
      • Secure coding
  • Learn

    Featured

    • Kubernetes & Cloud Native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud icon
    • AI/ML
      AI/ML Icon
    • View All Learning Resources

    E-Books

    • GitOps Cookbook
    • Podman in Action
    • Kubernetes Operators
    • The Path to GitOps
    • View All E-books

    Cheat Sheets

    • Linux Commands
    • Bash Commands
    • Git
    • systemd Commands
    • View All Cheat Sheets

    Documentation

    • Product Documentation
    • API Catalog
    • Legacy Documentation
  • Developer Sandbox

    Developer Sandbox

    • Access Red Hat’s products and technologies without setup or configuration, and start developing quicker than ever before with our new, no-cost sandbox environments.
    • Explore Developer Sandbox

    Featured Developer Sandbox activities

    • Get started with your Developer Sandbox
    • OpenShift virtualization and application modernization using the Developer Sandbox
    • Explore all Developer Sandbox activities

    Ready to start developing apps?

    • Try at no cost
  • Blog
  • Events
  • Videos

Which tasks are periodically taking processor time?

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

Share:

    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

    • Profiling vLLM Inference Server with GPU acceleration on RHEL

    • Network performance in distributed training: Maximizing GPU utilization on OpenShift

    • Clang bytecode interpreter update

    • How Red Hat has redefined continuous performance testing

    • Simplify OpenShift installation in air-gapped environments

    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
    © 2025 Red Hat

    Red Hat legal and privacy links

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

    Report a website issue