mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Very long startup time for a new thread
@ 2006-07-13  6:07 Mikael Starvik
  2006-07-13  7:14 ` Arjan van de Ven
  2006-07-13  7:36 ` Mike Galbraith
  0 siblings, 2 replies; 5+ messages in thread
From: Mikael Starvik @ 2006-07-13  6:07 UTC (permalink / raw)
  To: 'Linux Kernel Mailing List'

(This is on a 200 MIPS embedded architecture).

On a heavily loaded system (loadavg ~4) I create a new pthread. In this
situation it takes ~4 seconds (!) before the thread is first scheduled in
(yes, I have debug outputs in the scheduler to check that). In a 2.4 based
system I don't see the same thing. I don't have any RT or FIFO tasks. Any
ideas why it takes so long time and what I can do about it?

Appreciate any help
/Mikael


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Very long startup time for a new thread
  2006-07-13  6:07 Very long startup time for a new thread Mikael Starvik
@ 2006-07-13  7:14 ` Arjan van de Ven
  2006-07-13  7:36 ` Mike Galbraith
  1 sibling, 0 replies; 5+ messages in thread
From: Arjan van de Ven @ 2006-07-13  7:14 UTC (permalink / raw)
  To: Mikael Starvik; +Cc: 'Linux Kernel Mailing List'

On Thu, 2006-07-13 at 08:07 +0200, Mikael Starvik wrote:
> (This is on a 200 MIPS embedded architecture).
> 
> On a heavily loaded system (loadavg ~4) I create a new pthread. In this
> situation it takes ~4 seconds (!) before the thread is first scheduled in
> (yes, I have debug outputs in the scheduler to check that). In a 2.4 based
> system I don't see the same thing. I don't have any RT or FIFO tasks. Any
> ideas why it takes so long time and what I can do about it?

I assume you're using a new enough glibc that supports NPTL ?



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Very long startup time for a new thread
  2006-07-13  6:07 Very long startup time for a new thread Mikael Starvik
  2006-07-13  7:14 ` Arjan van de Ven
@ 2006-07-13  7:36 ` Mike Galbraith
  1 sibling, 0 replies; 5+ messages in thread
From: Mike Galbraith @ 2006-07-13  7:36 UTC (permalink / raw)
  To: Mikael Starvik; +Cc: 'Linux Kernel Mailing List'

On Thu, 2006-07-13 at 08:07 +0200, Mikael Starvik wrote:
> (This is on a 200 MIPS embedded architecture).
> 
> On a heavily loaded system (loadavg ~4) I create a new pthread. In this
> situation it takes ~4 seconds (!) before the thread is first scheduled in
> (yes, I have debug outputs in the scheduler to check that). In a 2.4 based
> system I don't see the same thing. I don't have any RT or FIFO tasks. Any
> ideas why it takes so long time and what I can do about it?

If your new thread is runnable but not selected for those ~4 seconds, it
could be the interactivity code.  Try disabling that.

If you want to try a patch that targets this area, I have an old one for
2.6.16 you can play with.  With it, you can pretty much disable the
interactivity code without losing dynamic priority adjustment.  I also
have one for 2.6.17, and that one removes the interactivity code
entirely (hmm) but it also actively intervenes in scheduling decisions,
so might not be a good diagnostic.

	-Mike


^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: Very long startup time for a new thread
@ 2006-07-17  8:44 Mikael Starvik
  0 siblings, 0 replies; 5+ messages in thread
From: Mikael Starvik @ 2006-07-17  8:44 UTC (permalink / raw)
  To: Mikael Starvik, Linux Kernel Mailing List

Thanks to all that have made suggestions. Finnaly we found that 

#define MIN_TIMESLICE 5
#define DEF_TIMESLICE 25

works much better for us. Maybe it is an effect of that we have HZ=100 ?

/Mikael

-----Original Message-----
From: Mikael Starvik [mailto:mikael.starvik@axis.com] 
Sent: Thursday, July 13, 2006 8:08 AM
To: 'Linux Kernel Mailing List'
Subject: Very long startup time for a new thread


(This is on a 200 MIPS embedded architecture).

On a heavily loaded system (loadavg ~4) I create a new pthread. In this
situation it takes ~4 seconds (!) before the thread is first scheduled
in (yes, I have debug outputs in the scheduler to check that). In a 2.4
based system I don't see the same thing. I don't have any RT or FIFO
tasks. Any ideas why it takes so long time and what I can do about it?

Appreciate any help
/Mikael

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: Very long startup time for a new thread
       [not found] <BFECAF9E178F144FAEF2BF4CE739C66803F33440@exmail1.se.axis.com>
@ 2006-07-13  7:51 ` Mikael Starvik
  0 siblings, 0 replies; 5+ messages in thread
From: Mikael Starvik @ 2006-07-13  7:51 UTC (permalink / raw)
  To: 'Arjan van de Ven', Mikael Starvik
  Cc: 'Linux Kernel Mailing List'

Nope, no NPTL. Actually this system uses the pthread implementation in
uC-libc.

-----Original Message-----
From: Arjan van de Ven [mailto:arjan@infradead.org] 
Sent: Thursday, July 13, 2006 9:15 AM
To: Mikael Starvik
Cc: 'Linux Kernel Mailing List'
Subject: Re: Very long startup time for a new thread


On Thu, 2006-07-13 at 08:07 +0200, Mikael Starvik wrote:
> (This is on a 200 MIPS embedded architecture).
> 
> On a heavily loaded system (loadavg ~4) I create a new pthread. In this
> situation it takes ~4 seconds (!) before the thread is first scheduled in
> (yes, I have debug outputs in the scheduler to check that). In a 2.4 based
> system I don't see the same thing. I don't have any RT or FIFO tasks. Any
> ideas why it takes so long time and what I can do about it?

I assume you're using a new enough glibc that supports NPTL ?


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-07-17  8:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-13  6:07 Very long startup time for a new thread Mikael Starvik
2006-07-13  7:14 ` Arjan van de Ven
2006-07-13  7:36 ` Mike Galbraith
     [not found] <BFECAF9E178F144FAEF2BF4CE739C66803F33440@exmail1.se.axis.com>
2006-07-13  7:51 ` Mikael Starvik
2006-07-17  8:44 Mikael Starvik

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®