Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 4 product line. The current stable release is 4.9. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 174834

Summary: kernel dm: memory issues cause "failures" when creating many snapshots
Product: Red Hat Enterprise Linux 4 Reporter: Corey Marthaler <cmarthal>
Component: kernelAssignee: Milan Broz <mbroz>
Status: CLOSED ERRATA QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: 4.0CC: agk, dwysocha, helei_1985_2002, jbrassow, mbroz, pvrabec, rkenna
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHBA-2007-0791 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-11-15 16:13:18 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Corey Marthaler 2005-12-02 16:35:42 UTC
Description of problem:
After creating 31 snapshots, any other snapshot attempts "fails" due to memory
problems while trying to be activated. They due however show up in an lvscan,
however not as snapshot volumes until all the other previous snapshots are deleted.

output from lvcreate cmds:
  Logical volume "lvol31" created
  Rounding up size to full physical extent 52.00 MB
  device-mapper ioctl cmd 9 failed: Cannot allocate memory
  Failed to suspend origin lvol0
  Rounding up size to full physical extent 52.00 MB
  device-mapper ioctl cmd 9 failed: Cannot allocate memory
  Failed to suspend origin lvol0

messages:
device-mapper: Could not create kcopyd client
device-mapper: error adding target to table
device-mapper: Could not create kcopyd client
device-mapper: error adding target to table

[root@morph-01 ~]# lvscan
  ACTIVE   Original '/dev/snapper/lvol0' [400.00 GB] inherit
  ACTIVE            '/dev/snapper/lvol32' [52.00 MB] inherit
  ACTIVE            '/dev/snapper/lvol33' [52.00 MB] inherit
  ACTIVE            '/dev/snapper/lvol34' [52.00 MB] inherit
  ACTIVE            '/dev/snapper/lvol35' [52.00 MB] inherit
  ACTIVE            '/dev/snapper/lvol36' [52.00 MB] inherit
  ACTIVE            '/dev/snapper/lvol37' [52.00 MB] inherit
  ACTIVE            '/dev/snapper/lvol38' [52.00 MB] inherit
  ACTIVE            '/dev/snapper/lvol39' [52.00 MB] inherit
  ACTIVE            '/dev/snapper/lvol40' [52.00 MB] inherit
  ACTIVE   Snapshot '/dev/snapper/lvol1' [52.00 MB] inherit
  ACTIVE   Snapshot '/dev/snapper/lvol2' [52.00 MB] inherit
  ACTIVE   Snapshot '/dev/snapper/lvol3' [52.00 MB] inherit
  ACTIVE   Snapshot '/dev/snapper/lvol4' [52.00 MB] inherit
  ACTIVE   Snapshot '/dev/snapper/lvol5' [52.00 MB] inherit
  ACTIVE   Snapshot '/dev/snapper/lvol6' [52.00 MB] inherit
  ACTIVE   Snapshot '/dev/snapper/lvol7' [52.00 MB] inherit
  ACTIVE   Snapshot '/dev/snapper/lvol8' [52.00 MB] inherit
  ACTIVE   Snapshot '/dev/snapper/lvol9' [52.00 MB] inherit
  ACTIVE   Snapshot '/dev/snapper/lvol10' [52.00 MB] inherit
  ACTIVE   Snapshot '/dev/snapper/lvol11' [52.00 MB] inherit
  ACTIVE   Snapshot '/dev/snapper/lvol12' [52.00 MB] inherit
  ACTIVE   Snapshot '/dev/snapper/lvol13' [52.00 MB] inherit
  ACTIVE   Snapshot '/dev/snapper/lvol14' [52.00 MB] inherit
  ACTIVE   Snapshot '/dev/snapper/lvol15' [52.00 MB] inherit
  ACTIVE   Snapshot '/dev/snapper/lvol16' [52.00 MB] inherit
  ACTIVE   Snapshot '/dev/snapper/lvol17' [52.00 MB] inherit
  ACTIVE   Snapshot '/dev/snapper/lvol18' [52.00 MB] inherit
  ACTIVE   Snapshot '/dev/snapper/lvol19' [52.00 MB] inherit
  ACTIVE   Snapshot '/dev/snapper/lvol20' [52.00 MB] inherit
  ACTIVE   Snapshot '/dev/snapper/lvol21' [52.00 MB] inherit
  ACTIVE   Snapshot '/dev/snapper/lvol22' [52.00 MB] inherit
  ACTIVE   Snapshot '/dev/snapper/lvol23' [52.00 MB] inherit
  ACTIVE   Snapshot '/dev/snapper/lvol24' [52.00 MB] inherit
  ACTIVE   Snapshot '/dev/snapper/lvol25' [52.00 MB] inherit
  ACTIVE   Snapshot '/dev/snapper/lvol26' [52.00 MB] inherit
  ACTIVE   Snapshot '/dev/snapper/lvol27' [52.00 MB] inherit
  ACTIVE   Snapshot '/dev/snapper/lvol28' [52.00 MB] inherit
  ACTIVE   Snapshot '/dev/snapper/lvol29' [52.00 MB] inherit
  ACTIVE   Snapshot '/dev/snapper/lvol30' [52.00 MB] inherit
  ACTIVE   Snapshot '/dev/snapper/lvol31' [52.00 MB] inherit

