From: Jean Delvare <khali@linux-fr.org>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] lm-sensors 3.0.0-rc1 has been released!
Date: Thu, 04 Oct 2007 13:42:07 +0000 [thread overview]
Message-ID: <20071004154207.672bb388@hyperion.delvare> (raw)
In-Reply-To: <20070925233316.7afaa297@hyperion.delvare>
Hi Henrique,
On Thu, 4 Oct 2007 09:49:30 -0300, Henrique de Moraes Holschuh wrote:
> On Thu, 04 Oct 2007, Jean Delvare wrote:
> > Stuck in D state? I don't understand. Won't the signal simply be
> > delayed until the lock is released?
>
> The point is, what if the lock is NOT released (for a long time/at all)?
> There would be no need for mutex_lock_interruptible to exist if that was not
> an issue. The real question is, could this happen in thinkpad-acpi or other
> hwmon chip drivers?
>
> Of course, locks not being released are the sign of huge bugs on most of
> hwmon that do operations that are bounded and fast in the first place, but
> for complex drivers that call into the ACPI interpretor, that is not so
> clear.
It really depends on what you consider a "long" time. Some hwmon
drivers can take the lock for one second (reading all the register
values at once), which qualifies as long in some contexts, sure. But
for a hardware monitoring applet, this seems reasonably short to me.
And yes, never-returning locks would be bugs, so we don't have to
consider this case.
> (...)
> I'd send the patches, yes. But so far, I could not make heads-and-tails of
> the libsensors code. I am studying it. I will have more time after the
> merge window for 2.6.24 closes.
You're looking at the lm-sensors-3.0.0 branch, right? The library code
there is rather sane IMHO, in comparison to trunk ;) There's not much
you have to look at: sensors_read_sysfs_attr() and
sensors_write_sysfs_attr() in lib/sysfs.c, and sensors_get_value() and
sensors_set_value() in lib/access.c. And then error.h and error.c if
you need to add error codes. And that's about it, I think.
> As for proving to you that this complexity is needed, well, I don't have any
> latency-sensitive loads here, nor do I play with real-time audio. But I
> will be sure to tell you if I meet an easily reproducible scenario involving
> libsensors. I *know* first hand of such scenarios when dealing, e.g., with
> /dev/hwrandom, which stalls for long times on slow hardware rngs. But even
> ACPI EC access is not supposed to stall for that long unless it is broken...
Maybe it's just me missing the point, but I don't really see how
real-time audio fits in the picture. Non-interruptible locks don't
block your entire system, just the process in question, i.e. in our
case the application which is using libsensors. So my impression is
that having hwmon drivers return -EINTR rather than delaying signals
only matters if the same application that is using libsensors also
needs to do low-latency work. I don't know of any such application,
which is why I think we don't care.
Also worth reminding is the fact that a non-waiting call to
sensors_get_value() may take 1 second for some drivers. So if you are
worried about latency for the waiting case, you are most probably as
much worried about the non-waiting case. This pretty much forbids
mixing time-critical tasks with libsensors as far as I can see.
--
Jean Delvare
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
next prev parent reply other threads:[~2007-10-04 13:42 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-25 21:33 [lm-sensors] lm-sensors 3.0.0-rc1 has been released! Jean Delvare
2007-09-25 21:45 ` Philip Edelbrock
2007-09-26 21:02 ` Hans de Goede
2007-09-27 14:35 ` Jean Delvare
2007-09-27 14:42 ` Jean Delvare
2007-09-27 17:53 ` Henrique de Moraes Holschuh
2007-09-28 17:07 ` Jean Delvare
2007-09-28 20:13 ` Henrique de Moraes Holschuh
2007-09-29 13:39 ` Jean Delvare
2007-09-30 0:56 ` Henrique de Moraes Holschuh
2007-09-30 11:54 ` Jean Delvare
2007-09-30 12:10 ` Jean Delvare
2007-09-30 14:54 ` Henrique de Moraes Holschuh
2007-10-03 10:36 ` Jean Delvare
2007-10-03 11:38 ` Henrique de Moraes Holschuh
2007-10-04 9:45 ` Jean Delvare
2007-10-04 12:49 ` Henrique de Moraes Holschuh
2007-10-04 13:42 ` Jean Delvare [this message]
2007-10-07 11:21 ` Axel Thimm
2007-10-17 21:44 ` Jean Delvare
2007-10-18 7:17 ` Hans de Goede
2007-10-18 8:18 ` Aurelien Jarno
2007-10-19 14:46 ` Jean Delvare
2007-10-19 20:18 ` Hans de Goede
2007-10-20 18:13 ` Jean Delvare
2007-10-20 22:41 ` Hans de Goede
2007-10-21 19:08 ` Jean Delvare
2007-10-21 19:13 ` Hans de Goede
2007-10-21 21:12 ` Jean Delvare
2007-10-22 7:06 ` Hans de Goede
2007-10-22 7:48 ` Jean Delvare
2007-10-22 8:13 ` Hans de Goede
2007-10-22 8:23 ` Jean Delvare
2007-10-22 9:40 ` Hans de Goede
2007-10-22 11:55 ` Jean Delvare
2007-10-22 13:15 ` Hans de Goede
2007-10-22 13:55 ` Jean Delvare
2007-10-22 19:27 ` Hans de Goede
2007-10-22 22:25 ` Aurelien Jarno
2007-10-24 15:30 ` Jean Delvare
2007-10-24 17:09 ` Hans de Goede
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=20071004154207.672bb388@hyperion.delvare \
--to=khali@linux-fr.org \
--cc=lm-sensors@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.