Re: CPU spikes when migrating proprietary code from AS 2.1 to AS 3.0

From: David Schwartz (davids_at_webmaster.com)
Date: 12/24/04

  • Next message: Uday Mullangi: "NFS mounting"
    Date: Thu, 23 Dec 2004 21:59:21 -0800
    
    

    "Sean Kirkpatrick" <sean.kirkpatrick@pipelinetrading.com> wrote in message
    news:1103829014.288911.225510@z14g2000cwz.googlegroups.com...

    > The attached program demonstrates the problem. It can be run as a
    > daemon (default) or non-daemon (cmd opt -no-daemon). It will stat a
    > non existent file 100 times every 10 milliseconds, using select to
    > sleep. (I have also tried using nanosleep with the same results.) When
    > run on the 2.4.21 SMP kernels it will quickly begin to accumulate CPU
    > time, caused by these intermittent spikes as opposed to a steady
    > build-up. When run on the 2.4.9 SMP kernel or the 2.4.21 NON - SMP
    > kernel, there are no cpu spikes, and no accumulation of CPU time.

        You *cannot* use 'select' for this purpose. Read the POSIX definition of
    'select' carefully, and you will see that it is perfectly legal for 'select'
    to be a no-operation when used this way. On the other hand, 'nanoleep' is
    *required* to sleep for at least the amount of time you specified, but bugs
    occasionaly cause it to not do so. My bet is that an increase in the
    scheduling rate has caused your 10 millisecond sleep to no longer be
    appropriate.

        DS


  • Next message: Uday Mullangi: "NFS mounting"

    Relevant Pages

    • Re: Re-entrancy???
      ... Sleep calls will just slow the application down. ... Whether or not PeekMessage is occuring in DoEvents ... has no impact on the overall CPU utilization. ... correctly, using the timeXXXX-APIs. ...
      (microsoft.public.vb.general.discussion)
    • Re: cpufreq est and Enhanced Sleep (Cx) States for Intel Core and above
      ... Adam McDougall wrote: ... >> Another thing I wish could work is the Enhanced cpu Sleep States; ... The major reason being that the acpi cpu> driver does not support well multiprocessor systems. ... I've not updated the patch since then so> it might or might not apply cleanly to a recent current. ...
      (freebsd-current)
    • Re: cpufreq est and Enhanced Sleep (Cx) States for Intel Core and above
      ... > Another thing I wish could work is the Enhanced cpu Sleep States; ... > this Dell Latitude D820 laptop only sees C1 although the document ... > acpi stuff and/or verbose boot logs if it would be helpful. ...
      (freebsd-current)
    • CPU spikes when migrating proprietary code from AS 2.1 to AS 3.0
      ... We have observed CPU utilization spikes when porting our software from ... If we switch to the non SMP ... run on the 2.4.21 SMP kernels it will quickly begin to accumulate CPU ...
      (comp.os.linux.misc)
    • CPU spikes when migrating proprietary code from AS 2.1 to AS 3.0
      ... We have observed CPU utilization spikes when porting our software from ... If we switch to the non SMP ... run on the 2.4.21 SMP kernels it will quickly begin to accumulate CPU ...
      (comp.os.linux.development.apps)