Re: [PATCH 2/2] block: free merged request in the caller

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 02, 2017 at 09:06:13AM -0700, Jens Axboe wrote:
> If we end up doing a request-to-request merge when we have completed
> a bio-to-request merge, we free the request from deep down in that
> path. For blk-mq-sched, the merge path has to hold the appropriate
> lock, but we don't need it for freeing the request. And in fact
> holding the lock is problematic, since we are now calling the
> mq sched put_rq_private() hook with the lock held. Other call paths
> do not hold this lock.
> 
> Fix this inconsistency by ensuring that the caller frees a merged
> request. Then we can do it outside of the lock, making it both more
> efficient and fixing the blk-mq-sched problem of invoking parts of
> the scheduler with an unknown lock state.
> 
> Reported-by: Paolo Valente <paolo.valente@xxxxxxxxxx>

Reviewed-by: Omar Sandoval <osandov@xxxxxx>

> Signed-off-by: Jens Axboe <axboe@xxxxxx>
> ---
>  block/blk-core.c     | 12 +++++++++---
>  block/blk-merge.c    | 15 ++++++++++++---
>  block/blk-mq-sched.c |  9 ++++++---
>  block/blk-mq-sched.h |  3 ++-
>  block/mq-deadline.c  |  8 ++++++--
>  5 files changed, 35 insertions(+), 12 deletions(-)



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux