From: Heinz Mauelshagen <heinzm@redhat.com>
To: Kumar amit mehta <gmate.amit@gmail.com>
Cc: dm-devel@redhat.com, o@gmail.com
Subject: Re: dm-cache: dirty state of blocks in writethrough mode
Date: Wed, 24 Jul 2013 19:05:59 +0200 [thread overview]
Message-ID: <51F00977.7060802@redhat.com> (raw)
In-Reply-To: <20130724102452.GA6963@gmail.com>
On 07/24/2013 12:24 PM, Kumar amit mehta wrote:
> On Tue, Jul 23, 2013 at 03:26:08PM +0200, Heinz Mauelshagen wrote:
>> On 07/23/2013 08:44 AM, Vijarnia, Anil wrote:
>>> Hello,
>>> In Documentation/cache.txt, section 'Updating on-disk metadata' mentions that "If the system crashes all cache blocks will be assumed dirty when restarted".
>>> I am assuming that the above line is relevant for writeback mode only, and in writethrough mode the cache will always be coherent after a crash.
>>> Can someone confirm/reject this assumption?
>> That's correct
>>
>> Reason being that the cache never holds any dirty pages in
>> writethrough mode.
> I'm new to storage and would like to know the linux implementation of
> writeback policy of disk cache. In case these disk caches are stored in
> volatile RAM and we hit system crash, so that cache is gone, but somehow
> we have to flush those pending writes to the backend storage, once the
> system comes up. How this is achieved in general, Is it through some
> kind of metadata that is maintained in a separate area of the disk or it
> relies on the file system's journalling capability?
dm-cache maintains it's own metadata keeping track of any cached blocks
properties
such as a block being dirty in case of writeback.
If any write in writeback mode hits a cache block, the cache metadata will
reflect that dirty state before the write's being reported to the
application.
After a crashed system rebooted, that information is available to flush a
dirty block out on eviction.
Heinz
>
> !!amit
next prev parent reply other threads:[~2013-07-24 17:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-23 6:44 dm-cache: dirty state of blocks in writethrough mode Vijarnia, Anil
2013-07-23 13:26 ` Heinz Mauelshagen
2013-07-24 10:24 ` Kumar amit mehta
2013-07-24 17:05 ` Heinz Mauelshagen [this message]
2013-07-24 13:02 ` Kumar amit mehta
2013-07-25 10:45 ` Heinz Mauelshagen
2013-07-26 2:45 ` Kumar amit mehta
2013-07-26 11:14 ` Heinz Mauelshagen
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=51F00977.7060802@redhat.com \
--to=heinzm@redhat.com \
--cc=dm-devel@redhat.com \
--cc=gmate.amit@gmail.com \
--cc=o@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).