Why is most the of disk IO attributed to jbd2 and not to the process that is actually using the IO

diskioprocess

When monitoring disk IO, most of the IO is attributed to jbd2, while the original process that caused the high IO is attributed a much lower IO percentage. Why?

Here's iotop's example output (other processes with IO<1% omitted):

enter image description here

Best Answer

jbd2 is a kernel thread that updates the filesystem journal.

Tracing filesystem or disk activity with the process that caused it is difficult because the activities of many processes are combined together. For example, if two processes are reading from the same file at the same time, which process would the read be accounted against? If two processes write to the same directory and the directory is updated on disk only once (combining the two operations), which process would the write be accounted against?

In your case, it appears that most of the traffic consists of updates to the journal. This is traced to the journal updater, but there's no tracing between journal updates and the process(es) that caused the write operation(s) that required this journal update.

Related Question