Why does disk I/O slow down a CPU bound task?

Richard W.M. Jones rjones at redhat.com
Tue Mar 31 17:44:37 UTC 2015


On Tue, Mar 31, 2015 at 08:32:16AM -0700, Dave Johansen wrote:
> I am not familiar with the low level details of disk I/O but I'm sure that
> they are far more complicated than my basic assumptions, but my concern is
> how can a disk-bound process steal cycles from a CPU-bound one that is not
> access the disk at all. The lwn.net articles that drago01 linked to helped
> shed some light on what's going on, but it sounds like there is still some
> potential work that could be done to help improve the situation.

When you run the cpu load test program, where do you write the
statistics to?

For a fair test you probably want to change the program so it stores
them in preallocated memory and prints them at the end of the test.

Almost anything else -- even writing to a file in /dev/shm -- could
block waiting on other slow requests.  And if you're writing them to
stdout under X11, then you'd have to be sure that nothing else in your
terminal / X stack could ever swap or issue any kind of I/O, which is
probably impossible.  Perhaps writing to a Linux virtual console might
be safe.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-top is 'top' for virtual machines.  Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://people.redhat.com/~rjones/virt-top


More information about the devel mailing list