From: Jeff Garzik <jgarzik-e+AXbWqSrlAAvxtiuMwx3w@public.gmane.org>
To: Pavel Machek <pavel-+ZI9xUNit7I@public.gmane.org>
Cc: ACPI mailing list
<acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>,
kernel list
<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: acpi_os_queue_for_execution()
Date: Sat, 28 Dec 2002 15:27:16 -0500 [thread overview]
Message-ID: <20021228202716.GA28570@gtf.org> (raw)
In-Reply-To: <20021223181747.GA10363-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
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
next prev parent reply other threads:[~2002-12-28 20:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Jeff Garzik [this message]
[not found] ` <20021228202716.GA28570-bB7D8CACdjo@public.gmane.org>
2002-12-29 18:11 ` acpi_os_queue_for_execution() Pavel Machek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20021228202716.GA28570@gtf.org \
--to=jgarzik-e+axbwqsrlaavxtiumwx3w@public.gmane.org \
--cc=acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=pavel-+ZI9xUNit7I@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox