[20190402]关于semtimedop函数调用2.txt

[20190402]关于semtimedop函数调用2.txt

--//前几天做了sql语句在mutexes上的探究.今天看看_mutex_wait_time设置很大的情况下是否semtimedop会唤醒.

1.环境:
SYS@book> @ hide mutex
NAME                DESCRIPTION        DEFAULT_VALUE SESSION_VALUE SYSTEM_VALUE
------------------- ------------------ ------------- ------------- ------------
_mutex_spin_count   Mutex spin count   TRUE          255           255
_mutex_wait_scheme  Mutex wait scheme  TRUE          2             2
_mutex_wait_time    Mutex wait time    TRUE          1             1

--//注:_mutex_wait_time=1,相当1厘秒.
SCOTT@book> @ ver1
PORT_STRING                    VERSION        BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx            11.2.0.4.0     Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

$ cat m2.txt
set verify off
column a noprint new_value v_a;
--select mod ( &&3 ,3) a  from dual ;
--alter session set optimizer_index_cost_adj= &&3;
host sleep $(echo &&3/50| bc -l )
insert into job_times values ( sys_context ('userenv', 'sid') ,dbms_utility.get_time ,'&&2') ;
commit ;
declare
v_id number;
v_d date;
begin
    for i in 1 .. &&1 loop
        --select  1 into v_id from dual ;
        --select  sysdate into v_d from dual ;
        select deptno into v_id from dept where deptno=10;
    end loop;
end ;
/
update job_times set time_ela = dbms_utility.get_time - time_ela where sid=sys_context ('userenv', 'sid') and method='&&2';
commit;
--quit

$ seq 150 | xargs -I {}  -P 150 bash -c  "sqlplus -s -l scott/book @m2.txt 1e6 f2_150 {} >/dev/null"

SYS@book> @ mutexy 6 a31kd5tkdvvmm
      HASH SUM_SLEEPS   SUM_GETS LOCATION                       MUTEX_TYPE           MUTEX_ADDR       SQLID         KGLNAOWN C100
---------- ---------- ---------- ------------------------------ -------------------- ---------------- ------------- -------- ---------------------------------------
1692266099    2263154 4.6431E+10 kksLockDelete [KKSCHLPIN6]     Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10
1692266099    2183544 4.4733E+10 kksfbc [KKSCHLFSP2]            Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10
1692266099       5256  600010918 kksfbc [KKSCHLPIN1]            Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10
1692266099          6   45955498 kksHeapReadUnlock [KKSCHLRDUP] Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10

--//MUTEX_ADDR=000000007C88E330.

2.测试:
--//session 1:
SCOTT@book> @ spid
       SID    SERIAL# PROCESS                  SERVER    SPID       PID  P_SERIAL# C50
---------- ---------- ------------------------ --------- ------ ------- ---------- --------------------------------------------------
       295          5 65222                    DEDICATED 65223       21          3 alter system kill session '295,5' immediate;

--//session 2:
SYS@book> alter system set "_mutex_wait_scheme"=2 scope=memory;
System altered.

SYS@book> alter system set "_mutex_wait_time"=100000;
alter system set "_mutex_wait_time"=100000
*
ERROR at line 1:
ORA-00068: invalid value 100000 for parameter _mutex_wait_time, must be between 0 and 65535
--//在0-65536之间.

SYS@book> alter system set "_mutex_wait_time"=1000;
System altered.
--//相当于10秒.

--//session 2:       
SYS@book> oradebug setmypid
Statement processed.

SYS@book> oradebug peek 0x000000007C88E330 8
[07C88E330, 07C88E338) = 00000000 00000000

SYS@book> oradebug poke 0x000000007C88E330 8 0x0000000200000127
BEFORE: [07C88E330, 07C88E338) = 00000000 00000000
AFTER:  [07C88E330, 07C88E338) = 00000127 00000002

--//session 1:
SCOTT@book> @ m2.txt 1 c1 0
1 row created.
Commit complete.
--//挂起!!

