Hello.

I have an application that writes chunks of data to a file by using
pwrite. I have multiple threads, where one of the threads is writing
out 16k chunks of data, and the other thread is writing out 4k chunks.

I have been using dtrace and iosnoop to look at the application, and I
find it strange that my 16k write has been split up to two IO
operations. (I have added entry/return-probes for pwrite here)

  UID   PID D    BLOCK   SIZE       COMM PATHNAME
       pwrite64(8, 0x975d000, 16384, 0x3fff000)
        pwrite64(9, 0xfc401000, 4096, 0x3000)
500 10909 W  3867928  12288 chunktest     <none>
500 10909 W  3867952   4096 chunktest     <none>
        pwrite64 = 16384
500 10909 W   138184   4096 chunktest     <none>
        pwrite64 = 4096

I don't know much about a filesystem and block layout, but I thought
that if the blocks I was about to write are contigenous it may be
performed as a single IO operation? (3867928+(12288/512) == 3867952)

I have tried to use iosnoop to look on mkfile:
[...]
        write(3, 0x8062730, 8192, 0x0)
        write(3, 0x8062730, 8192, 0x0)
        write(3, 0x8062730, 8192, 0x0)
500 25769 W  2223232 1048576     mkfile /export/home/mkfile

Now all of the small writes has been joined into one big IO operation.

Could anybody please enlighten me? Is there anything I can do to "optimize" my 
IO to avoid the splitting of my 16k write into one 12k and one 4k?

Trond
 
 
This message posted from opensolaris.org
_______________________________________________
ufs-discuss mailing list
[email protected]

Reply via email to