lkml.org 
[lkml]   [2004]   [Aug]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [3/4] eliminate bh waitqueue hashtable
    William Lee Irwin III <wli@holomorphy.com> wrote:
    >
    > +static inline int wait_on_bit(void *word, int bit,
    > + int (*wait)(void *), unsigned mode)
    > +{
    > + DEFINE_WAIT_BIT(q, word, bit);
    > + wait_queue_head_t *wqh = bit_waitqueue(word, bit);
    > +
    > + return __wait_on_bit(wqh, &q, word, bit, wait, mode);
    > +}

    It worries me a bit (sic) that we're calling the relatively expensive
    bit_waitqueue() even if the bit is not set.

    Maybe it should be

    static inline int wait_on_bit(...)
    {
    if (test_bit(...))
    out_of_line_wait_on_bit(...);
    }
    -
    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:05    [W:0.021 / U:0.732 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site