3.监测:
$ strace -frT -p 65223
....
     4.001032 getrusage(RUSAGE_SELF, {ru_utime={521, 748682}, ru_stime={54, 729679}, ...}) = 0 <0.000065>
     0.000156 getrusage(RUSAGE_SELF, {ru_utime={521, 748682}, ru_stime={54, 729679}, ...}) = 0 <0.000022>
     0.000122 semtimedop(309952512, 0x7fff28087160, 1, {3, 0}) = -1 EAGAIN (Resource temporarily unavailable) <3.000687>
     3.000815 semtimedop(309952512, 0x7fff28087160, 1, {3, 0}) = -1 EAGAIN (Resource temporarily unavailable) <3.001003>
     3.001148 semtimedop(309952512, 0x7fff28087160, 1, {4, 0}) = -1 EAGAIN (Resource temporarily unavailable) <4.000630>
     4.000734 getrusage(RUSAGE_SELF, {ru_utime={521, 748682}, ru_stime={54, 729679}, ...}) = 0 <0.000064>
     0.000156 getrusage(RUSAGE_SELF, {ru_utime={521, 748682}, ru_stime={54, 729679}, ...}) = 0 <0.000022>
     0.000122 semtimedop(309952512, 0x7fff28087160, 1, {3, 0}) = -1 EAGAIN (Resource temporarily unavailable) <3.000950>
     3.001082 semtimedop(309952512, 0x7fff28087160, 1, {3, 0}) = -1 EAGAIN (Resource temporarily unavailable) <3.000722>
     3.000865 semtimedop(309952512, 0x7fff28087160, 1, {4, 0}) = -1 EAGAIN (Resource temporarily unavailable) <4.000592>
     4.000697 getrusage(RUSAGE_SELF, {ru_utime={521, 748682}, ru_stime={54, 729679}, ...}) = 0 <0.000061>
     0.000152 getrusage(RUSAGE_SELF, {ru_utime={521, 748682}, ru_stime={54, 729679}, ...}) = 0 <0.000022>
     0.000121 semtimedop(309952512, 0x7fff28087160, 1, {3, 0}) = -1 EAGAIN (Resource temporarily unavailable) <3.000734>
     3.000862 semtimedop(309952512, 0x7fff28087160, 1, {3, 0}) = -1 EAGAIN (Resource temporarily unavailable) <3.001028>
     3.001176 semtimedop(309952512, 0x7fff28087160, 1, {4, 0}) = -1 EAGAIN (Resource temporarily unavailable) <4.000716>
--//可以看出非常像dbms_lock.sleep调用,被拆分3,3,4秒分别执行.
--//但是我并没有看解除阻塞后唤醒的情况,我测试多次.
SYS@book> oradebug poke 0x000000007C88E330 8 0x0000000200000127
BEFORE: [07C88E330, 07C88E338) = 00000000 00000000
AFTER:  [07C88E330, 07C88E338) = 00000127 00000002
-----------------------------------
     4.000819 getrusage(RUSAGE_SELF, {ru_utime={521, 748682}, ru_stime={54, 729679}, ...}) = 0 <0.000062>
     0.000153 getrusage(RUSAGE_SELF, {ru_utime={521, 748682}, ru_stime={54, 729679}, ...}) = 0 <0.000022>
     0.000124 getrusage(RUSAGE_SELF, {ru_utime={521, 748682}, ru_stime={54, 729679}, ...}) = 0 <0.000019>
     0.000087 times({tms_utime=52174, tms_stime=5472, tms_cutime=0, tms_cstime=0}) = 10874034811 <0.000019>
     0.000076 getrusage(RUSAGE_SELF, {ru_utime={521, 748682}, ru_stime={54, 729679}, ...}) = 0 <0.000020>
     0.000097 getrusage(RUSAGE_SELF, {ru_utime={521, 748682}, ru_stime={54, 729679}, ...}) = 0 <0.000017>
     0.000087 getrusage(RUSAGE_SELF, {ru_utime={521, 748682}, ru_stime={54, 729679}, ...}) = 0 <0.000020>
     0.000134 getrusage(RUSAGE_SELF, {ru_utime={521, 749681}, ru_stime={54, 729679}, ...}) = 0 <0.000020>

