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:

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