Andrew,
Facing some challenges to test this. If you have a chance to test
it again, the following output will be interesting to observe.
iostat -ctx -p sda 3 > /tmp/iostat.out
Also note your system time when this problem occurs, (iostat has time
stamp, I wish see the waitQ and activeQ at that time, hopefully
captured in the file /tmp/iostat.out above).
We need more clarity on the test-case which can reproduce this issue.
As I know you are writing into the btrfs. However is that a large
number of small files (you are creating new files) OR you are writing
a few large new files ?
If there is any script to test this that will make understanding
a lot easier.
PS: Does anybody know Solaris lockstat(1M) equivalent in Linux ?
Thanks, Anand