From: Andrew Morton <akpm@digeo.com>
To: "Grover, Andrew" <andrew.grover@intel.com>
Cc: Pavel Machek <pavel@ucw.cz>,
ACPI mailing list <acpi-devel@lists.sourceforge.net>,
kernel list <linux-kernel@vger.kernel.org>
Subject: Re: [ACPI] acpi_os_queue_for_execution()
Date: Mon, 06 Jan 2003 03:44:23 -0800 [thread overview]
Message-ID: <3E196C17.7D318CAF@digeo.com> (raw)
In-Reply-To: F760B14C9561B941B89469F59BA3A84725A107@orsmsx401.jf.intel.com
"Grover, Andrew" wrote:
>
> > From: Pavel Machek [mailto:pavel@ucw.cz]
> > 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...
>
> Are we allowed to block in a timer callback? One of the things
> thermal_check does is call a control method, which in turn can be very
> slow, sleep, etc., so I'd guess that's why the code tries to execute
> things in its own thread.
>
acpi_thermal_run is doing many sinful things. Blocking memory
allocations as well as launching kernel threads from within a
timer handler.
Converting it to use schedule_work() or schedule_delayed_work()
would fix that up.
next prev parent reply other threads:[~2003-01-06 11:36 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-01-03 19:00 [ACPI] acpi_os_queue_for_execution() Grover, Andrew
2003-01-04 22:44 ` Matthew Wilcox
2003-01-05 12:23 ` Ingo Oeser
2003-01-06 11:12 ` Pavel Machek
2003-01-06 11:44 ` Andrew Morton [this message]
2003-01-06 12:58 ` Andrew McGregor
2003-01-06 17:26 ` Faye Pearson
-- strict thread matches above, loose matches on Subject: below --
2003-01-07 14:23 peter.holmes
2003-01-08 9:47 ` Faye Pearson
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=3E196C17.7D318CAF@digeo.com \
--to=akpm@digeo.com \
--cc=acpi-devel@lists.sourceforge.net \
--cc=andrew.grover@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=pavel@ucw.cz \
/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