Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 725580

Summary: Improve sysfs performance when many block devices are created
Product: Red Hat Enterprise Linux 6 Reporter: Mikuláš Patočka <mpatocka>
Component: kernelAssignee: Mikuláš Patočka <mpatocka>
Status: CLOSED ERRATA QA Contact: Petr Beňas <pbenas>
Severity: high Docs Contact:
Priority: high    
Version: 6.1CC: abaron, agk, bdonahue, coughlan, eguan, mbroz, mgoldboi, pbenas, pstehlik, ykaul, zkabelac
Target Milestone: rcFlags: mpatocka: needinfo+
Target Release: 6.2   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: kernel-2.6.32-188.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 13:54:28 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 Mikuláš Patočka 2011-07-25 21:49:42 UTC
Sysfs contains algorithms that perform quadratically with respect to the number of entries in a directory. As a result, sysfs slows down operation when working with many (thousands ~ ten thousands) block devices.

Comment 2 RHEL Program Management 2011-07-25 22:20:15 UTC
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 4 Mikuláš Patočka 2011-07-29 13:36:08 UTC
We need good performance when working with many (thousands) block devices.

These tests were done:

1. create 10000 block devices
time for i in `seq 0 9999`; do echo $i; dmsetup create test$i --notable; done
2. list the devices
time ls -la /sys/block
3. flush cache and list the devices
echo 3 >/proc/sys/vm/drop_caches; time ls -la /sys/block
4. remove the devices
time dmsetup remove_all

Time before the patches (on current RHEL-6 kernel):
141s, 2.1s, 2.4s, 63s
Time after the patches
25s, 0.5s, 0.8s, 8.8s

The effect of individual patches on upstream kernel 3.0-rc7 can be seen here:
http://www.redhat.com/archives/dm-devel/2011-July/msg00073.html

Comment 10 Kyle McMartin 2011-08-15 12:50:14 UTC
Patch(es) available on kernel-2.6.32-188.el6

Comment 15 Petr Beňas 2011-08-22 07:37:15 UTC
Reproduced in 2.6.32-187.el6.x86_64 and verified in 2.6.32-188.el6.x86_64.

Comment 16 errata-xmlrpc 2011-12-06 13:54:28 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

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