public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: John Sigler <linux.kernel@free.fr>
To: linux-kernel@vger.kernel.org
Subject: Re: Selective system profiling
Date: Thu, 21 Jun 2007 17:05:35 +0200	[thread overview]
Message-ID: <467A93BF.9020104@free.fr> (raw)
In-Reply-To: <46779B8D.6050900@free.fr>

John Sigler wrote:

> Hello everyone,
> 
> Here's my situation:
> 
> I'm pushing data in chunks of 1316 bytes to a PCI device at 38 Mbit/s.
> In other words, I write 1316 bytes to the device every 277 microseconds.
> 
> I've noticed that the latency of this operation varies immensely. Most 
> of the time it completes in 50-80 microseconds, but there are occasions 
> when it takes several milliseconds (I've even logged 23 ms).
> 
> The pseudo-code looks like this:
> 
>   deadline = now;
> 
>   while ( 1 )
>   {
>     deadline += 277 µs
>     sleep_until(deadline)
>     t0 = now;
>     write 1316 bytes to PCI device
>     t1 = now;
>     if (t1-t0 > 100 µs) scream & panic
>   }
> 
> Relevant (?) information about the setup:
> 
> I'm running a PREEMPT_RT kernel with high-resolution timers.
> (Specifically 2.6.20.7-rt8)
> http://rt.wiki.kernel.org/index.php/Main_Page
> HZ=100
> The process is in SCHED_RR with priority 75.
> The only "process" (?) with higher priority is posix_cpu_timer.
> write() is implemented as an ioctl in the driver.
> You might think that write() blocks when the buffers on the PCI board 
> are full, but I am 99.9% sure that the buffers are never full.
> 
> 
> Here's my question:
> 
> When my process comes back from a write operation, and I find that I 
> have been blocked for more than X ms, can I call a function from a 
> system profiler (oprofile perhaps?) to know exactly where in the kernel 
> the CPU has been for the last X ms, and how much time has been spent in 
> each function, either sleeping or doing something?

Perhaps I could take this matter to a different list?

      reply	other threads:[~2007-06-21 15:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-19  9:02 Selective system profiling John Sigler
2007-06-21 15:05 ` John Sigler [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=467A93BF.9020104@free.fr \
    --to=linux.kernel@free.fr \
    --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