On Wed, 2018-09-19 at 10:21 +0800, jianchao.wang wrote:
On 09/19/2018 01:44 AM, Bart Van Assche wrote:
quoted
There is only one blk_pm_request_resume() call and that call is
inside blk_queue_enter() after the pm_only counter has been
checked.
For the legacy block layer, nr_pending is increased after the
blk_queue_enter() call from inside blk_old_get_request() succeeded.
So I don't see how blk_pm_request_resume() or q->nr_pending++ could
escape from the preempt checking?
For example:
blk_pre_runtime_suspend generic_make_request
blk_queue_enter //
success here, no blk_pm_request_resume here
blk_mq_make_requset
blk_set_pm_only
if (blk_requests_in_flight(q) == 0) {
synchronize_rcu();
if (blk_requests_in_flight(q) == 0)
ret = 0;
}
blk_mq_get_request
Hello Jianchao,
I think you are right. I will add a q_usage_counter check before
setting 'ret' to zero.
Bart.