Linux Device Mapper development
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@redhat.com>
To: dm-devel@redhat.com
Cc: ejt@redhat.com
Subject: Re: [PATCH 2/3] dm thin metadata: do not write metadata if no changes occurred
Date: Mon, 15 Apr 2019 22:39:03 -0400	[thread overview]
Message-ID: <20190416023903.GA19565@redhat.com> (raw)
In-Reply-To: <20190415211717.18737-3-snitzer@redhat.com>

On Mon, Apr 15 2019 at  5:17pm -0400,
Mike Snitzer <snitzer@redhat.com> wrote:

> Otherwise, just loading a thin-pool and then removing it will cause its
> metadata to be changed (e.g. superblock written) -- even without any
> thin devices being made active or metadata snapshot being manipulated.
> 
> Add 'changed' flag to struct dm_pool_metadata.  Set both td->changed and
> pmd->changed using __set_thin_changed() -- this assures pmd->changed is
> always set when td->changed is.  For methods that don't involve changing
> a td, set pmd->changed directly.
> 
> Rename __delete_device() to __delete_thin() -- improves symmetry with
> __create_thin().
> 
> Update dm_pool_changed_this_transaction() to simply return pmd->changed.
> 
> Fix dm_pool_commit_metadata() to open the next transaction if the return
> from __commit_transaction() is 0.  Not seeing why the early return ever
> made since for a return of 0 given that dm-io's async_io(), as used by
> bufio, always returns 0.

This v1 patch was incomplete.  However this approach's need to establish
pmd->changed everywhere that alters metadata, without doing so in terms
of a thin device, is like whack-a-mole.

But I think this could be simplified to only set a 'pmd->accessed'
(never clear it) and only__commit_transaction() if pmd->accessed --
so only pool messages that change metadata would need to set
pmd->accessed.

  reply	other threads:[~2019-04-16  2:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-15 21:17 [PATCH 0/3] dm thin metadata: handful of improvements Mike Snitzer
2019-04-15 21:17 ` [PATCH 1/3] dm space map common: zero entire ll_disk Mike Snitzer
2019-04-15 21:17 ` [PATCH 2/3] dm thin metadata: do not write metadata if no changes occurred Mike Snitzer
2019-04-16  2:39   ` Mike Snitzer [this message]
2019-04-17  1:30     ` [PATCH v2 " Mike Snitzer
2019-04-15 21:17 ` [PATCH 3/3] dm thin metadata: check __commit_transaction()'s return Mike Snitzer

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=20190416023903.GA19565@redhat.com \
    --to=snitzer@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=ejt@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