[RFC] Use mutexes by default in db_open()

Ralph Böhme slow at samba.org
Mon Apr 24 17:58:31 UTC 2017


On Mon, Apr 24, 2017 at 10:21:56AM -0700, Jeremy Allison wrote:
> On Mon, Apr 24, 2017 at 04:16:45PM +0200, Ralph Böhme via samba-technical wrote:
> > Hi!
> > 
> > Is there any reason not to use mutexes by default? Maybe for 4.7?
> 
> Wow ! +1 from me - that seems like a no-brainer to me !

fwiw, here are the full strace stats:

without mutexes:

$ sudo strace -c -p 6167
strace: Process 6167 attached
^Cstrace: Process 6167 detached
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 32.16    3.149828           6    498574           fcntl
 14.44    1.413707           7    216321     20408 stat
  5.92    0.579759           7     83076           readv
  5.27    0.515892           8     63591     32048 getxattr
  4.20    0.410900           8     51542           epoll_wait
  4.07    0.398473          10     41540           writev
  4.01    0.392753           6     61370     20204 lstat
  3.23    0.316353           6     51543           getrusage
  3.11    0.304510           6     50236           fstat
  3.10    0.303822          15     20207           open
  3.03    0.297227           6     51125           getcwd
  3.00    0.293724          10     30202           sendmsg
  2.81    0.274921           6     42566           read
  2.60    0.254488           6     40401           chdir
  2.18    0.213752          12     18352           futex
  2.17    0.212816          10     20408           getdents
  1.54    0.151269          15     10101           setxattr
  1.49    0.145945           7     20209           close
  0.85    0.083246           8     10000           utimensat
  0.66    0.064636           6     10000     10000 fgetxattr
  0.05    0.005006           9       533           pwrite64
  0.03    0.003076          30       101           mkdir
  0.03    0.002989          10       310           listxattr
  0.02    0.001473          25        58           munmap
  0.01    0.001010         112         9           setresgid
  0.01    0.000639          10        64           mmap
  0.00    0.000347          18        19           getegid
  0.00    0.000309          15        21           geteuid
  0.00    0.000242           8        29           ftruncate
  0.00    0.000174          19         9           setresuid
  0.00    0.000124          21         6           setgroups
  0.00    0.000052          26         2           clock_gettime
  0.00    0.000023           5         5           mprotect
  0.00    0.000022          11         2           socket
  0.00    0.000015          15         1           clone
  0.00    0.000010           5         2         1 connect
  0.00    0.000003           2         2           rt_sigprocmask
  0.00    0.000002           1         2           brk
  0.00    0.000000           0         2           getgroups
------ ----------- ----------- --------- --------- ----------------
100.00    9.793537               1392541     82661 total

With mutexes:

$ sudo strace -c -p 6046
strace: Process 6046 attached
^Cstrace: Process 6046 detached
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 19.71    1.543710           7    216186     20408 stat
  7.74    0.606135           7     82986           readv
  7.37    0.577316           7     81998           fcntl
  7.10    0.556157           9     63471     31988 getxattr
  5.70    0.446476          11     41498           writev
  5.63    0.440620           9     51499           epoll_wait
  5.44    0.425990           7     61348     20204 lstat
  4.82    0.377667          19     20207           open
  4.28    0.335272           7     51500           getrusage
  4.25    0.332931          11     30202           sendmsg
  4.15    0.324819           6     51110           getcwd
  4.14    0.323940           6     50236           fstat
  3.80    0.297313           7     42491           read
  3.59    0.281365           7     40401           chdir
  2.94    0.230625          11     20408           getdents
  2.80    0.219255          12     17690           futex
  2.30    0.179997          18     10101           setxattr
  1.97    0.154460           8     20209           close
  1.17    0.091397           9     10000           utimensat
  0.87    0.068211           7     10000     10000 fgetxattr
  0.10    0.007916          15       533           pwrite64
  0.05    0.004069          40       101           mkdir
  0.05    0.003717          13       295           listxattr
  0.02    0.001812          31        58           munmap
  0.01    0.000893          14        64           mmap
  0.00    0.000363          13        29           ftruncate
  0.00    0.000118           8        15           getegid
  0.00    0.000114           7        16           geteuid
  0.00    0.000076          11         7           setresgid
  0.00    0.000074          11         7           setresuid
  0.00    0.000040           8         5           setgroups
  0.00    0.000034          17         2           socket
  0.00    0.000024          24         1           clone
  0.00    0.000019           4         5           mprotect
  0.00    0.000015          15         1           clock_gettime
  0.00    0.000011           6         2         1 connect
  0.00    0.000003           2         2           rt_sigprocmask
  0.00    0.000002           1         2           getgroups
  0.00    0.000000           0         2           brk
------ ----------- ----------- --------- --------- ----------------
100.00    7.832956                974688     82601 total


-slow



More information about the samba-technical mailing list