All of lore.kernel.org
 help / color / mirror / Atom feed
From: murzin.v@gmail.com (Vladimir Murzin)
To: kernelnewbies@lists.kernelnewbies.org
Subject: creation, context switch time of process and thread
Date: Sun, 27 May 2012 11:36:05 +0400	[thread overview]
Message-ID: <20120527073603.GB4696@pinguin> (raw)
In-Reply-To: <CAF8DjXgKstzNdH7nDgFSuApJ=ECH9rGgGvFP+yWPpqFyu=0n9w@mail.gmail.com>

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

      reply	other threads:[~2012-05-27  7:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120527073603.GB4696@pinguin \
    --to=murzin.v@gmail.com \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.