linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Theodore Ts'o <tytso@mit.edu>
To: "Pedro Eugênio Rocha" <pedro.eugenio.rocha@gmail.com>
Cc: linux-ext4@vger.kernel.org
Subject: Re: Read operations and journaled data
Date: Tue, 26 Jun 2012 19:42:11 -0400	[thread overview]
Message-ID: <20120626234211.GB7594@thunk.org> (raw)
In-Reply-To: <CAM3FfDwJhWNO39xrodOFcjQJKE+BD3fNH3t5C5SUtzYubAbGMA@mail.gmail.com>

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

      reply	other threads:[~2012-06-26 23:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-26 22:58 Read operations and journaled data Pedro Eugênio Rocha
2012-06-26 23:42 ` Theodore Ts'o [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120626234211.GB7594@thunk.org \
    --to=tytso@mit.edu \
    --cc=linux-ext4@vger.kernel.org \
    --cc=pedro.eugenio.rocha@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).