lkml.org 
[lkml]   [2004]   [Oct]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [patch rfc] towards supporting O_NONBLOCK on regular files
    From
    Date
    On Oct 17, 2004, Ingo Molnar <mingo@redhat.com> wrote:

    > I.e. the readahead-kicking is necessary after all, because
    > squid apparently assumes that re-trying a read will eventually succeed.

    I'm not sure it assumes that. It definitely expects read to succeed
    if poll says there is data available from the file, though, and having
    poll return that there is data, and then having read fail because
    there isn't anything there, so that you go back to poll, is a recipe
    for wasting CPU. I do think read should kick in readahead, yes, but
    so should poll, if the process says it wants to read from the file,
    and poll should not return (or not say data is available) unless an
    immediate, atomic call to read would actually return some data. Of
    course, if the data happens to be elicited from memory between the
    poll and read calls, it's legitimate for read to fail with -EAGAIN,
    but this shouldn't happen very often.

    --
    Alexandre Oliva http://www.ic.unicamp.br/~oliva/
    Red Hat Compiler Engineer aoliva@{redhat.com, gcc.gnu.org}
    Free Software Evangelist oliva@{lsd.ic.unicamp.br, gnu.org}
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 14:07    [W:0.043 / U:1.948 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site