[root@morph-01 ~]# lvremove -f /dev/snapper/lvol*
  Can't remove logical volume "lvol0" under snapshot
  Logical volume "lvol1" successfully removed
  Logical volume "lvol2" successfully removed
  Logical volume "lvol3" successfully removed
  Logical volume "lvol4" successfully removed
  Logical volume "lvol5" successfully removed
  Logical volume "lvol6" successfully removed
  Logical volume "lvol7" successfully removed
  Logical volume "lvol8" successfully removed
  Logical volume "lvol9" successfully removed
  Logical volume "lvol10" successfully removed
  Logical volume "lvol11" successfully removed
  Logical volume "lvol12" successfully removed
  Logical volume "lvol13" successfully removed
  Logical volume "lvol14" successfully removed
  Logical volume "lvol15" successfully removed
  Logical volume "lvol16" successfully removed
  Logical volume "lvol17" successfully removed
  Logical volume "lvol18" successfully removed
  Logical volume "lvol19" successfully removed
  Logical volume "lvol20" successfully removed
  Logical volume "lvol21" successfully removed
  Logical volume "lvol22" successfully removed
  Logical volume "lvol23" successfully removed
  Logical volume "lvol24" successfully removed
  Logical volume "lvol25" successfully removed
  Logical volume "lvol26" successfully removed
  Logical volume "lvol27" successfully removed
  Logical volume "lvol28" successfully removed
[root@morph-01 ~]# lvscan
  ACTIVE            '/dev/snapper/lvol0' [400.00 GB] inherit
  ACTIVE            '/dev/snapper/lvol32' [52.00 MB] inherit
  ACTIVE            '/dev/snapper/lvol33' [52.00 MB] inherit
  ACTIVE            '/dev/snapper/lvol34' [52.00 MB] inherit
  ACTIVE            '/dev/snapper/lvol35' [52.00 MB] inherit
  ACTIVE            '/dev/snapper/lvol36' [52.00 MB] inherit
  ACTIVE            '/dev/snapper/lvol37' [52.00 MB] inherit
  ACTIVE            '/dev/snapper/lvol38' [52.00 MB] inherit
  ACTIVE            '/dev/snapper/lvol39' [52.00 MB] inherit
  ACTIVE            '/dev/snapper/lvol40' [52.00 MB] inherit

Version-Release number of selected component (if applicable):
Kernel 2.6.9-22.0.1.ELhugemem on an i686
lvm2-2.02.01-1.0.RHEL4
device-mapper-1.02.01-1.0.RHEL4

How reproducible:
everytime

Comment 1 Corey Marthaler 2005-12-05 19:07:48 UTC
This appears to always happen at the 32nd (or greater) snap attempt.

Comment 2 Alasdair Kergon 2005-12-09 17:39:03 UTC
Ought to add recovery code that deletes the snapshot if its creation failed.


Comment 3 Corey Marthaler 2006-01-18 22:12:22 UTC
FWIW: I'm still seeing this and now only after 14 snapshots.

Comment 4 Alasdair Kergon 2006-03-15 18:43:33 UTC
Need to try to improve or parameterise kcopyd memory usage.

Comment 13 Jason Baron 2007-07-03 22:30:29 UTC
committed in stream U6 build 55.16. A test kernel with this patch is available
from http://people.redhat.com/~jbaron/rhel4/


Comment 16 errata-xmlrpc 2007-11-15 16:13:18 UTC
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 the 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/RHBA-2007-0791.html