--//另外我注意一个细节,如果设置_mutex_wait_time>1的情况下,就会出现指数回退的情况,以下是10秒的情况.
_mutex_wait_scheme = 0                        – Always YIELD
_mutex_wait_scheme = 1 & _mutex_wait_time = t – Always SLEEP for t milli-seconds (default)
_mutex_wait_scheme = 2 & _mutex_wait_time = t – EXP BACKOFF with maximum sleep
---------------------
$ strace -frT -p 65223 -e semtimedop,getrusage
Process 65223 attached - interrupt to quit
     0.000000 getrusage(RUSAGE_SELF, {ru_utime={521, 774678}, ru_stime={54, 741678}, ...}) = 0 <0.000036>
     0.000250 getrusage(RUSAGE_SELF, {ru_utime={521, 774678}, ru_stime={54, 741678}, ...}) = 0 <0.000017>
     0.000096 getrusage(RUSAGE_SELF, {ru_utime={521, 774678}, ru_stime={54, 741678}, ...}) = 0 <0.000017>
     0.000199 getrusage(RUSAGE_SELF, {ru_utime={521, 774678}, ru_stime={54, 741678}, ...}) = 0 <0.000018>
     0.000155 getrusage(RUSAGE_SELF, {ru_utime={521, 774678}, ru_stime={54, 741678}, ...}) = 0 <0.000016>
     0.000152 getrusage(RUSAGE_SELF, {ru_utime={521, 774678}, ru_stime={54, 741678}, ...}) = 0 <0.000016>
     0.000131 getrusage(RUSAGE_SELF, {ru_utime={521, 774678}, ru_stime={54, 741678}, ...}) = 0 <0.000017>
     0.000201 getrusage(RUSAGE_SELF, {ru_utime={521, 774678}, ru_stime={54, 741678}, ...}) = 0 <0.000016>
     0.000108 getrusage(RUSAGE_SELF, {ru_utime={521, 774678}, ru_stime={54, 741678}, ...}) = 0 <0.000017>
     0.000100 getrusage(RUSAGE_SELF, {ru_utime={521, 774678}, ru_stime={54, 741678}, ...}) = 0 <0.000016>
     0.000703 getrusage(RUSAGE_SELF, {ru_utime={521, 775678}, ru_stime={54, 741678}, ...}) = 0 <0.000020>
     0.000227 getrusage(RUSAGE_SELF, {ru_utime={521, 775678}, ru_stime={54, 741678}, ...}) = 0 <0.000018>
     0.000109 getrusage(RUSAGE_SELF, {ru_utime={521, 775678}, ru_stime={54, 741678}, ...}) = 0 <0.000016>
     0.000478 getrusage(RUSAGE_SELF, {ru_utime={521, 775678}, ru_stime={54, 741678}, ...}) = 0 <0.000018>
     0.000177 getrusage(RUSAGE_SELF, {ru_utime={521, 775678}, ru_stime={54, 741678}, ...}) = 0 <0.000017>
     0.000106 getrusage(RUSAGE_SELF, {ru_utime={521, 775678}, ru_stime={54, 741678}, ...}) = 0 <0.000016>
     0.000149 getrusage(RUSAGE_SELF, {ru_utime={521, 775678}, ru_stime={54, 741678}, ...}) = 0 <0.000016>
     0.000145 getrusage(RUSAGE_SELF, {ru_utime={521, 775678}, ru_stime={54, 741678}, ...}) = 0 <0.000016>
     0.000155 getrusage(RUSAGE_SELF, {ru_utime={521, 775678}, ru_stime={54, 741678}, ...}) = 0 <0.000017>
     0.000108 getrusage(RUSAGE_SELF, {ru_utime={521, 775678}, ru_stime={54, 741678}, ...}) = 0 <0.000017>
     0.000136 getrusage(RUSAGE_SELF, {ru_utime={521, 775678}, ru_stime={54, 741678}, ...}) = 0 <0.000016>
     0.000104 getrusage(RUSAGE_SELF, {ru_utime={521, 775678}, ru_stime={54, 741678}, ...}) = 0 <0.000017>
     0.000106 getrusage(RUSAGE_SELF, {ru_utime={521, 775678}, ru_stime={54, 741678}, ...}) = 0 <0.000016>
     0.000109 getrusage(RUSAGE_SELF, {ru_utime={521, 775678}, ru_stime={54, 741678}, ...}) = 0 <0.000016>
     0.000342 getrusage(RUSAGE_SELF, {ru_utime={521, 775678}, ru_stime={54, 741678}, ...}) = 0 <0.000019>
     0.000205 getrusage(RUSAGE_SELF, {ru_utime={521, 775678}, ru_stime={54, 741678}, ...}) = 0 <0.000016>
     0.000123 getrusage(RUSAGE_SELF, {ru_utime={521, 775678}, ru_stime={54, 741678}, ...}) = 0 <0.000017>
     0.000106 getrusage(RUSAGE_SELF, {ru_utime={521, 775678}, ru_stime={54, 741678}, ...}) = 0 <0.000016>
     0.000968 getrusage(RUSAGE_SELF, {ru_utime={521, 776677}, ru_stime={54, 741678}, ...}) = 0 <0.000028>
     0.000243 getrusage(RUSAGE_SELF, {ru_utime={521, 776677}, ru_stime={54, 741678}, ...}) = 0 <0.000026>
     0.000128 getrusage(RUSAGE_SELF, {ru_utime={521, 776677}, ru_stime={54, 741678}, ...}) = 0 <0.000022>
     0.000173 getrusage(RUSAGE_SELF, {ru_utime={521, 776677}, ru_stime={54, 741678}, ...}) = 0 <0.000022>
     0.000172 getrusage(RUSAGE_SELF, {ru_utime={521, 776677}, ru_stime={54, 741678}, ...}) = 0 <0.000022>
     0.000164 getrusage(RUSAGE_SELF, {ru_utime={521, 776677}, ru_stime={54, 741678}, ...}) = 0 <0.000023>
     0.000160 getrusage(RUSAGE_SELF, {ru_utime={521, 776677}, ru_stime={54, 741678}, ...}) = 0 <0.000023>
     0.000176 getrusage(RUSAGE_SELF, {ru_utime={521, 776677}, ru_stime={54, 741678}, ...}) = 0 <0.000021>
     0.000122 getrusage(RUSAGE_SELF, {ru_utime={521, 776677}, ru_stime={54, 741678}, ...}) = 0 <0.000022>
     0.000117 getrusage(RUSAGE_SELF, {ru_utime={521, 776677}, ru_stime={54, 741678}, ...}) = 0 <0.000022>
     0.000206 getrusage(RUSAGE_SELF, {ru_utime={521, 776677}, ru_stime={54, 741678}, ...}) = 0 <0.000023>
     0.000129 getrusage(RUSAGE_SELF, {ru_utime={521, 776677}, ru_stime={54, 741678}, ...}) = 0 <0.000021>
     0.000160 getrusage(RUSAGE_SELF, {ru_utime={521, 776677}, ru_stime={54, 741678}, ...}) = 0 <0.000022>
     0.000309 semtimedop(309952512, 0x7fff28087160, 1, {0, 10000000}) = -1 EAGAIN (Resource temporarily unavailable) <0.010902>
     0.011073 semtimedop(309952512, 0x7fff28087160, 1, {0, 10000000}) = -1 EAGAIN (Resource temporarily unavailable) <0.010790>
     0.010927 semtimedop(309952512, 0x7fff28087160, 1, {0, 30000000}) = -1 EAGAIN (Resource temporarily unavailable) <0.030891>
     0.031029 semtimedop(309952512, 0x7fff28087160, 1, {0, 70000000}) = -1 EAGAIN (Resource temporarily unavailable) <0.070846>
     0.070985 semtimedop(309952512, 0x7fff28087160, 1, {0, 120000000}) = -1 EAGAIN (Resource temporarily unavailable) <0.120839>
     0.120948 semtimedop(309952512, 0x7fff28087160, 1, {0, 110000000}) = -1 EAGAIN (Resource temporarily unavailable) <0.110910>
     0.111058 semtimedop(309952512, 0x7fff28087160, 1, {0, 200000000}) = -1 EAGAIN (Resource temporarily unavailable) <0.200888>
     0.201025 semtimedop(309952512, 0x7fff28087160, 1, {0, 150000000}) = -1 EAGAIN (Resource temporarily unavailable) <0.150867>
     0.151005 semtimedop(309952512, 0x7fff28087160, 1, {0, 320000000}) = -1 EAGAIN (Resource temporarily unavailable) <0.320891>
     0.321029 semtimedop(309952512, 0x7fff28087160, 1, {0, 310000000}) = -1 EAGAIN (Resource temporarily unavailable) <0.310879>
