From: Mike Snitzer <snitzer@redhat.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: Joe Thornber <thornber@redhat.com>,
device-mapper development <dm-devel@redhat.com>,
linux-kernel@vger.kernel.org
Subject: Re: dm-cache not writing out cache metadata at reboot?
Date: Thu, 9 May 2013 16:47:01 -0400 [thread overview]
Message-ID: <20130509204701.GA2383@redhat.com> (raw)
In-Reply-To: <20130509203616.GA5713@blackbox.djwong.org>
On Thu, May 09 2013 at 4:36pm -0400,
Darrick J. Wong <darrick.wong@oracle.com> wrote:
> On Wed, May 08, 2013 at 06:05:26PM -0400, Mike Snitzer wrote:
> > On Wed, May 08 2013 at 5:48pm -0400,
> > Darrick J. Wong <darrick.wong@oracle.com> wrote:
> >
> > > Hi,
> > >
> > > So I've been watching the hit/miss counters in dmcache and I've noticed a
> > > couple of things that look like errors to me:
> > >
> > > First, I noticed that if I reboot the system, neither cache_postsuspend nor
> > > cache_dtr get called. This might simply be expected behavior, but it means
> > > that the in-memory superblock structure doesn't get written out to disk upon
> > > reboot. Just to be sure, I put a printk into __commit_transaction. It prints
> > > out for 'dmsetup info' and 'dmsetup remove' but nothing at reboot.
> >
> > We don't have reboot notifiers that auto-magically tear down an
> > artbitrary DM stack. Typically the device shutdown includes unmounting
> > filesystems, stopping LVM (which tears down DM devices, etc).
> >
> > So given that we don't have any userspace LVM2 support for dm-cache yet
> > I'm not surprised by this. In fact it is expected.
> >
> > > Second, cache_status calls dm_cache_commit, which writes out a superblock to
> > > the metadata device. However, there's no call to save_stats to copy the
> > > current values of the counters out to the disk's copy prior to calling
> > > dm_cache_commit. Therefore, we seem to be writing out stale copies of
> > > superblock fields.
> > >
> > > The second one seems fixable with the attached patch
> >
> > I'll defer to Joe on this but I think sync_metadata() is pretty heavy to
> > be doing every 'dmsetup info'. BTW, with just dm_cache_commit() the
> > superblock fields aren't stale; only the on-disk hints are.
>
> Hrmm, how about this: dmsetup info will call save_stats so that the superblock
> gets written with the freshest hit/miss counts, and I'll create a new dmsetup
> message command that actually flushes everything out?
That sounds better.
next prev parent reply other threads:[~2013-05-09 20:47 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-08 21:48 dm-cache not writing out cache metadata at reboot? Darrick J. Wong
2013-05-08 22:05 ` Mike Snitzer
2013-05-08 23:23 ` Darrick J. Wong
2013-05-09 20:36 ` Darrick J. Wong
2013-05-09 20:44 ` [PATCH 1/2] dmcache: flush superblock stats when retrieving status info Darrick J. Wong
2013-05-10 10:10 ` Joe Thornber
2013-05-10 12:53 ` Mike Snitzer
2013-05-09 20:47 ` Mike Snitzer [this message]
2013-05-09 20:47 ` [PATCH 2/2] dmcache: Implement a flush message Darrick J. Wong
2013-05-10 10:22 ` [dm-devel] " Joe Thornber
2013-05-10 17:51 ` Darrick J. Wong
2013-05-11 15:25 ` Mike Snitzer
2013-05-13 12:04 ` Peter Rajnoha
2013-05-13 21:36 ` [dm-devel] " Darrick J. Wong
2013-05-10 10:05 ` [dm-devel] dm-cache not writing out cache metadata at reboot? Joe Thornber
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=20130509204701.GA2383@redhat.com \
--to=snitzer@redhat.com \
--cc=darrick.wong@oracle.com \
--cc=dm-devel@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=thornber@redhat.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