FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Device-mapper Development

 
 
LinkBack Thread Tools
 
Old 01-20-2012, 12:54 AM
Mikulas Patocka
 
Default block: Invalidate the cache for a parent block-device

Hi

This definitely doesn't belong to blkdev_issue_flush.

blkdev_issue_flush is called by filesystems each time they want to
synchronize hardware disk cache (for example, when committing a journal).

The patch may cause serious performance regressions (each time a
filesystem commits journal, the patch causes it to walk all buffers in the
whole-disk device).

You should put this code into fsync_bdev (so that it is called only on
fsync or BLKFLSBUF) and not to blkdev_issue_flush.

Mikulas

> Executing a BLKFLSBUF-ioctl on a partition flushes the caches for that
> partition but reading data through the parent device will still return
> the old cached data.
>
> The cache for the block-device is not synced if the block-device is kept
> open (due to a mounted partition, for example). Only when all users for
> the disk have exited, the cache for the disk is made consistent again.
>
> Calling invalidate_bdev() on the parent block-device in case
> blkdev_issue_flush() was called for a partition fixes this.
>
> The problem can be worked around by forcing the caches to be flushed
> with either
> # blockdev --flushbufs ${dev_disk}
> or
> # echo 3 > /proc/sys/vm/drop_caches
>
> CC: Bryn M. Reeves <bmr <at> redhat.com>
> Signed-off-by: Niels de Vos <ndevos <at> redhat.com>
> ---
> block/blk-flush.c | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/block/blk-flush.c b/block/blk-flush.c
> index 720ad60..e876f8e 100644
> --- a/block/blk-flush.c
> +++ b/block/blk-flush.c
> @@ -448,6 +448,9 @@ int blkdev_issue_flush(struct block_device *bdev, gfp_t gfp_
>
> if (!bio_flagged(bio, BIO_UPTODATE))
> ret = -EIO;
> + else if (bdev != bdev->bd_contains)
> + /* invalidate parent block_device */
> + invalidate_bdev(bdev->bd_contains);
>
> bio_put(bio);
> return ret;
> --
> 1.7.6.5
>

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel

Fri Jan 20 04:30:02 2012
Return-path: <devel-bounces@lists.fedoraproject.org>
Envelope-to: tom@linux-archive.org
Delivery-date: Fri, 20 Jan 2012 04:01:54 +0200
Received: from bastion01.fedoraproject.org ([209.132.181.2]:56104 helo=bastion.fedoraproject.org)
by s2.java-tips.org with esmtp (Exim 4.69)
(envelope-from <devel-bounces@lists.fedoraproject.org>)
id 1Ro3ne-0005CY-5r
for tom@linux-archive.org; Fri, 20 Jan 2012 04:01:54 +0200
Received: from lists.fedoraproject.org (collab03.vpn.fedoraproject.org [192.168.1.70])
by bastion01.phx2.fedoraproject.org (Postfix) with ESMTP id B1D4E212E0;
Fri, 20 Jan 2012 02:01:54 +0000 (UTC)
Received: from collab03.fedoraproject.org (localhost [127.0.0.1])
by lists.fedoraproject.org (Postfix) with ESMTP id 3300B41F29;
Fri, 20 Jan 2012 02:01:54 +0000 (UTC)
X-Original-To: devel@lists.fedoraproject.org
Delivered-To: devel@lists.fedoraproject.org
Received: from smtp-mm02.fedoraproject.org (smtp-mm02.fedoraproject.org
[66.35.62.164])
by lists.fedoraproject.org (Postfix) with ESMTP id 0B6F74153B
for <devel@lists.fedoraproject.org>;
Fri, 20 Jan 2012 02:01:52 +0000 (UTC)
Received: from mail-we0-f173.google.com (mail-we0-f173.google.com
[74.125.82.173])
by smtp-mm02.fedoraproject.org (Postfix) with ESMTP id 8F63A407C6
for <devel@lists.fedoraproject.org>;
Fri, 20 Jan 2012 02:01:51 +0000 (UTC)
Received: by werc1 with SMTP id c1so62126wer.32
for <devel@lists.fedoraproject.org>;
Thu, 19 Jan 2012 18:01:50 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
h=message-id:date:from:user-agent:mime-version:to:subject:references
:in-reply-to:content-type:content-transfer-encoding;
bh=/X99mOFIOpmcCvu5L9TZrc76my9HVfLSQhFVugW0eYI=;
b=JlpSPIxyfQWkpBrc6VfoNdS8rbBo3qJMSj9QzY7ob/1S2Y84xi9WPrnttvWTdp6Pvg
vo1N/rNgLC24n9ePMnJA0X/Y3KbKY+jsNl6KzXz9+W4Eu9YWtCnLrpTjLYEL/MgNjTsO
+pmMekTHXZ5as/Lvbni86rVUXm6jCChVDyoxo=
Received: by 10.216.136.27 with SMTP id v27mr9362241wei.45.1327024910779;
Thu, 19 Jan 2012 18:01:50 -0800 (PST)
Received: from localhost.localdomain (85-220-55-128.dsl.dynamic.simnet.is.
[85.220.55.128])
by mx.google.com with ESMTPS id bu13sm3935510wib.6.2012.01.19.18.01.49
(version=SSLv3 cipher=OTHER); Thu, 19 Jan 2012 18:01:50 -0800 (PST)
Message-ID: <4F18CADA.9030703@gmail.com>
Date: Fri, 20 Jan 2012 02:00:58 +0000
From: =?UTF-8?B?IkrDs2hhbm4gQi4gR3XDsG11bmRzc29uIg==?=
<johannbg@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
rv:9.0) Gecko/20111222 Thunderbird/9.0
MIME-Version: 1.0
To: devel@lists.fedoraproject.org
Subject: Re: [ACTION REQUIRED] Retiring packages for F-17
References: <20120113161113.GA6202@nostromo.devel.redhat.com >
<jeq2lu$8iu$1@dough.gmane.org> <20120113225100.4cb65249@gmail.com>
<20120114071636.254ad349@jelerak.scrye.com>
<jesgjb$nub$2@dough.gmane.org> <1327015850.1603.6.camel@adam>
<1327017050.2250.20.camel@sgallagh520.sgallagh.bos .redhat.com>
In-Reply-To: <1327017050.2250.20.camel@sgallagh520.sgallagh.bos .redhat.com>
X-BeenThere: devel@lists.fedoraproject.org
X-Mailman-Version: 2.1.12
Precedence: list
Reply-To: Development discussions related to Fedora
<devel@lists.fedoraproject.org>
List-Id: Development discussions related to Fedora
<devel.lists.fedoraproject.org>
List-Unsubscribe: <https://admin.fedoraproject.org/mailman/options/devel>,
<mailto:devel-request@lists.fedoraproject.org?subject=unsubscrib e>
List-Archive: <http://lists.fedoraproject.org/pipermail/devel/>
List-Post: <mailto:devel@lists.fedoraproject.org>
List-Help: <mailto:devel-request@lists.fedoraproject.org?subject=help>
List-Subscribe: <https://admin.fedoraproject.org/mailman/listinfo/devel>,
<mailto:devel-request@lists.fedoraproject.org?subject=subscribe>
Content-Transfer-Encoding: base64
Content-Type: text/plain; charset="utf-8"; Format="flowed"
Sender: devel-bounces@lists.fedoraproject.org
Errors-To: devel-bounces@lists.fedoraproject.org

