On Thu, 2017-11-09 at 16:00 -0700, Jens Axboe wrote:
> +             spin_lock(&this_hctx->lock);
> +             if (!list_empty(&wait->entry)) {
> +                     spin_unlock(&this_hctx->lock);
> +                     return false;
> +             }
>  
> -     ws = bt_wait_ptr(&this_hctx->tags->bitmap_tags, this_hctx);
> -     add_wait_queue(&ws->wait, wait);
> +             ws = bt_wait_ptr(&this_hctx->tags->bitmap_tags, this_hctx);
> +             add_wait_queue(&ws->wait, wait);
> +     }

Hello Jens,

My understanding is that all code that adds a dispatch_wait entry to a wait
queue or removes it from a wait queue is protected by ws->wait.lock. Can you
explain why the above list_empty() check is protected by this_hctx->lock?

Thanks,

Bart.

Reply via email to