* creation, context switch time of process and thread @ 2012-05-24 12:25 Srinivas Ramanan 2012-05-24 14:30 ` 刘智猷 2012-05-25 7:20 ` richard -rw- weinberger 0 siblings, 2 replies; 5+ messages in thread From: Srinivas Ramanan @ 2012-05-24 12:25 UTC (permalink / raw) To: kernelnewbies Can someone give the information of following typical values in Kernel 3.x in a 2Ghz machine with sufficient RAM Process creation time ? Process context switch time ? pthread creation time ? pthread context swich time ? kernel thread creation time ? kernel thread context swich time ? What is the best way to measure these values? I wrote a simple test for measuring kernel thread context switch A simple test like 1. get_time(start) 2. schedule(); 3. get_time(end) 4. print( context sw time = (end-start) ) But it doesnt seem to work correctly. Thanks. Ramanan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120524/153397a7/attachment.html ^ permalink raw reply [flat|nested] 5+ messages in thread
* creation, context switch time of process and thread 2012-05-24 12:25 creation, context switch time of process and thread Srinivas Ramanan @ 2012-05-24 14:30 ` 刘智猷 2012-05-25 7:20 ` richard -rw- weinberger 1 sibling, 0 replies; 5+ messages in thread From: 刘智猷 @ 2012-05-24 14:30 UTC (permalink / raw) To: kernelnewbies On 05/24/2012 08:25 PM, Srinivas Ramanan wrote: > Can someone give the information of following typical values in > Kernel 3.x > in a 2Ghz machine with sufficient RAM > > Process creation time ? > Process context switch time ? > pthread creation time ? > pthread context swich time ? > kernel thread creation time ? > kernel thread context swich time ? > > What is the best way to measure these values? > I wrote a simple test for measuring kernel thread context switch > A simple test like > > 1. get_time(start) > 2. schedule(); > 3. get_time(end) > 4. print( context sw time = (end-start) ) > > But it doesnt seem to work correctly. > > Thanks. > Ramanan > > > > > > _______________________________________________ > Kernelnewbies mailing list > Kernelnewbies at kernelnewbies.org > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies Hi, Check things supporting tracepoints like perf, systemtap and kprobe. They could help you a lot. Regards, LIU zhiyou -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120524/65bd5353/attachment.html ^ permalink raw reply [flat|nested] 5+ messages in thread
* creation, context switch time of process and thread 2012-05-24 12:25 creation, context switch time of process and thread Srinivas Ramanan 2012-05-24 14:30 ` 刘智猷 @ 2012-05-25 7:20 ` richard -rw- weinberger 2012-05-25 17:29 ` Srinivas Ramanan 1 sibling, 1 reply; 5+ messages in thread From: richard -rw- weinberger @ 2012-05-25 7:20 UTC (permalink / raw) To: kernelnewbies On Thu, May 24, 2012 at 2:25 PM, Srinivas Ramanan <srinivas.ramanan@gmail.com> wrote: > Can someone give the ?information of following typical values in Kernel 3.x > in a 2Ghz machine with sufficient RAM > > Process creation time ? > Process context switch time ? > pthread creation time ? > pthread context swich ?time ? > kernel thread creation time ? > kernel thread context swich ?time ? > > What is the best way to measure these values? You can use events like sched_switch. See: /sys/kernel/debug/tracing/events/sched/ -- Thanks, //richard ^ permalink raw reply [flat|nested] 5+ messages in thread
* creation, context switch time of process and thread 2012-05-25 7:20 ` richard -rw- weinberger @ 2012-05-25 17:29 ` Srinivas Ramanan 2012-05-27 7:36 ` Vladimir Murzin 0 siblings, 1 reply; 5+ messages in thread From: Srinivas Ramanan @ 2012-05-25 17:29 UTC (permalink / raw) To: kernelnewbies On Fri, May 25, 2012 at 12:50 PM, richard -rw- weinberger < richard.weinberger@gmail.com> wrote: > On Thu, May 24, 2012 at 2:25 PM, Srinivas Ramanan > <srinivas.ramanan@gmail.com> wrote: > > Can someone give the information of following typical values in Kernel > 3.x > > in a 2Ghz machine with sufficient RAM > > > > Process creation time ? > > Process context switch time ? > > pthread creation time ? > > pthread context swich time ? > > kernel thread creation time ? > > kernel thread context switch time ? > Thanks for pointing out the tools. I will look in to them. To confirm that i am measuring it right, can someone give some (approximate) typical values for the above, Assuming some 200 instructions in context switching assembly code, i guess the process context switch takes around 100ns. is this right? I guess the process creation time will be greater than process context switch time. correct? Will the pthread context switch time be different from a kernel thread context switch time? thanks, ramanan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120525/4888518f/attachment.html ^ permalink raw reply [flat|nested] 5+ messages in thread
* creation, context switch time of process and thread 2012-05-25 17:29 ` Srinivas Ramanan @ 2012-05-27 7:36 ` Vladimir Murzin 0 siblings, 0 replies; 5+ messages in thread From: Vladimir Murzin @ 2012-05-27 7:36 UTC (permalink / raw) To: kernelnewbies On Fri, May 25, 2012 at 10:59:16PM +0530, Srinivas Ramanan wrote: > On Fri, May 25, 2012 at 12:50 PM, richard -rw- weinberger < > richard.weinberger at gmail.com> wrote: > > > On Thu, May 24, 2012 at 2:25 PM, Srinivas Ramanan > > <srinivas.ramanan@gmail.com> wrote: > > > Can someone give the information of following typical values in Kernel > > 3.x > > > in a 2Ghz machine with sufficient RAM > > > > > > Process creation time ? > > > Process context switch time ? > > > pthread creation time ? > > > pthread context swich time ? > > > kernel thread creation time ? > > > kernel thread context switch time ? > > > > Thanks for pointing out the tools. I will look in to them. > To confirm that i am measuring it right, can someone give some > (approximate) typical values for the above, > Assuming some 200 instructions in context switching assembly code, i guess > the process context switch takes around 100ns. is this right? > I guess the process creation time will be greater than process context > switch time. correct? > Will the pthread context switch time be different from a kernel thread > context switch time? > > > thanks, > ramanan > _______________________________________________ > Kernelnewbies mailing list > Kernelnewbies at kernelnewbies.org > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies Hi Why don't you benchmark your environment with performance measuring tools like LMBench[1]? I guess that things are not easy... For instance, if process uses FPU the state of FPU is usually saved on context switch, it could take some time... It also possible that on some architectures it is necessary to flush cashes and tlb on context switch,.. AFAIK processes and threads are handled by the Linux kernel in the same way, i.e. there is no difference for scheduler between process and thread. [1]http://www.bitmover.com/lmbench/ Best wishes Vladimir Murzin ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-05-27 7:36 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-05-24 12:25 creation, context switch time of process and thread Srinivas Ramanan 2012-05-24 14:30 ` 刘智猷 2012-05-25 7:20 ` richard -rw- weinberger 2012-05-25 17:29 ` Srinivas Ramanan 2012-05-27 7:36 ` Vladimir Murzin
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.