T24gMDEvMTkvMjAxMiAxMTo1MCBQTSwgU3RlcGhlbiBHYWxsYW doZXIgd3JvdGU6Cj4gWWVzLCBJ
IGFncmVlIHdpdGggdGhpcyBjb21wbGV0ZWx5LiBJZiBzb21ldG hpbmcgaXMgbm90IGJlaW5nIG1h
aW50YWluZWQKPiBpbiBGZWRvcmEsIGl0J3MgYmV0dGVyIHRvIH JldGlyZSBpdC4gVGhlbiBhIHVz
ZXIgd2hvIHdhbnRzIHRoYXQgcGllY2Ugb2YKPiBzb2Z0d2FyZS B3aWxsIGhhdmUgdHdvIG9wdGlv
bnM6Cj4gMSkgVGhleSBjYW4gYnVpbGQgaXQgYW5kIG1haW50YW luIGl0IHRoZW1zZWx2ZXMgb24g
dGhlaXIgb3duIHN5c3RlbShzKQo+IDIpIFRoZXkgY2FuIGNob2 9zZSB0byBidWlsZCBhbmQgbWFp
bnRhaW4gaXQgZm9yIEZlZG9yYSBieSB1bnJldGlyaW5nIGl0Lg o+Cj4gRWl0aGVyIHdheSwgdGhl
eSB3aWxsIG5vdCBiZSBnaXZlbiBhIGZhbHNlIHNlbnNlIHRoYX QgdGhlIHBhY2thZ2UgaXMKPiBi
ZWluZyBtYWludGFpbmVkLgoKQWdyZWVkIGFuZCBvbmUgdGhpbm cgdGhhdCBzZWVtcyB0byBiZSBs
ZWZ0IG91dCBvZiB0aGlzIGRpc2N1c3Npb24gaXMgCnRoYXQgd2 UgYXJlIHNwZW5kaW5nIHJlc291
cmNlIG9uIHRob3NlIHVubWFpbnRhaW5lZCBwYWNrYWdlcyAoIA podytyZWxlbmcvcHJvdmVuIHBh
Y2thZ2VycyBmb3IgZXhhbXBsZSApLgoKSnVzdCB0byBrZWVwIH RoZW0gcm9sbGluZyBpbiBhbmQg
YmV0d2VlbiByZWxlYXNlcyB3aGljaCBhcmd1YWJsZSBjb3VsZC AKYmUgYmV0dGVyIHNwZW50IGVs
c2V3aGVyZSBsaWtlIG9uIHBhY2thZ2UgdGhhdCBhY3R1YWxseS BhcmUgYmVpbmcgCm1haW50YWlu
ZWQgb3IgdG8gYXNzaXN0IG1haW50YWluZXJzIHRoYXQgYXJlIG 92ZXJsb2FkZWQgZXRjLi4uCgpK
QkcKLS0gCmRldmVsIG1haWxpbmcgbGlzdApkZXZlbEBsaXN0cy 5mZWRvcmFwcm9qZWN0Lm9yZwpo
dHRwczovL2FkbWluLmZlZG9yYXByb2plY3Qub3JnL21haWxtYW 4vbGlzdGluZm8vZGV2ZWw=
 

Thread Tools




All times are GMT. The time now is 09:01 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org