--//实际上阻塞的情况下.睡眠的时间间隔开始一直在增加.从1,1,3,7,12,11,20,15,32,31cs增加.
     0.311003 getrusage(RUSAGE_SELF, {ru_utime={521, 777677}, ru_stime={54, 741678}, ...}) = 0 <0.000032>
     0.311003 getrusage(RUSAGE_SELF, {ru_utime={521, 777677}, ru_stime={54, 741678}, ...}) = 0 <0.000032>
     0.000157 getrusage(RUSAGE_SELF, {ru_utime={521, 777677}, ru_stime={54, 741678}, ...}) = 0 <0.000027>
     0.000187 semtimedop(309952512, 0x7fff28087160, 1, {0, 640000000}) = -1 EAGAIN (Resource temporarily unavailable) <0.640510>
     0.640646 semtimedop(309952512, 0x7fff28087160, 1, {0, 670000000}) = -1 EAGAIN (Resource temporarily unavailable) <0.670902>
     0.671039 semtimedop(309952512, 0x7fff28087160, 1, {1, 320000000}) = -1 EAGAIN (Resource temporarily unavailable) <1.320895>
--//这里也是 64,67,132
     1.321017 getrusage(RUSAGE_SELF, {ru_utime={521, 777677}, ru_stime={54, 741678}, ...}) = 0 <0.000028>
     0.000148 getrusage(RUSAGE_SELF, {ru_utime={521, 777677}, ru_stime={54, 741678}, ...}) = 0 <0.000026>
     0.000152 semtimedop(309952512, 0x7fff28087160, 1, {1, 310000000}) = -1 EAGAIN (Resource temporarily unavailable) <1.310542>
