All of lore.kernel.org
 help / color / mirror / Atom feed
* Read operations and journaled data
@ 2012-06-26 22:58 Pedro Eugênio Rocha
  2012-06-26 23:42 ` Theodore Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: Pedro Eugênio Rocha @ 2012-06-26 22:58 UTC (permalink / raw)
  To: linux-ext4

Hi guys,

I have a quick (kind of dumb) question for you about
journaling.

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?

Probably I'm missing something here.

Thanks

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Read operations and journaled data
  2012-06-26 22:58 Read operations and journaled data Pedro Eugênio Rocha
@ 2012-06-26 23:42 ` Theodore Ts'o
  0 siblings, 0 replies; 2+ messages in thread
From: Theodore Ts'o @ 2012-06-26 23:42 UTC (permalink / raw)
  To: Pedro Eugênio Rocha; +Cc: linux-ext4

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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-06-26 23:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-26 22:58 Read operations and journaled data Pedro Eugênio Rocha
2012-06-26 23:42 ` Theodore Ts'o

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.