All of lore.kernel.org
 help / color / mirror / Atom feed
From: j.w.r.degoede@hhs.nl (Hans de Goede)
To: lm-sensors@vger.kernel.org
Subject: [lm-sensors] new abituguru driver in mm kernel
Date: Thu, 27 Jul 2006 08:19:17 +0000	[thread overview]
Message-ID: <44C87705.6000301@hhs.nl> (raw)
In-Reply-To: <ce9ef0d90607041146t6837a584x68d1ab7e528139ea@mail.gmail.com>



Sunil Kumar wrote:
> On 7/26/06, Hans de Goede <j.w.r.degoede at hhs.nl> wrote:
>>
>> Hmm, how did you measure this? According to top gkrellm on my system
>> never comes above the 0.7 percent, then again on my system the wait
>> function usually returns pretty fast.
> 
> 
> by simply staring at the gkrellm chart where it plots cpu usage and shows a
> number in %age for it as well. The jump from 2% to 4% is easily noticeable,
> particulalrly when it happens every 5 second on a quiet system, but I think
> a more detailed analysis should probably be done.
> 
> 

Ah, just about as scientific as my way.

> My worries are because abituguru_wait gets called 148 times for one
> 
> 
> So many reads actually make the case for  tight loop weaker and for
> sleeping
> stronger, because the loop actually will run 250*148~7000 times per
> update
> without doing anything useful apart from seeing if its ok to read. I am
> sure
> lesser CPUs will see more %age being used every 5 seconds. May be we can
> have someone with 1ghz cpu to monitor gkrellm with and without abituguru
> and
> report.
> 

Erm, that is incorrect twice. First of all on average it will only do
40-50 iterations in the loop. The 250 is a worst case scenario, and
appearantly in reality not enough (with your motherboard). This is
exactly why I've suggested lowering ABIT_UGURU_WAIT_TIMEOUT to 100, so
that we make the worsecase scenario burn less CPU, without slowing down
the normal case. We can lower it now, since normally all waits will
succeed within that 100, and in the few exceptions we have the sleep
now, which should be more then enough a wait for the uguru to respond if
it was distracted.

Also the CPU usage will be CPU-speed independent. This loops execution
speed is throttled by the ISA bus which runs at 7Mhz fixed. So the
execution time (and thus %age) will be the same independent of CPU-speed.


> update! So on a system running at 100 HZ, that could get translated to
>> blocking the program trying to read a sensor for 1.5 seconds.
> 
> 
> This is the unfortunate part. People with 100 hz will suffer terrible delay
> if the read state is not reached fast. But we are talking about a
> monitoring
> program, not some essential kernel component which can fail something
> critical. For 1000hz it is only 150ms. Note that it is advised to run linux
> 2.6 with HZ 1000. May be we can make the determination of how early to
> go to
> sleep based upon the value of HZ, by adjusting the difference between
> TIMEOUT and TIMEOUT_SLEEP dynamically based on HZ. Please also realize that
> with every 1 jiffy sleep, the chances of reaching the next sleep reduce
> tremendously (unless uguru has died and not responding at all...:)) But I
> have a feeling that sleep in steps of 1 jiffy is in order if loop times out
> 50 or so iterations.
> 
> Also, someone using 100 hz will never like a long tight loop in anything
> periodic like sensors because the whole point of choosing hz 100 was to
> give
> as much cpu to useful work as possible (like on a server). But, as I said,
> its an unfortunate conflicting requirement.
> 

Thats because of the unfortunate bad uGuru interface design :|
Anyways as said before could you please give the last version I mailed
you with ABIT_UGURU_WAIT_TIMEOUT changed to 100 a try, I think that will
cure most of you CPU usage problem in a nice simple and clean way.

Regards,

Hans



  parent reply	other threads:[~2006-07-27  8:19 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-04 18:46 [lm-sensors] new abituguru driver in mm kernel Sunil Kumar
2006-07-04 20:10 ` Stephen Cormier
2006-07-05  6:38 ` Hans de Goede
2006-07-05 16:35 ` Sunil Kumar
2006-07-05 17:37 ` Jean Delvare
2006-07-05 17:41 ` Hans de Goede
2006-07-05 17:44 ` Hans de Goede
2006-07-05 20:11 ` Hans de Goede
2006-07-05 20:16 ` Sunil Kumar
2006-07-06  1:09 ` Sunil Kumar
2006-07-06  1:24 ` Stephen Cormier
2006-07-08 23:03 ` Sunil Kumar
2006-07-09  8:16 ` Hans de Goede
2006-07-09 14:44 ` Sunil Kumar
2006-07-09 16:41 ` Sunil Kumar
2006-07-09 17:11 ` Hans de Goede
2006-07-09 17:30 ` Sunil Kumar
2006-07-09 20:32 ` Hans de Goede
2006-07-09 20:54 ` Sunil Kumar
2006-07-10  4:33 ` Hans de Goede
2006-07-11  4:43 ` Sunil Kumar
2006-07-14 19:15 ` Hans de Goede
2006-07-14 19:33 ` Sunil Kumar
2006-07-14 19:43 ` Hans de Goede
2006-07-14 19:50 ` Sunil Kumar
2006-07-15  0:52 ` Sunil Kumar
2006-07-19  4:35 ` Hans de Goede
2006-07-19 20:34 ` Sunil Kumar
2006-07-19 22:42 ` Sunil Kumar
2006-07-19 23:02 ` Sunil Kumar
2006-07-20  5:23 ` Sunil Kumar
2006-07-20  7:54 ` Hans de Goede
2006-07-20 14:37 ` Sunil Kumar
2006-07-20 17:13 ` Sunil Kumar
2006-07-20 17:14 ` Sunil Kumar
2006-07-21  6:10 ` Hans de Goede
2006-07-21 16:15 ` Sunil Kumar
2006-07-25  3:27 ` Sunil Kumar
2006-07-26 14:30 ` Hans de Goede
2006-07-26 18:32 ` Sunil Kumar
2006-07-26 20:43 ` Hans de Goede
2006-07-27  0:48 ` Sunil Kumar
2006-07-27  8:19 ` Hans de Goede [this message]
2006-07-27 14:31 ` Sunil Kumar
2006-07-27 14:44 ` Hans de Goede
2006-07-27 16:07 ` Sunil Kumar
2006-08-01  4:01 ` Hans de Goede
2006-08-25 23:13 ` Sunil Kumar

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=44C87705.6000301@hhs.nl \
    --to=j.w.r.degoede@hhs.nl \
    --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.