--//这里也是 131 ,后面还有.
     1.310665 getrusage(RUSAGE_SELF, {ru_utime={521, 777677}, ru_stime={54, 741678}, ...}) = 0 <0.000028>
     0.000145 getrusage(RUSAGE_SELF, {ru_utime={521, 777677}, ru_stime={54, 741678}, ...}) = 0 <0.000027>
     0.000149 semtimedop(309952512, 0x7fff28087160, 1, {2, 600000000}) = -1 EAGAIN (Resource temporarily unavailable) <2.600601>
     2.600719 getrusage(RUSAGE_SELF, {ru_utime={521, 777677}, ru_stime={54, 741678}, ...}) = 0 <0.000028>
     0.000131 getrusage(RUSAGE_SELF, {ru_utime={521, 777677}, ru_stime={54, 741678}, ...}) = 0 <0.000027>
     0.000149 semtimedop(309952512, 0x7fff28087160, 1, {2, 710000000}) = -1 EAGAIN (Resource temporarily unavailable) <2.710794>
     2.710915 getrusage(RUSAGE_SELF, {ru_utime={521, 778677}, ru_stime={54, 741678}, ...}) = 0 <0.000029>
     0.000147 getrusage(RUSAGE_SELF, {ru_utime={521, 778677}, ru_stime={54, 741678}, ...}) = 0 <0.000025>
     0.000156 semtimedop(309952512, 0x7fff28087160, 1, {5, 280000000}) = -1 EAGAIN (Resource temporarily unavailable) <5.280287>
     5.280409 getrusage(RUSAGE_SELF, {ru_utime={521, 778677}, ru_stime={54, 741678}, ...}) = 0 <0.000028>
     0.000151 getrusage(RUSAGE_SELF, {ru_utime={521, 778677}, ru_stime={54, 741678}, ...}) = 0 <0.000026>
     0.000151 semtimedop(309952512, 0x7fff28087160, 1, {5, 270000000}) = -1 EAGAIN (Resource temporarily unavailable) <5.270622>
--//527cs
     5.270746 getrusage(RUSAGE_SELF, {ru_utime={521, 778677}, ru_stime={54, 741678}, ...}) = 0 <0.000032>
     0.000153 getrusage(RUSAGE_SELF, {ru_utime={521, 778677}, ru_stime={54, 741678}, ...}) = 0 <0.000026>
     0.000151 semtimedop(309952512, 0x7fff28087160, 1, {3, 0}) = -1 EAGAIN (Resource temporarily unavailable) <3.000675>
     3.000791 semtimedop(309952512, 0x7fff28087160, 1, {3, 0}) = -1 EAGAIN (Resource temporarily unavailable) <3.000792>
     3.000935 semtimedop(309952512, 0x7fff28087160, 1, {4, 0}) = -1 EAGAIN (Resource temporarily unavailable) <4.001177>
