public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Problem:  CPU sleep when calling a function in another object for the first time.
@ 2007-10-15 21:11 John Marconi
  2007-10-19 19:58 ` Phillip Susi
  0 siblings, 1 reply; 3+ messages in thread
From: John Marconi @ 2007-10-15 21:11 UTC (permalink / raw)
  To: linux-kernel

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?

Thank you in advance,
John

^ permalink raw reply	[flat|nested] 3+ messages in thread
[parent not found: <fa.tipEk8FmQyQBLuKMUWoW6rAg1Yc@ifi.uio.no>]

end of thread, other threads:[~2007-10-19 19:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
     [not found] <fa.tipEk8FmQyQBLuKMUWoW6rAg1Yc@ifi.uio.no>
2007-10-18  0:27 ` Robert Hancock

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox