Re: [3/4] eliminate bh waitqueue hashtable

Andrew Morton
2004-08-28T09:50:25Z

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(...);
}