+30
−15
Loading
While nr_hw_update allocates tagset tags it acquires ->pcpu_alloc_mutex after ->freeze_lock is acquired or queue is frozen. This potentially creates a circular dependency involving ->fs_reclaim if reclaim is triggered simultaneously in a code path which first acquires ->pcpu_ alloc_mutex. As the queue is already frozen while nr_hw_queue update allocates tagsets, the reclaim can't forward progress and thus it could cause a potential deadlock as reported in lockdep splat[1]. Fix this by pre-allocating tagset tags before we freeze queue during nr_hw_queue update. Later the allocated tagset tags could be safely installed and used after queue is frozen. Reported-by:Yi Zhang <yi.zhang@redhat.com> Closes: https://lore.kernel.org/all/CAHj4cs8F=OV9s3La2kEQ34YndgfZP-B5PHS4Z8_b9euKG6J4mw@mail.gmail.com/ [1] Signed-off-by:
Nilay Shroff <nilay@linux.ibm.com> Reviewed-by:
Ming Lei <ming.lei@redhat.com> Tested-by:
Yi Zhang <yi.zhang@redhat.com> Reviewed-by:
Yu Kuai <yukuai@fnnas.com> [axboe: fix brace style issue] Signed-off-by:
Jens Axboe <axboe@kernel.dk>