|
Description
|
Currently, the only way zvol will return to the caller before data is committed to disk
is if we are called as part of fsflush pushing out dirty pages. This leads to a very
performance-poor situation.
The ideal case is for zvol to behave like a real disk. Real disks have a write cache
and will acknowledge a write before it hits media. If you actually care whether or
not your data is actually on stable storgae, you send down a special command that doesn't
complete until all dirty data is on the device's media.
This means that zvol needs to support this special command (DKIOCFLUSHWRITECACHE), and
that it should save zil_commit() for only the times it's necessary. For every write
that comes in, we will need to create a ZIL record. Once that's done, we can return
to the caller. If, at a later time, the caller either does an fsync() or issues
the DKIOCFLUSHWRITECACHE ioctl(), we need to force all the ZIL records to stable
storage. This will allow us to get much better concurrency (and performance), while
having semantics of a normal disk (which everyone is already familiar with).
|