Am 20.09.2010 17:33, schrieb Avi Kivity: > On 09/20/2010 05:08 PM, Kevin Wolf wrote: >>> >>> Let's expand it a bit more: >>> >>> 1. Update refcount table >>> 2. bdrv_flush >>> 3. Update L2 entry >>> 4. Write data to disk >>> 5. Report write complete >>> >>> I'm struggling to understand how a thread helps out. >> >> This sequence becomes: >> >> 1. Update refcount table >> 2. Write data to disk >> 3. Report write complete >> >> And only later: >> >> 4. Update L2 entry >> 5. bdrv_flush (possibly merged with other flushes) >> > > The L2 update needs to happen after we're sure the refcount update is > stable, so need a bdrv_flush between them. > > Still, the basic idea looks sound. You can do many refcount updates, > flush, many L2 updates, flush.
Oops, my bad. Swap 4 and 5, that's what I meant. We don't need a flush after writing the L2 entry until we need to flush for other reasons. Kevin