Re: high cpu load for random write

Chris Mason
2009-07-01T15:53:26Z

On Wed, Jul 01, 2009 at 11:30:23AM +0300, Piavlo wrote:
> Hi Chris,
>
> I've tried a test with mount -o nodatacow and see no noticeable
> difference in cpu load.
>
> Results with -o nodatacow (dmesg confirms "btrfs: setting nodatacow")
> Tiotest results for 1 concurrent io threads:

Well, it turns out that I broke nodatacow when I merged Christoph's attr
patch. This high CPU usage during tiotest is all checksums.

The CPU times look like random writes are using much more CPU, but
really they are just doing much less IO (59MB vs 9000MB). This makes
the CPU percentage look much higher because the test overall isn't
waiting on IO much at all.

Here are my results for your tiotest run with a fixed nodatacow:

test results for 1 concurrent io threads:
,----------------------------------------------------------------------.
| Item | Time | Rate | Usr CPU | Sys CPU |
+-----------------------+----------+--------------+----------+---------+
| Write 9000 MBs | 87.6 s | 102.774 MB/s | 0.4 % | 11.4 % |
| Random Write 59 MBs | 40.7 s | 1.438 MB/s | 0.0 % | 0.3 % |
`----------------------------------------------------------------------'

I'll queue the fix up for Linus.

-chris