Bug 466088 - dm-snapshot: very slow write to snapshot origin when copy-on-write occurs
dm-snapshot: very slow write to snapshot origin when copy-on-write occurs
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel (Show other bugs)
5.1
All Linux
medium Severity medium
: rc
: ---
Assigned To: Mikuláš Patočka
Boris Ranto
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-10-08 05:02 EDT by Kazuo Ito
Modified: 2011-01-13 15:43 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-01-13 15:43:48 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Kazuo Ito 2008-10-08 05:02:27 EDT
Description of problem:

Write to snapshot origin volumes, iff copy-on-write occurs,
are an order of magnitude slower than the other lvm writes.
The slowdown is more pronounced in cases of sequential writes.

A couple of measures to alleviate the problem have been floating
around the net, 1) to make snapshot origin and cow volumes
reside on separate disks, and 2) to patch kcopyd so that
it shouldn't reorder block write requests when process_jobs
fails to complete them because it run short of free pages.

I ran several tests and found that the patch (see attachment)
can make copy-on-write cases twice as fast as the non-patched kernel,
and, as a side note, that allocating more pages to kcopyd clients
does not help much.

Version-Release number of selected component (if applicable):

How reproducible:

Always.

Steps to Reproduce:
1. create a file on an LV, e.g. dd if=/dev/zero of=<path to the file> bs=4096 count=10240
2. create a snapshot of the volume
3. overwrite the file, e.g. dd if=/dev/zero of=<path to the file> \
  bs=4096 count=10240 conv=notrunc, followed by fsync
4. overwrite the file again, followed by fsync
  
Actual results:

3. is x10 -- x20 slower than 4.

Expected results:



Additional info:
Comment 1 Kazuo Ito 2008-10-23 22:56:48 EDT
An upstream patch for the problem has been queued in the 2.6.27-stable tree.
( http://git.kernel.org/?p=linux/kernel/git/stable/stable-queue.git;a=commit;h=576197a5ec84bde5889d4ac0df69aa427aa61f48 )

Its filename is dm-kcopyd-avoid-queue-shuffle.patch.
Comment 3 Mikuláš Patočka 2010-05-18 17:54:46 EDT
I think this patch could be ported to RHEL 5.6. It is simple and obviously correct.
Comment 4 RHEL Product and Program Management 2010-05-20 08:48:12 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.
Comment 6 Jarod Wilson 2010-09-21 16:58:53 EDT
in kernel-2.6.18-223.el5
You can download this test kernel (or newer) from http://people.redhat.com/jwilson/el5

Detailed testing feedback is always welcomed.
Comment 10 errata-xmlrpc 2011-01-13 15:43:48 EST
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-0017.html

Note You need to log in before you can comment on or make changes to this bug.