Skip to contentSkip to conversation

Why schedule in thaw_processes

DISCUSSION Uli Luckas 2 participants 2 messages Jun 28, 2007 – Jun 29, 2007

lore
Share & tools
lore

Uli Luckas

author
#0 lore raw

Dear PM Team,
i am working my way through the Linux power managemen subsystem, trying to understand, benchmark and improve our ARM based device's suspend/resume cycles.
I measure the time from a wakeup event until suspend_finish() returns. I was very confused, why this interval varies between 150ms and 300ms. Walking the code I found the difference between 150ms wakeups and 300ms wakeups to come from a call to schedule() in thaw_processes().
I do realise, that these extra 150ms are not wasted, as they are spent in other threads, doing what these threads need to do any way. Still an unneeded schedule() is overhead in itself and probably would not have been introduced without reason.

So, can anyone explain, why this schedule() is of any benefit?

regards,
Uli

Signature · 12 lines
------- ROAD ...the handyPC Company - - -  ) ) )

Uli Luckas
Software Development

ROAD GmbH
Bennigsenstr. 14 | 12159 Berlin | Germany
fon: +49 (30) 230069 - 64 | fax: +49 (30) 230069 - 69
url: www.road.de

Amtsgericht Charlottenburg: HRB 96688 B
Managing directors: Hans-Peter Constien, Hubertus von Streit
#1 lore raw

Hi Uli,

Sorry for the delay, I've been a bit busy recently.

Quoted 13 lines · Uli Luckas

Dear PM Team,
i am working my way through the Linux power managemen subsystem, trying to understand, benchmark and improve our ARM based device's suspend/resume cycles.
I measure the time from a wakeup event until suspend_finish() returns. I was very confused, why this interval varies between 150ms and 300ms. Walking the code I found the difference between 150ms wakeups and 300ms wakeups to come from a call to schedule() in thaw_processes().
I do realise, that these extra 150ms are not wasted, as they are spent in other threads, doing what these threads need to do any way. Still an unneeded schedule() is overhead in itself and probably would not have been introduced without reason.

Quoted 1 line

So, can anyone explain, why this schedule() is of any benefit?

The reason, AFAICS, is that if there are threads of higher priority than us, in particular with real time priority, we want them to be able to run as soon as the're thawed.

Still, I don't think that's really essential, so we can remove this schedule().

Greetings,
Rafael

Signature · 1 line
"Premature optimization is the root of all evil." - Donald Knuth