Skip to contentSkip to conversation

Does LVM-LV take system cache?

linux-lvm Kirby Zhou 2 participants 3 messages Sep 6, 2010 – Sep 7, 2010

lore
Share & tools
lore

Kirby Zhou

author
#0 lore raw

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.

Regards

Kirby Zhou

#1 lore raw

Re: [linux-lvm] Does LVM-LV take system cache? Sure.

Quoted 17 lines · Kirby Zhou

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.

Quoted 6 lines

[@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

author
#2 lore raw

Re: [linux-lvm] Does LVM-LV take system cache? Sure.

Thanks very much,
the fact is actually what you said.

Regards,
Kirby Zhou
from SOHU-RD +86-10-6272-8261

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Lars Ellenberg
Sent: Tuesday, September 07, 2010 4:17 AM
To: [email protected]
Subject: Re: [linux-lvm] Does LVM-LV take system cache? Sure.

Quoted 17 lines · Kirby Zhou

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.

Quoted 6 lines

[@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

_______________________________________________
linux-lvm mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO@http://tldp.org/HOWTO/LVM-HOWTO/