All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: dm-devel@redhat.com
Subject: Re: Is there a way to see updated contents of a	DM target's underlying device while the DM target is in use?
Date: Fri, 02 Jul 2010 16:52:19 +0200	[thread overview]
Message-ID: <4C2DFD23.6070500@suse.de> (raw)
In-Reply-To: <20100701190017.GC12613@us.ibm.com>

Malahal Naineni wrote:
> Riches Jr, RobertX M [robertx.m.riches.jr@intel.com] wrote:
>> Many thanks to those who responded with helpful suggestions.  A couple of the suggestions were sufficient to make my test script behave as I expect--to liberate the data that had been stuck in the page cache twilight zone.  :-)
>>
>> For the benefit of anyone who might come across the archives with a similar problem, here's what worked and what didn't, with all actions taken between writing and reading:
>>
>>   - Using 'dd -iflag=direct' to read from /dev/vg1/lv1 (the underlying device) worked.
>>
>>   - Doing 'blockdev --flushbufs /dev/vg1/lv1' (on the underlying device) worked.
>>
>>   - Doing 'blockdev --flushbufs /dev/mapper/fred01' (on the device exposed by dm-linear or my module) did not solve the problem.
> 
> I wonder why flushing the underlying device worked but not the actual
> device itself. I expected the opposite! :-(
> 
Why, no. That's exactly the point.
The device keeps the underlying block devices pinned in the cache, so any page invalidation can only be triggered
by the device itself, not the underlying ones. Any writes to the underlying devices won't trigger a page
invalidation, so they'll stay in the cache forever.
Hence you need to flush them explicitely.

Not that I'll recommend that. It'll play silly buggers with the page cache.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		      zSeries & Storage
hare@suse.de			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Markus Rex, HRB 16746 (AG Nürnberg)

  reply	other threads:[~2010-07-02 14:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-30 22:54 Is there a way to see updated contents of a DM target's underlying device while the DM target is in use? Riches Jr, RobertX M
2010-06-30 23:08 ` Alasdair G Kergon
2010-06-30 23:53   ` Riches Jr, RobertX M
2010-07-01  0:51     ` Alasdair G Kergon
2010-07-01  1:01       ` Alasdair G Kergon
2010-07-01  1:03       ` Malahal Naineni
2010-07-01  1:49         ` Alasdair G Kergon
2010-07-01 16:46       ` Riches Jr, RobertX M
2010-07-01 19:00         ` Malahal Naineni
2010-07-02 14:52           ` Hannes Reinecke [this message]
2010-07-01  0:54     ` Malahal Naineni
2010-07-01  0:22 ` Neil Brown
2010-07-01  0:58   ` Malahal Naineni

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=4C2DFD23.6070500@suse.de \
    --to=hare@suse.de \
    --cc=dm-devel@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 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.