Bug 435182
Summary: | [RHEL5] poor 64 bit Intel performance on sorting program | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 5 | Reporter: | Alan Matsuoka <alanm> |
Component: | glibc | Assignee: | Jakub Jelinek <jakub> |
Status: | CLOSED ERRATA | QA Contact: | Brian Brock <bbrock> |
Severity: | high | Docs Contact: | |
Priority: | high | ||
Version: | 5.1 | CC: | cmarcant, drepper, fweimer, fyamazaki, tao |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2009-01-20 20:50:12 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: | |||
Bug Depends On: | |||
Bug Blocks: | 391501 |
Description
Alan Matsuoka
2008-02-27 20:00:31 UTC
OK. Here's the short answer. The performance problem that they are seeing with the RHEL, x86_64 combination and not with Fedora is quite simple. There was a change in libc for Fedora Core 8 for msort and qsort. http://sourceware.org/cgi-bin/cvsweb.cgi/libc/ChangeLog.diff?cvsroot=glibc&only_with_tag=fedora-branch&r1=1.8782.2.274&r2=1.8782.2.275 +2007-10-04 Jakub Jelinek <jakub> + + * stdlib/msort.c: Include stdint.h. + (struct msort_param): New type. + (msort_with_tmp): Use struct msort_param pointer for unchanging + parameters. Add optimized handling for several common sizes + and indirect sorting mode. + (qsort): Adjust msort_with_tmp callers. For big S use indirect + sorting. + Suggested by Belazougui Djamel . + + * stdlib/Makefile (tests): Add tst-qsort2. + * stdlib/tst-qsort2.c: New test. http://sourceware.org/cgi-bin/cvsweb.cgi/libc/stdlib/msort.c.diff?cvsroot=glibc&only_with_tag=fedora-branch&r1=1.21&r2=1.21.2.1 see : http://www.cygwin.com/ml/libc-alpha/2007-05/msg00022.html for the rationale Doing a bit of hacking and code substitution with the FC 8 version of msort and qsort gcc -O3 -I. -g -o sorttestnew sorttest.c msortnew.c qsortnew.c -lm msortnew.c: In function ‘msort_with_tmp’: msortnew.c:142: warning: cast to pointer from integer of different size msortnew.c:148: warning: cast to pointer from integer of different size [alanm@dt1 TEST]$ time ./sorttestnew 20 66.331u 0.637s 1:07.10 99.7% 0+0k 0+0io 0pf+0w [alanm@dt1 TEST]$ gcc -m32 -O3 -I. -g -o sorttestnew.m32 sorttest.c msortnew.c qsortnew.c -lm [alanm@dt1 TEST]$ time ./sorttestnew.m32 20 69.026u 0.659s 1:09.71 99.9% 0+0k 0+0io 2pf+0w ## This is the RHEL5 libc [alanm@dt1 TEST]$ time ./sorttest 20 187.127u 0.642s 3:07.80 99.9% 0+0k 0+0io 0pf+0w [alanm@dt1 TEST]$ time ./sorttest.m32 20 71.298u 0.683s 1:12.12 99.7% 0+0k 0+0io 4pf+0w Note that there is a 3X improvement in 64 bit mode for this particular testcase. This would be a better result than you would get because qsort and msort are not compiled with -fPIC in the hacked together case. I'll post the longer answer (how I arrived at this conclusion later today). 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. 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/RHBA-2009-0080.html Do you think that this problem applys on RHEL4, too? If it is so, do you have any plan to fix it on RHEL4? We are having the same experience on RHEL4. Yes, this problem does apply to RHEL4 as well. The BZ filed against RHEL4 can be found here: https://bugzilla.redhat.com/show_bug.cgi?id=436115 For RHEL4, this bug is CLOSED WONTFIX, as it is very late in the RHEL4 lifecycle. |