From: Robert Hancock <hancockr@shaw.ca>
To: John Marconi <john.marconi@utstar.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Problem: CPU sleep when calling a function in another object for the first time.
Date: Wed, 17 Oct 2007 18:27:56 -0600 [thread overview]
Message-ID: <4716A88C.2050204@shaw.ca> (raw)
In-Reply-To: <fa.tipEk8FmQyQBLuKMUWoW6rAg1Yc@ifi.uio.no>
John Marconi wrote:
> Hello,
>
> I have been seeing a problem in which one of my CPUs goes to sleep for
> 40ms in the middle of running a user-space program. The problem occurs
> when I have a function in object file X call another function in object
> file Y. If I add a gettimeofday right before the function call occurs,
> and then also right at the beginning of the called function, I see a
> 40ms delay. This only occurs on the first call to any function in file
> Y. Once a function in file Y is called, all other calls to functions in
> this file are immediate.
>
> I have added a kernel profiler to the timer interrupt of this CPU - and
> find that during this 40ms period, the CPU is in r4k_wait - which looks
> like cpu_idle is running. It almost seems like file Y is being loaded
> into memory to be used.
>
> The program in question is using pthreads and each thread is on a
> separate CPU. Each CPU is dedicated to running a single thread and
> nothing else. The files X and Y are two object files linked into a
> single ELF binary. The kernel version is 2.6.14 and this is a MIPS
> based processor.
>
> Does anyone have any ideas why this delay might be occurring?
Binaries get loaded into memory on demand, so it's quite possible that
that part of the executable hasn't been loaded until something calls a
function within it.
--
Robert Hancock Saskatoon, SK, Canada
To email, remove "nospam" from hancockr@nospamshaw.ca
Home Page: http://www.roberthancock.com/
next parent reply other threads:[~2007-10-18 0:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <fa.tipEk8FmQyQBLuKMUWoW6rAg1Yc@ifi.uio.no>
2007-10-18 0:27 ` Robert Hancock [this message]
2007-10-15 21:11 Problem: CPU sleep when calling a function in another object for the first time John Marconi
2007-10-19 19:58 ` Phillip Susi
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=4716A88C.2050204@shaw.ca \
--to=hancockr@shaw.ca \
--cc=john.marconi@utstar.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