7月 16th, 2010
以前、Solaris(Sparc)環? 上ぜ “Sun Studio C Compiler”でコンパイルしたプログラムによる配列の初期化パフォーマン゜ の? 証のところぜ memsetの話題を挙げましたが、64bit Linux(x86_64)環? においても、あるバージョンぜ glibcで同関数パフォーマンスに影響を圏 ぼす可能性が゜ かったので調査してみました。前回同様、1024バイト配列ぜ memset初期化を1,000,000回ループさるプログラムの処理時間で? 較を行いました。また、様々なバイトの配列でも試してみました。以? がその? 果です。
■glibc-2.5-24.x86_64
1024バイト配列: 平均 0.048秒
1024*10バイト配列: 平均 0.436秒
1024*100バイト配列: 平均 6.331秒
1024*117バイト配列: 平均 7.385秒
1024*118バイト配列: 平均 36.644秒
1024*1000バイト配列: 平均304.943秒
■glibc-2.5-42.x86_64
1024バイト配列: 平均 0.029秒
1024*10バイト配列: 平均 0.216秒
1024*100バイト配列: 平均 5.187秒
1024*117バイト配列: 平均 6.074秒
1024*118バイト配列: 平均 6.130秒
1024*1000バイト配列: 平均51.958秒
上記の? 果のように、glibc-2.5.24のパフォーマンスが2.5.42よりも劣化するということ。更に配列のサイ゜ 1024*118を超えた時点で、パフォーマンスが著しぜ 劣化するという点が挙げられます。おそらぜ 2.5.32以降で対応した修正パッケージとパッチが以? のものだと思゜ れます。memsetのコードは朮 どアセンブラなので、修正内容はあまり理解出来ません。コメントにぜ PIC(Position Independent Code)の文字が見られ、もしかしたらgccオプション「-fPIC」が使用される共有ライブラリでは更に性能が異なるのかもしれません。
http://rhn.redhat.com/errata/RHBA-2009-0080.html
an optimized memset() routine for AMD64 and Intel 64 systems has been added.
glibc-rh437394.patch
2008-08-14 Ulrich Drepper <drepper@redhat.com>
* sysdeps/x86_64/memset.S: Reduce size of tables for PIC.
2008-02-26 Harsha Jagasia <harsha.jagasia@amd.com>
* sysdeps/x86_64/memset.S: Rewrite non-SSE code path as tuned for AMD
Barcelona machine. Make default fall through branch of
__x86_64_preferred_memory_instruction check as the integer code path.
2007-10-15 Ulrich Drepper <drepper@redhat.com>
* sysdeps/x86_64/memset.S: Use __x86_64_shared_cache_size.
Always define bzero.
Remove non-glibc code.
7月 13th, 2010
OSSのメッセージを集めたOSS Message Pedia(http://ossmpedia.org)というサイトがありました。これぜ OSS(Open Source Software)が出力するメッセージのオンライン? 典で、システムで表示されているエラーメッセージや警告メッセージを検索して、その? 味と対処方? などの情報を引き出すことが出来るようになっています。例えば、以? のようぜ dmesgが出力されている場合、検索? 果からある程度の情報が引き出せます。
# dmesg | grep War
bonding: Warning: either miimon or arp_interval and arp_ip_target module parameters must be specified, \
otherwise bonding will not detect link failures! see bonding.txt for details.
bonding: bond0: Warning: failed to get speed and duplex from eth0, assumed to be 100Mb/sec and Full.
bonding: bond0: Warning: failed to get speed and duplex from eth1, assumed to be 100Mb/sec and Full.
メッセー゜ 1行目の? 索? 果
http://ossmpedia.org/messages/linux/2.6.9-34.EL/50981.ja
メッセー゜ 2,3行目の? 索? 果
http://ossmpedia.org/messages/linux/2.6.9-34.EL/50896.ja
1行目のメッセージは、Bondingのリンク監? パラメータ未設定の警告。ARP監? のパラメータ? arp_ip_target, arp_interval)は適用していますが、MIIリンク監? のパラメータ? miimon, updelay)は? けていない状態でした。どちらにしてもこぜ Warningは出力されるようです。
# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.2.4 (January 28, 2008)
Bonding Mode: fault-tolerance (active-backup)
Primary Slave: eth0
Currently Active Slave: eth0
MII Status: up
MII Polling Interval (ms): 0
Up Delay (ms): 0
Down Delay (ms): 0
ARP Polling Interval (ms): 3000
ARP IP target/s (n.n.n.n form): 192.168.100.1
Slave Interface: eth0
MII Status: up
Link Failure Count: 1
Permanent HW addr: xx:xx:xx:xx:xx:xx
Slave Interface: eth1
MII Status: up
Link Failure Count: 1
Permanent HW addr: xx:xx:xx:xx:xx:xx
2,3行目のメッセージは、システム起動時のネットワーク起動段障 で、通信速度? speed)ぜ duplex通信方? (duplex)の値を圏 得できないため、通信速度を100Mbps、通信方? をFullに「仮? 」したというメッセージであり、実際に「変更」した゜ けではないようです。まず、Bondingドライバのモードが「1:active-backup」であれば問題はなさそうです。
# ethtool eth0 | egrep 'Speed|Duplex'
Speed: 1000Mb/s
Duplex: Full
# ethtool eth1 | egrep 'Speed|Duplex'
Settings for eth1:
Speed: 1000Mb/s
Duplex: Full