[zfs-discuss] Surprise Thread Preemptions

2011-01-18 Thread Kishore Kumar Pusukuri
Hi,
I would like to know about which threads will be preempted by which on my 
OpenSolaris machine. 
Therefore, I ran a multithreaded program myprogram with 32 threads on my 
24-core Solaris machine. I make sure that each thread of my program has same 
priority (priority zero), so that we can reduce priority inversions (saving 
preemptions -- system overhead). However, I ran the following script 
whoprempt.d to see who preempted myprogram threads and got the following output 
Unlike what I thought, myprogram threads are preempted (for 2796 times -- last 
line of the output) by the threads of same myprogram. 

Could anyone explain why this happens, please? 

DTrace script
==

#pragma D option quiet
 
 sched:::preempt
 {
 self-preempt = 1;
 }

 sched:::remain-cpu
  /self-preempt/
 {
  self-preempt = 0;
 }
  
 sched:::off-cpu
 /self-preempt/
 {
/*
  * If we were told to preempt ourselves, see who we ended up 
giving 
  * the CPU to.
   */
 @[stringof(args[1]-pr_fname), args[0]-pr_pri, 
execname,
  curlwpsinfo-pr_pri] = count();
  self-preempt = 0;
 }
  
 END
  {
  printf(%30s %3s %30s %3s %5s\n, PREEMPTOR, 
PRI,||,PREEMPTED, PRI, #);
  printa(%30s %3d %30s %3d %5@d\n, @);
  }


Output:
===
PREEMPTOR  PRI   ||   PREEMPTED PRI #
   dtrace   0||   myprogram   0 1
   dtrace   50   ||  myprogram   0 1
sched  -1  ||myprogram   0 1
 myprogram   0||dtrace   0 1
   
   .   
   nscd  59   || myprogram   0 4
   sendmail  59||myprogram   0 4
  sched  60 ||   myprogram   092
  sched  98 ||   myprogram   0   272
  sched  99 ||   myprogram   0  2110
  myprogram   0   || myprogram   0  2796
-- 
This message posted from opensolaris.org
___
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss


[zfs-discuss] 64-bit vs 32-bit applications

2010-08-16 Thread Kishore Kumar Pusukuri
Hi,
I am surprised with the performances of some 64-bit multi-threaded applications 
on my AMD Opteron machine. For most of the applications, the performance of 
32-bit version is almost same as the performance of 64-bit version. However, 
for a couple of applications, 32-bit versions provide better performance 
(running-time is around 76 secs) than 64-bit (running time is around 96 secs). 
Could anyone help me to find the reason behind this, please?


$ldd program-64  (64-bit version)
libpthread.so.1 =   /lib/64/libpthread.so.1
libstdc++.so.6 =/usr/lib/64/libstdc++.so.6
libm.so.2 = /lib/64/libm.so.2
libgcc_s.so.1 = /usr/lib/64/libgcc_s.so.1
libc.so.1 = /lib/64/libc.so.1

$ ldd program-32 (32-bit version)
libpthread.so.1 =   /lib/libpthread.so.1
libstdc++.so.6 =/usr/lib/libstdc++.so.6
libm.so.2 = /lib/libm.so.2
libgcc_s.so.1 = /usr/lib/libgcc_s.so.1
libc.so.1 = /lib/libc.so.1
-- 
This message posted from opensolaris.org
___
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss