InnoDB Spin rounds per wait在>32位机器上可能为负
今天发现一个系统innodb的spin rounds per wait为负,感觉很奇怪,原来是个bug:
For example (output from PS but we have no patches here), ----------
SEMAPHORES
----------
OS WAIT ARRAY INFO: reservation count 19811539060
OS WAIT ARRAY INFO: signal count 8333711487
Mutex spin waits 192857078576, rounds 290389036704, OS waits 1568180069
RW-shared spins 19747848205, rounds 565755834160, OS waits 14799492482
RW-excl spins 7774140570, rounds 144578121130, OS waits 3188338144
Spin rounds per wait: -697.30 mutex, -327.60 RW-shared, -177.22 RW-excl This is caused by (double) mutex_spin_round_count /
(mutex_spin_wait_count ? mutex_spin_wait_count : 1), conditional operator part: mutex_spin_wait_count is not an integral type var but a C++ object with type conversion operator to ib_int64_t. 1 is a constant of type (signed) int. Now C++ language rules somehow decide (credit to my colleague Igor Solodovnikov) that the type of the result of conditional operator is int too. This can also be confirmed by disassembling sync_print_wait_info: ...
leaq __ZL21mutex_spin_wait_count(%rip), %r15 # mutex_spin_wait_count.this to R15
...
addq 264(%rcx,%r15), %rdx # counter sum to RDX (only the final add shown, RCX = 0)
...
cvtsi2sdl %edx, %xmm1 # EDX not RDX! opcode is also for "doubleword integer"
...
divsd %xmm1, %xmm0 The bug was introduced together with ib_counter_t introduction. Before, the counter variables being plain integers were working OK (thus 5.5 is not affected) How to repeat:
Code analysis, running server long enough, then looking at the status. Suggested fix:
Probably the easiest fix is s/1/1ULL/g in the conditional operators. But at the same time observe that each counter object mention causes a fresh summation for the counter. Thus better to introduce local vars and to sum each counter only once. Also get rid of redundant typecasts in the first printf, and resolve the ib_int64_t / ib_uint64_t mismatch.
[18 Dec 2015 14:09] Laurynas Biveinis
Bug 79703 fix for 5.6 (*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it. Contribution: bug79703.patch (application/octet-stream, text), 3.17 KiB.
[18 Dec 2015 14:11] Laurynas Biveinis
With proposed patch integer to double conversion uses cvtsi2sdq %rax, %xmm2, which looks correct.
[29 Feb 20:52] Staffan Flink
We've also hit this bug but it seems that the correct numbers for 'Spin rounds per wait' can be retrieved from I_S.INNODB_METRICS. snippet output from 'SHOW ENGINE INNODB STATUS\G':
*************************** 1. row ***************************
Type: InnoDB
Name:
Status:
=====================================
2016-02-29 17:04:50 7f1613cb2700 INNODB MONITOR OUTPUT
=====================================
Per second averages calculated from the last 59 seconds
-----------------
BACKGROUND THREAD
-----------------
srv_master_thread loops: 27828639 srv_active, 0 srv_shutdown, 552 srv_idle
srv_master_thread log flush and writes: 27829190
----------
SEMAPHORES
----------
OS WAIT ARRAY INFO: reservation count 562748487
OS WAIT ARRAY INFO: signal count 4440218264
Mutex spin waits 4031631980, rounds 19046728943, OS waits 221855330
RW-shared spins 1337835479, rounds 10346069330, OS waits 159065324
RW-excl spins 436493896, rounds 12607401587, OS waits 149384138
Spin rounds per wait: -72.33 mutex, 7.73 RW-shared, 28.88 RW-excl Output from I_S.INNODB_METRICS:
mysql> use information_schema;
Database changed
mysql> select name,count,max_count,avg_count from INNODB_METRICS where name like '%spin%';
+-----------------------------+-------------+-------------+--------------------+
| name | count | max_count | avg_count |
+-----------------------------+-------------+-------------+--------------------+
| innodb_rwlock_s_spin_waits | 1338920718 | 1338920718 | 48.02786821549153 |
| innodb_rwlock_x_spin_waits | 436953500 | 436953500 | 15.673777268638679 |
| innodb_rwlock_s_spin_rounds | 10353523860 | 10353523860 | 371.3869483301454 |
| innodb_rwlock_x_spin_rounds | 12620856222 | 12620856222 | 452.7174844992445 |
+-----------------------------+-------------+-------------+--------------------+
4 rows in set (0.00 sec) This would suggests that it's 'SHOW ENGINE INNODB STATUS' that interprets the numbers incorrectly. For information, we're running 5.6.23.
InnoDB Spin rounds per wait在>32位机器上可能为负的更多相关文章
- 虚函数列表: 取出方法 // 虚函数工作原理和(虚)继承类的内存占用大小计算 32位机器上 sizeof(void *) // 4byte
#include <iostream> using namespace std; class A { public: A(){} virtual void geta(){ cout < ...
- 【转】一个从32位机器移植到64位机器时的c问题
原文网址:http://www.jiancool.com/article/96402954887/ 最近工作中遇到了一个讨厌的问题,在32位机器上运行的好好的,但是在64位机器上,出现了诡异的 Seg ...
- android studio 64位手机+Fresco引起的在arm64位机器上找不到对应的so库
我们的程序在32位机器上没有问题,有一天公司采购了一台魅族MX5 MTK的64位处理器上我们的应用报错了 "nativeLibraryDirectories=[/data/app/com.l ...
- 笔记:C语言数据类型在32位与64位机器上的字节数
读<深入理解计算机系统> 第二章 信息的表示与处理 32位与64位的典型值,单位字节 声明 32位机器 64位机器 char 1 1 short int int 4 4 long int ...
- 32位Windows7上8G内存使用感受+xp 32位下使用8G内存 (转)
32位Windows7上8G内存使用感受+xp 32位下使用8G内存 博客分类: Windows XPWindowsIE企业应用软件测试 我推荐做开发的朋友:赶快加入8G的行列吧....呵呵..超爽 ...
- Windows 8 64位系统 在VS2010 32位软件上 搭建 PCL点云库 开发环境
Windows 8 64位系统 在VS2010 32位软件上 搭建 PCL点云库 开发环境 下载PCL For windows 软件包 到这个网站下载PCL-All-In-One Installer: ...
- 如何在linux 32位机器编译64位程序
编译64位程序,不一定要编译机器是64位的,但是32位机器默认安装的gcc编译环境还是不能用来编译64位程序. 编译64位程序,需要加上-m64编译器参数,默认安装的gcc已经支持该参数,但是缺少64 ...
- Oracle 在64位机器上使用plSQL连接Oracle的问题(SQL*Net not properly installed)
问题: 在64位机器上了64位的oracle客户端. 然后装上PL/SQL Developer,但是连接oracle老报这个错: Initialization error SQL*Net n ...
- Windows 7,64位机器上安装DB2 7.2+FP7
1.要想在Windows 7,64位机器上安装DB2 7.2+FP7,注意:1)拷贝所有安装文件到本地2)设置setup.exe文件兼容windows 20003)使得users用户勾选“完全控制”权 ...
随机推荐
- iOS 中实现功能引导页面
// // guideView.h // 07-功能引导-李洪强 // // Created by vic fan on 16/1/4. // Copyright © 2016年 李洪强. A ...
- iOS开发中几个重要的方法
iOS开发中几个重要的方法: 加载类到内存,程序刚启动的时候调用,调用在main函数之前 1.+(void)load{ } 初始化类,类第一次使用的时候调用一次 2.+(void)initialize ...
- ubuntu su Authentication failure
这个问题产生的原因是由于ubtun系统默认是没有激活root用户的,需要我们手工进行操作,在命令行界面下,或者在终端中输入如下命令: sudo passwd Password:你当前的密码 Enter ...
- web页面实现指定区域打印功能
web页面实现指定区域打印功能 使用CSS,定义一个.noprint的class,将不打印的内容放入这个class内. 详细如下: <style media=print type="t ...
- event事件学习小节
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- HTML input文本框设置和移除默认值
这里想实现的效果是:设置和移除文本框默认值,如下图鼠标放到文本框中的时候,灰字消失. 1.可以用简单的方式,就是给input文本框加上onfocus属性,如下代码: <input id=&quo ...
- js 原生 ajax 异步上传图片
<script type="text/javascript"> function upload() { var file1 = document.getElementB ...
- 配置samba服务一例
问题: 在/data/share目录下建立三个子目录public.training.devel用途如下 public目录用于存放公共数据,如公司的规章制度 training目录用于存放公司的技术培训资 ...
- tomcat重启session不过期的处理
tomcat关闭后重启,SESSION 仍然有效的处理方法很多时候明明在服务器上关闭了TOMCAT,但是客户端的表示 SESSION仍然在线,原因及解决方案如下: 每当正常关闭或者重启tomcat服务 ...
- cms修改栏目单页样式错位调整
if (dt.Rows[0]["ClassTemplet"].ToString().Trim() == "") { rows_key.Style.Value = ...