Re: Read operations and journaled data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 26, 2012 at 07:58:12PM -0300, Pedro Eugênio Rocha wrote:
> 
> I know that ext4 postpones checkpoints in data journaling
> mode, i.e., most of data (and meta-data) are only written
> to the journal and checkpointed to their final location only
> when certain thresholds are crossed. My question is: how
> do ext4 handle read operations to data blocks that are only
> written to the journal (supposing that its cache has been
> evicted)? Does it execute the read operation in the journaled
> data? Does it trigger a checkpoint?

It's not quite true that we postpone writing blocks to their final
location on disk until a checkpoint operation; what happens instead is
that we _forbid_ blocks from getting written to disk until the
transaction has committed.  At that point, the buffer cache writeback
threads are free to write them to their final location on disk
whenever they want.  We only allow a buffer to be evicted from the
buffer cache once it is written to the final location on disk, so this
isn't a problem.

When we do a checkpoint, we *force* all dirty blocks to be written to
disk, before we reuse that portion of the journal.  However, some or
many of these blocks may have already been written out to disk, and
they certainly will be written to disk before their in-memory copy is
allowed to be evicted from memory.

Finally, note that normally data blocks do not get written into the
journal at all; this only happens in the data journalling mode, which
is not the default.

Regards,

					- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux