public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* acpi_os_queue_for_execution()
@ 2002-12-23 18:17 Pavel Machek
       [not found] ` <20021223181747.GA10363-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Pavel Machek @ 2002-12-23 18:17 UTC (permalink / raw)
  To: ACPI mailing list, kernel list

Hi!

Acpi seems to create short-lived kernel threads, and I don't quite
understand why. 

In thermal.c


                        tz->timer.data = (unsigned long) tz;
                        tz->timer.function = acpi_thermal_run;
                        tz->timer.expires = jiffies + (HZ * sleep_time) / 1000;
                        add_timer(&(tz->timer));

and acpi_thermal_run creates kernel therad that runs
acpi_thermal_check. Why is not acpi_thermal_check called directly? I
don't like idea of thread being created every time thermal zone needs
to be polled...
								Pavel

-- 
Worst form of spam? Adding advertisment signatures ala sourceforge.net.
What goes next? Inserting advertisment *into* email?

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

* Re: acpi_os_queue_for_execution()
       [not found] ` <20021223181747.GA10363-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
@ 2002-12-28 20:27   ` Jeff Garzik
       [not found]     ` <20021228202716.GA28570-bB7D8CACdjo@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff Garzik @ 2002-12-28 20:27 UTC (permalink / raw)
  To: Pavel Machek; +Cc: ACPI mailing list, kernel list

On Mon, Dec 23, 2002 at 07:17:48PM +0100, Pavel Machek wrote:
> Hi!
> 
> Acpi seems to create short-lived kernel threads, and I don't quite
> understand why. 
> 
> In thermal.c
> 
> 
>                         tz->timer.data = (unsigned long) tz;
>                         tz->timer.function = acpi_thermal_run;
>                         tz->timer.expires = jiffies + (HZ * sleep_time) / 1000;
>                         add_timer(&(tz->timer));
> 
> and acpi_thermal_run creates kernel therad that runs
> acpi_thermal_check. Why is not acpi_thermal_check called directly? I
> don't like idea of thread being created every time thermal zone needs
> to be polled...

This is the standard way to get process context [i.e. somewhere where
you can sleep].  The new delayed-work workqueue code in 2.5.x does
something almost exactly like that under the covers.

That said, it sounds like you found something to fix in ACPI:

In 2.4.x ACPI, it should be using schedule_task(), and in 2.5.x it should
be using schedule_work(), if this is truly the intention of the ACPI
subsystem.

There shouldn't be much reason to continually spawn single-run threads
when there is already an API for doing so.

	Jeff

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

* Re: acpi_os_queue_for_execution()
       [not found]     ` <20021228202716.GA28570-bB7D8CACdjo@public.gmane.org>
@ 2002-12-29 18:11       ` Pavel Machek
  0 siblings, 0 replies; 3+ messages in thread
From: Pavel Machek @ 2002-12-29 18:11 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Pavel Machek, ACPI mailing list, kernel list

Hi!

> > Acpi seems to create short-lived kernel threads, and I don't quite
> > understand why. 
> > 
> > In thermal.c
> > 
> > 
> >                         tz->timer.data = (unsigned long) tz;
> >                         tz->timer.function = acpi_thermal_run;
> >                         tz->timer.expires = jiffies + (HZ * sleep_time) / 1000;
> >                         add_timer(&(tz->timer));
> > 
> > and acpi_thermal_run creates kernel therad that runs
> > acpi_thermal_check. Why is not acpi_thermal_check called directly? I
> > don't like idea of thread being created every time thermal zone needs
> > to be polled...
> 
> This is the standard way to get process context [i.e. somewhere where
> you can sleep].  The new delayed-work workqueue code in 2.5.x does
> something almost exactly like that under the covers.

Is it really true that fork() can not sleep?

> That said, it sounds like you found something to fix in ACPI:
> 
> In 2.4.x ACPI, it should be using schedule_task(), and in 2.5.x it should
> be using schedule_work(), if this is truly the intention of the ACPI
> subsystem.

Agreed.
								Pavel

-- 
Casualities in World Trade Center: ~3k dead inside the building,
cryptography in U.S.A. and free speech in Czech Republic.

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

end of thread, other threads:[~2002-12-29 18:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-23 18:17 acpi_os_queue_for_execution() Pavel Machek
     [not found] ` <20021223181747.GA10363-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2002-12-28 20:27   ` acpi_os_queue_for_execution() Jeff Garzik
     [not found]     ` <20021228202716.GA28570-bB7D8CACdjo@public.gmane.org>
2002-12-29 18:11       ` acpi_os_queue_for_execution() Pavel Machek

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