--//从这里开始等10秒pin 255次.    
     4.001331 getrusage(RUSAGE_SELF, {ru_utime={521, 778677}, ru_stime={54, 741678}, ...}) = 0 <0.000027>
     0.000151 getrusage(RUSAGE_SELF, {ru_utime={521, 778677}, ru_stime={54, 741678}, ...}) = 0 <0.000025>
     0.000161 semtimedop(309952512, 0x7fff28087160, 1, {3, 0}) = -1 EAGAIN (Resource temporarily unavailable) <3.000379>
     3.000496 semtimedop(309952512, 0x7fff28087160, 1, {3, 0}) = -1 EAGAIN (Resource temporarily unavailable) <3.000744>
     3.000882 semtimedop(309952512, 0x7fff28087160, 1, {4, 0}) = -1 EAGAIN (Resource temporarily unavailable) <4.000976>
     4.001137 getrusage(RUSAGE_SELF, {ru_utime={521, 778677}, ru_stime={54, 741678}, ...}) = 0 <0.000029>
     0.000157 getrusage(RUSAGE_SELF, {ru_utime={521, 778677}, ru_stime={54, 741678}, ...}) = 0 <0.000025>
     0.000159 semtimedop(309952512, 0x7fff28087160, 1, {3, 0}) = -1 EAGAIN (Resource temporarily unavailable) <3.000474>
     3.000592 semtimedop(309952512, 0x7fff28087160, 1, {3, 0}) = -1 EAGAIN (Resource temporarily unavailable) <3.000800>
     3.000943 semtimedop(309952512, 0x7fff28087160, 1, {4, 0}) = -1 EAGAIN (Resource temporarily unavailable) <4.001361>
     4.001510 getrusage(RUSAGE_SELF, {ru_utime={521, 778677}, ru_stime={54, 741678}, ...}) = 0 <0.000029>
     0.000155 getrusage(RUSAGE_SELF, {ru_utime={521, 778677}, ru_stime={54, 741678}, ...}) = 0 <0.000027>
     0.000176 getrusage(RUSAGE_SELF, {ru_utime={521, 779677}, ru_stime={54, 741678}, ...}) = 0 <0.000028>
     0.000162 getrusage(RUSAGE_SELF, {ru_utime={521, 779677}, ru_stime={54, 741678}, ...}) = 0 <0.000023>
     0.000140 getrusage(RUSAGE_SELF, {ru_utime={521, 779677}, ru_stime={54, 741678}, ...}) = 0 <0.000022>


--//_mutex_wait_time=2的情况,不是很明显,仅仅执行2次semtimedop sleep 0.01秒的情况.
65223      0.000106 getrusage(RUSAGE_SELF, {ru_utime={522, 312596}, ru_stime={54, 819666}, ...}) = 0 <0.000024>
65223      0.000140 getrusage(RUSAGE_SELF, {ru_utime={522, 312596}, ru_stime={54, 819666}, ...}) = 0 <0.000023>
65223      0.000237 semtimedop(309952512, 0x7fff28087160, 1, {0, 10000000}) = -1 EAGAIN (Resource temporarily unavailable) <0.010283>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
65223      0.010404 semtimedop(309952512, 0x7fff28087160, 1, {0, 10000000}) = -1 EAGAIN (Resource temporarily unavailable) <0.010921>
65223      0.011033 semtimedop(309952512, 0x7fff28087160, 1, {0, 20000000}) = -1 EAGAIN (Resource temporarily unavailable) <0.020893>
65223      0.021011 semtimedop(309952512, 0x7fff28087160, 1, {0, 20000000}) = -1 EAGAIN (Resource temporarily unavailable) <0.020881>
65223      0.020998 semtimedop(309952512, 0x7fff28087160, 1, {0, 20000000}) = -1 EAGAIN (Resource temporarily unavailable) <0.020877>
65223      0.020993 semtimedop(309952512, 0x7fff28087160, 1, {0, 20000000}) = -1 EAGAIN (Resource temporarily unavailable) <0.020885>
    
--//再来看看sleep记数:
$ sqlplus -s -l / as sysdba <<EOF
> $(seq 1000| xargs -I {} echo -e "@ mutexy 5 a31kd5tkdvvmm\nhost sleep 10\n")
> EOF

      HASH SUM_SLEEPS   SUM_GETS LOCATION                       MUTEX_TYPE           MUTEX_ADDR       SQLID         KGLNAOWN C100
