lkml.org 
[lkml]   [2002]   [Jun]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] 2.5.21 Nonlinear CPU support
    Anton Altaparmakov wrote:
    >>
    >> Note that there is no requirement that we're still on cpu "cpu" when
    >> we allocate the buffer. Furthermore, if we fail, we just loop right
    >> back to the top.
    >
    >
    > What is the point though? Why not just:
    >
    > if (!unlikely(decompression_buffers)) {
    > down_sem();
    > allocate_decompression_buffers();
    > up_sem();
    > }
    >
    > And be done with it?
    >
    > I don't see any justification for the increased complexity...
    >

    Race condition -- you have to drop out of the critical section before
    you grab the allocation sempahore, and another CPU can grab the
    semaphore in that time.

    Thus, the buffers might appear right under your nose.

    -hpa


    -
    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 13:26    [W:0.093 / U:34.256 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site