mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Mauricio Lin" <mauriciolin@gmail.com>
To: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Jiffy is not able to measure the fraction of time a process runs a processor
Date: Mon, 13 Mar 2006 09:49:04 -0400	[thread overview]
Message-ID: <3f250c710603130549w6ccdf14cu73a0d7d2999fd4ee@mail.gmail.com> (raw)

Hi all,

 I am trying to measure the fraction of time a process runs on a
processor, but the jiffies is not able to provide an accurate value.

 The example below shows that in one kernel tick or one jiffy, kmix
and  lpd was schedule in the same processor and the cpu time of each
one was  zero. The calculation of cpu time is based on jiffies and the
cpu time  is zero because the jiffy value was not incremented yet.

  PID  :  NAME              : LAST ARRIVAL : CPU TIME            : CALLER
 4544  : kmix                  : 6170433                 : 0          
                 : work_resched+0x6c
 4078  : lpd                     : 6170433                 : 0        
                   : __down_interruptible+0x5
 4544  : kmix                  : 6170433                 : 0          
                  : schedule_timeout+0xb8


 Look again, when jiffies is 6170503 klipper and emacs are scheduled
many  times.

 4534  : klipper               : 6170503                 : 0          
                : preempt_schedule_irq+0xb8
 4534  : klipper               : 6170503                 : 0          
                : preempt_schedule+0x3d
 4534  : klipper               : 6170503                 : 0          
                : work_resched+0x34
 4534  : klipper               : 6170503                 : 0          
                : work_resched+0x5
 4534  : klipper               : 6170503                 : 0          
                : preempt_schedule+0x5
 4534  : klipper               : 6170503                 : 0          
                : work_resched+0x34
 4534  : klipper               : 6170503                 : 0          
                : work_resched+0x5
 4534  : klipper               : 6170503                 : 0          
                : work_resched+0x5
 4534  : klipper               : 6170503                 : 0          
                : work_resched+0x5
 4534  : klipper               : 6170503                 : 0          
                : work_resched+0x5
 4534  : klipper               : 6170503                 : 0          
                : work_resched+0x5
 16150 : emacs               : 6170503                 : 0            
              : work_resched+0x5
 16150 : emacs               : 6170503                 : 0            
              : work_resched+0x5
 16150 : emacs               : 6170503                 : 0            
              : work_resched+0x5
 16150 : emacs               : 6170503                 : 0            
              : preempt_schedule+0x5
 16150 : emacs               : 6170503                 : 0            
              : schedule_timeout+0x34
 4534  : klipper               : 6170503                 : 0          
                : preempt_schedule+0x6c
 4534  : klipper               : 6170503                 : 0          
                : work_resched+0x34
 4534  : klipper               : 6170503                 : 0          
                : work_resched+0x5
 4534  : klipper               : 6170503                 : 0          
                : schedule_timeout+0x5

 Does anyone know how can I measure precisely the fraction of time a
process runs on a processor?

 BR,

 Mauricio Lin.

             reply	other threads:[~2006-03-13 13:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-13 13:49 Mauricio Lin [this message]
2006-03-14 20:54 ` Frank Ch. Eigler
2006-03-15 14:40   ` Mauricio Lin
2006-03-15 15:55     ` linux-os (Dick Johnson)
2006-03-15 17:43       ` Mauricio Lin

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=3f250c710603130549w6ccdf14cu73a0d7d2999fd4ee@mail.gmail.com \
    --to=mauriciolin@gmail.com \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®