[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d28bca3a-196d-1520-35cf-bec1e1872d34@oracle.com>
Date: Fri, 24 Aug 2018 10:06:56 +0800
From: "jianchao.wang" <jianchao.w.wang@...cle.com>
To: Jens Axboe <axboe@...nel.dk>
Cc: linux-block@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] blk-wbt: get back the missed wakeup from __wbt_done
Hi Jens
On 08/23/2018 11:42 PM, Jens Axboe wrote:
>> -
>> - __set_current_state(TASK_RUNNING);
>> - remove_wait_queue(&rqw->wait, &wait);
>> + wbt_init_wait(&wait, &data);
>> + prepare_to_wait_exclusive(&rqw->wait, &wait,
>> + TASK_UNINTERRUPTIBLE);
>> + if (lock) {
>> + spin_unlock_irq(lock);
>> + io_schedule();
>> + spin_lock_irq(lock);
>> + } else
>> + io_schedule();
> Aren't we still missing a get-token attempt after adding to the
> waitqueue? For the case where someone frees the token after your initial
> check, but before you add yourself to the waitqueue.
I used to think about this.
However, there is a very tricky scenario here:
We will try get the wbt budget in wbt_wake_function.
After add a task into the wait queue, wbt_wake_function has been able to
be invoked for this task. If we get the wbt budget after prepare_to_wait_exclusive,
we may get wbt budget twice.
Thanks
Jianchao
Powered by blists - more mailing lists