lkml.org 
[lkml]   [2011]   [Nov]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v3] PM/Memory-hotplug: Avoid task freezing failures
    Hello, Rafael.

    On Sat, Nov 19, 2011 at 10:57:19PM +0100, Rafael J. Wysocki wrote:
    > > + while (!mutex_trylock(&pm_mutex)) {
    > > + try_to_freeze();
    > > + msleep(10);
    >
    > The number here seems to be somewhat arbitrary. Is there any reason not to
    > use 100 or any other number?

    This is a bit moot at this point but, at least for me, yeah, it's a
    number I pulled out of my ass. That said, I think it's a good number
    to pull out of ass for userland visible retry delays for the following
    reasons.

    * It's a good number - 10! which happens to match the number of
    fingers I have! Isn't that just weird? @.@

    * For modern hardware of most classes, repeating not-so-complex stuff
    every 10ms for a while isn't taxing (or even noticeable) at all.

    * Sub 10ms delays usually aren't noticeable to human beings even when
    several of them are staggered. This is very different when you get
    to 100ms range.

    ie. going from 1ms to 10ms doesn't cost you too much in terms of human
    noticeable latency (for this type of situations anyway) but going from
    10ms to 100ms does. In terms of computational cost, the reverse is
    somewhat true too. So, yeah, I think 10ms is a good out-of-ass number
    for this type of delays.

    Thanks.

    --
    tejun


    \
     
     \ /
      Last update: 2011-11-21 17:51    [W:3.263 / U:0.516 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site