linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Lars Ellenberg <lars.ellenberg@linbit.com>
To: linux-lvm@redhat.com
Subject: Re: [linux-lvm] Does LVM-LV take system cache? Sure.
Date: Mon, 6 Sep 2010 22:16:34 +0200	[thread overview]
Message-ID: <20100906201634.GC2377@racke> (raw)
In-Reply-To: <001901cb4ddf$d3bff6d0$7b3fe470$@com>

On Tue, Sep 07, 2010 at 12:23:23AM +0800, Kirby Zhou wrote:
> Does LVM-LV take system cache?
> 
> In my test, it does not take system cache on a RHEL5 box, is it a bug or a
> feature?
> 
> Test1, run dd with raw block device, it seems system cache can boost up
> reread operation.
> 
> [@djt_18_69 ~]# dd if=/dev/sdc bs=1M of=/dev/null count=500
> 524288000 bytes (524 MB) copied, 1.88267 seconds, 278 MB/s
> [@djt_18_69 ~]# dd if=/dev/sdc bs=1M of=/dev/null count=500
> 524288000 bytes (524 MB) copied, 0.13445 seconds, 3.9 GB/s
>  
> 
> Test2, run dd with lv, it seems system cache CAN NOT boost up reread
> operation.
> 
> [@djt_18_69 ~]# dd if=/dev/vgext/lvtest5 bs=1M of=/dev/null count=500
> 524288000 bytes (524 MB) copied, 2.17848 seconds, 241 MB/s
> [@djt_18_69 ~]# dd if=/dev/vgext/lvtest5 bs=1M of=/dev/null count=500
> 524288000 bytes (524 MB) copied, 2.17451 seconds, 241 MB/s
> 
> Both 2.6.18-164.15.1.el5 and 2.6.18-194.el5 do the same behavior.

The last close() on a block device releases its cache.

As for sdc dd is most likely not the exclusive user at that time
(any mounts or other references on sdc itself, or its partitions,
count), dd's close() does not have this effect there.

Try this:

# sleep 3600 < /dev/vgext/lvtest5 & sleep_pid=$!
# dd if=/dev/vgext/lvtest5 bs=1M of=/dev/null count=500
# dd if=/dev/vgext/lvtest5 bs=1M of=/dev/null count=500
# kill $sleep_pid
# dd if=/dev/vgext/lvtest5 bs=1M of=/dev/null count=500

	Lars

  reply	other threads:[~2010-09-06 20:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-06 16:23 [linux-lvm] Does LVM-LV take system cache? Kirby Zhou
2010-09-06 20:16 ` Lars Ellenberg [this message]
2010-09-07  5:49   ` [linux-lvm] Does LVM-LV take system cache? Sure Kirby Zhou

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=20100906201634.GC2377@racke \
    --to=lars.ellenberg@linbit.com \
    --cc=linux-lvm@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;
as well as URLs for NNTP newsgroup(s).