public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* ACPI slowdown...
@ 2001-02-07 17:54 Tony Hoyle
  2001-02-07 18:20 ` Tony Hoyle
  0 siblings, 1 reply; 5+ messages in thread
From: Tony Hoyle @ 2001-02-07 17:54 UTC (permalink / raw)
  To: linux-kernel

I've been trying to track down what makes ACPI kill the system in 2.4.1.

In the acpi_idle function (drivers/acpi/cpu.c), it seems to spend most 
of its time with interrupts disabled, only enabling them to check 
need_resched occasionally.

In the 'sleep1' state the following code is executed:

         for (;;) {
                 unsigned long time;
                 unsigned long diff;

                 __cli();
                 if (current->need_resched)
                         goto out;
                 time = acpi_read_pm_timer();
                 safe_halt();
                 diff = acpi_compare_pm_timers(time, acpi_read_pm_timer());
                 if (diff > acpi_c2_enter_latency
                     && acpi_max_c_state >= 2)
                         goto sleep2;
         }

This looks wrong to me.  It's basically looping with interrupts 
disabled.  I can't see how current->need_resched could be updated at 
all, so the loop will only terminate when the PM timer tells it to.

Isn't disabling interrupts a bad thing anyway?  Wouldn't it be better to 
leave them enabled (this is uniprocessor only so there shouldn't be 
concurrency issues).

Tony

-- 

The only secure computer is one that's unplugged, locked in a safe,
and buried 20 feet under the ground in a secret location... and i'm
not even too sure about that one"--Dennis Huges, FBI.

tmh@magenta-netlogic.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 5+ messages in thread
* RE: ACPI slowdown...
@ 2001-02-07 19:34 Grover, Andrew
  2001-02-08  0:23 ` Tony Hoyle
  0 siblings, 1 reply; 5+ messages in thread
From: Grover, Andrew @ 2001-02-07 19:34 UTC (permalink / raw)
  To: 'Tony Hoyle'; +Cc: linux-kernel, Acpi-linux (E-mail)

> From: Tony Hoyle [mailto:tmh@magenta-netlogic.com]
> OK I see that safe_halt() will re-enable interrupts.  However 
> this is only
> called in S1.  If your machine gets as far as S3 you have...

I think you mean C1 and C3, but I know what you mean.. :)

[C3 code snipped]

> There is no halt here... the interrupts are enabled for only 
> a couple of 
> instructions (one comparison and a jump) before being disabled again. 
> It seems to me if the computer gets into S3 it'll effectively 
> die until 
> some kind of busmaster device wakes it up (DMA?).

The problem I've had in fixing this code is that it WorksForMe(TM). I cannot
reproduce the problem on my machine (an IBM T20). That's the way the code
was, so I left it (the code I changed/broke was the C2/C3 latency calcs).

Since you have a symtomatic system, if you're willing to do some testing to
either prove or disprove your theory (that entering C2/C3 interrupts enabled
helps things) I would greatly appreciate it.

Also, the next ACPI update will let you disable using this code for idle (so
we have some breathing room while we fix it) and will print some more C
state info on boot, because although you don't say, it sounds like you have
a desktop system, which usually don't support C2/C3, and so should not be
trying to enter them.

Regards -- Andy
(ACPI maintainer)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

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

end of thread, other threads:[~2001-02-12 10:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-02-07 17:54 ACPI slowdown Tony Hoyle
2001-02-07 18:20 ` Tony Hoyle
2001-02-11 22:04   ` Pavel Machek
  -- strict thread matches above, loose matches on Subject: below --
2001-02-07 19:34 Grover, Andrew
2001-02-08  0:23 ` Tony Hoyle

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