I measured the run queue wait time of a process on Linux

Let's measure the Run queue wait time of the CPU-bound SCHED_FIFO process started by Start process with scheduling policy on Linux.

I referred to the following page to get the Run queue wait time. https://yohei-a.hatenablog.jp/entry/20150806/1438869775

The result of getting / proc / PID / schedstat of the CPU bound FIFO process after 1 second. The second column is the Run queue wait time. Unit nanoseconds.

  1. time spent on the cpu
  2. time spent waiting on a runqueue
  3. of timeslices run on this cpu

(From https://www.kernel.org/doc/html/latest/scheduler/sched-stats.html)

[ec2-user@ip-172-21-0-185 ~]$ sudo cat /proc/27629/schedstat ; sleep 1; sudo cat /proc/27629/schedstat
1585551572096 83397623426 1669
1586504089039 83449107507 1670

It's about 51 milliseconds. Since the time slice is 1 in the 3rd column, is the Context Switch occurring only once? It looks like a real-time process.

Below is the result of getting / proc / PID / schedstat of the CPU-bound SCHED_OTHER process that was running at the same time after a second.

[ec2-user@ip-172-21-0-185 ~]$ sudo cat /proc/28585/schedstat ; sleep 1; sudo cat /proc/28585/schedstat
28229659566 570788962732 8601
28291651447 571746971282 8620

About 958 milliseconds. You can see that the SCHED_FIFO process was in the Run queue almost all the time it was running.

Kill and measure SCHED_OTHER process

When I killed the SCHED_OTHER process and measured the Run queue wait time of the SCHED_FIFO with no other CPU-intensive process, the result was about 50 milliseconds. (There is no command output result) That means that the yes process of SCHED_OTHER was running only when the yes process of SCHED_FIFO was not using the CPU.

Recommended Posts

I measured the run queue wait time of a process on Linux
On Linux, the time stamp of a file is a little past.
Run a Linux server on GCP
Process the result of% time,% timeit
Build a Selenium environment on Amazon Linux 2 in the shortest time
I will publish a shell script created to reduce the trouble of creating LiveUSB on Linux
Get the host name of the host PC with Docker on Linux
[Linux] I tried to summarize the command of resource confirmation system
On Linux, the time stamp of a file is a little past.
Efficient use of Linux file system
I measured the run queue wait time of a process on Linux
A quick overview of the Linux kernel
Run a batch of Python 2.7 with nohup on Amazon Linux AMI on EC2
A note about the functions of the Linux standard library that handles time
I made a GAN with Keras, so I made a video of the learning process.
Python: I want to measure the processing time of a function neatly
I made a tool to estimate the execution time of cron (+ PyPI debut)
[Linux] Difference in time information depending on the clock ID of the clock_gettime () function
Run yolov4 "for the time being" on windows
How to access the contents of a Linux disk on a Mac (but read-only)
[2020July] Check the UDID of the iPad on Linux
A record of the time it took to deploy mysql on Cloud9 + Rails
Start a process with a scheduling policy on Linux
Calculate the probability of outliers on a boxplot
At the time of python update on ubuntu
I did a little research on the class
[Example of Python improvement] I learned the basics of Python on a free site in 2 weeks.
The world changed when I opened a big Python project (Django) on Sourcetrail (Linux)
The story of Linux that I want to teach myself half a year ago
Until you run a Flask application on Google App Engine for the time being
I want to take a screenshot of the site on Docker using any font
I tried Python on Mac for the first time.
Specify the volume on linux and make a sound
Create a QR code for the URL on Linux
Maybe I overestimated the impact of ShellShock on CGI
For the first time, I learned about Unix (Linux).
I measured the performance of 1 million documents with mongoDB
I will install Arch Linux for the time being.
A Study on Visualization of the Scope of Prediction Models
I tried installing the Linux kernel on virtualbox + vagrant
Create a shape on the trajectory of an object
Announcing the availability of Java 11 LTS on Amazon Linux 2
I created a Discord bot on Docker that reports the number of corona infected people in Tokyo at a specified time.
"Stop committing Japanese files to git on Mac> <" For the time being, I wrote a script to search for incompatible Japanese files on Mac and Linux.
[Shell startup] I tried to display the shell on the TV with a cheap Linux board G-cluster
Avoiding the pitfalls of using a Mac (for Linux users?)
A note on the default behavior of collate_fn in PyTorch
I just changed the sample source of Python a little.
I tried running PIFuHD on Windows for the time being
Run a limited number of image presentation programs on PsychoPy
I want to use only the normalization process of SudachiPy
I made a function to check the model of DCGAN
I made a dot picture of the image of Irasutoya. (part1)
Computing the BigQuery cost of a single Airflow DAG run
I made a VGG16 model using TensorFlow (on the way)
A rough summary of the differences between Windows and Linux
I tried a little bit of the behavior of the zip function
I made a dot picture of the image of Irasutoya. (part2)
Install the latest version of Git on your Linux server
I want to create a Dockerfile for the time being.
Get the host name of the host PC with Docker on Linux
Put the process to sleep for a certain period of time (seconds) or more in Python
The story of releasing a Python text check tool on GitHub x CircleCI for the first time
A story that I had a hard time displaying graphs on top of each other with matplotlib
Install the JDK on Linux