---------- ---------- ---------- ------------------------------ -------------------- ---------------- ------------- -------- ---------------------------------------
1692266099  161166910  600017934 kksfbc [KKSCHLPIN1]            Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10
1692266099    2263154 4.6431E+10 kksLockDelete [KKSCHLPIN6]     Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10
1692266099    2183544 4.4733E+10 kksfbc [KKSCHLFSP2]            Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10
1692266099          6   45955498 kksHeapReadUnlock [KKSCHLRDUP] Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10

      HASH SUM_SLEEPS   SUM_GETS LOCATION                       MUTEX_TYPE           MUTEX_ADDR       SQLID         KGLNAOWN C100
---------- ---------- ---------- ------------------------------ -------------------- ---------------- ------------- -------- ---------------------------------------
1692266099  161166942  600047254 kkslce [KKSCHLPIN2]            Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10
1692266099    2263154 4.6431E+10 kksLockDelete [KKSCHLPIN6]     Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10
1692266099    2183544 4.4733E+10 kksfbc [KKSCHLFSP2]            Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10
1692266099          6   45955498 kksHeapReadUnlock [KKSCHLRDUP] Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10

      HASH SUM_SLEEPS   SUM_GETS LOCATION                       MUTEX_TYPE           MUTEX_ADDR       SQLID         KGLNAOWN C100
---------- ---------- ---------- ------------------------------ -------------------- ---------------- ------------- -------- ---------------------------------------
1692266099  161166948  600047254 kkslce [KKSCHLPIN2]            Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10
1692266099    2263154 4.6431E+10 kksLockDelete [KKSCHLPIN6]     Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10
1692266099    2183544 4.4733E+10 kksfbc [KKSCHLFSP2]            Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10
1692266099          6   45955498 kksHeapReadUnlock [KKSCHLRDUP] Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10

      HASH SUM_SLEEPS   SUM_GETS LOCATION                       MUTEX_TYPE           MUTEX_ADDR       SQLID         KGLNAOWN C100
---------- ---------- ---------- ------------------------------ -------------------- ---------------- ------------- -------- ---------------------------------------
1692266099  161166952  600047254 kkslce [KKSCHLPIN2]            Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10
1692266099    2263154 4.6431E+10 kksLockDelete [KKSCHLPIN6]     Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10
1692266099    2183544 4.4733E+10 kksfbc [KKSCHLFSP2]            Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10
1692266099          6   45955498 kksHeapReadUnlock [KKSCHLRDUP] Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10

      HASH SUM_SLEEPS   SUM_GETS LOCATION                       MUTEX_TYPE           MUTEX_ADDR       SQLID         KGLNAOWN C100
---------- ---------- ---------- ------------------------------ -------------------- ---------------- ------------- -------- ---------------------------------------
1692266099  161166954  600047254 kkslce [KKSCHLPIN2]            Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10
1692266099    2263154 4.6431E+10 kksLockDelete [KKSCHLPIN6]     Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10
1692266099    2183544 4.4733E+10 kksfbc [KKSCHLFSP2]            Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10
1692266099          6   45955498 kksHeapReadUnlock [KKSCHLRDUP] Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10

      HASH SUM_SLEEPS   SUM_GETS LOCATION                       MUTEX_TYPE           MUTEX_ADDR       SQLID         KGLNAOWN C100
---------- ---------- ---------- ------------------------------ -------------------- ---------------- ------------- -------- ---------------------------------------
1692266099  161166956  600047254 kkslce [KKSCHLPIN2]            Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10
1692266099    2263154 4.6431E+10 kksLockDelete [KKSCHLPIN6]     Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10
1692266099    2183544 4.4733E+10 kksfbc [KKSCHLFSP2]            Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10
1692266099          6   45955498 kksHeapReadUnlock [KKSCHLRDUP] Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10

      HASH SUM_SLEEPS   SUM_GETS LOCATION                       MUTEX_TYPE           MUTEX_ADDR       SQLID         KGLNAOWN C100
---------- ---------- ---------- ------------------------------ -------------------- ---------------- ------------- -------- ---------------------------------------
1692266099  161166958  600047254 kkslce [KKSCHLPIN2]            Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10
1692266099    2263154 4.6431E+10 kksLockDelete [KKSCHLPIN6]     Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10
1692266099    2183544 4.4733E+10 kksfbc [KKSCHLFSP2]            Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10
1692266099          6   45955498 kksHeapReadUnlock [KKSCHLRDUP] Cursor Pin           000000007C88E330 a31kd5tkdvvmm          SELECT DEPTNO FROM DEPT WHERE DEPTNO=10

--//sleep计数与getrusage调用有关,后面增加都是2次.

posted @ 2019-04-02 11:13  lfree  阅读(508)  评论(0编辑  收藏  举报