Patch "block: Drop spurious might_sleep() from blk_put_queue()" has been added to the 6.1-stable tree

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

 



This is a note to let you know that I've just added the patch titled

    block: Drop spurious might_sleep() from blk_put_queue()

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     block-drop-spurious-might_sleep-from-blk_put_queue.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 9ac03e3fd8e1bdbf1bca0fa281849d2257ee8329
Author: Tejun Heo <tj@xxxxxxxxxx>
Date:   Fri Jan 6 10:34:10 2023 -1000

    block: Drop spurious might_sleep() from blk_put_queue()
    
    [ Upstream commit 49e4d04f0486117ac57a97890eb1db6d52bf82b3 ]
    
    Dan reports the following smatch detected the following:
    
      block/blk-cgroup.c:1863 blkcg_schedule_throttle() warn: sleeping in atomic context
    
    caused by blkcg_schedule_throttle() calling blk_put_queue() in an
    non-sleepable context.
    
    blk_put_queue() acquired might_sleep() in 63f93fd6fa57 ("block: mark
    blk_put_queue as potentially blocking") which transferred the might_sleep()
    from blk_free_queue().
    
    blk_free_queue() acquired might_sleep() in e8c7d14ac6c3 ("block: revert back
    to synchronous request_queue removal") while turning request_queue removal
    synchronous. However, this isn't necessary as nothing in the free path
    actually requires sleeping.
    
    It's pretty unusual to require a sleeping context in a put operation and
    it's not needed in the first place. Let's drop it.
    
    Signed-off-by: Tejun Heo <tj@xxxxxxxxxx>
    Reported-by: Dan Carpenter <error27@xxxxxxxxx>
    Link: https://lkml.kernel.org/r/Y7g3L6fntnTtOm63@kili
    Cc: Christoph Hellwig <hch@xxxxxx>
    Cc: Luis Chamberlain <mcgrof@xxxxxxxxxx>
    Fixes: e8c7d14ac6c3 ("block: revert back to synchronous request_queue removal") # v5.9+
    Reviewed-by: Christoph Hellwig <hch@xxxxxx>
    Link: https://lore.kernel.org/r/Y7iFwjN+XzWvLv3y@xxxxxxxxxxxxxxx
    Signed-off-by: Jens Axboe <axboe@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/block/blk-core.c b/block/blk-core.c
index 815ffce6b988..f5ae527fb0c3 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -282,12 +282,9 @@ static void blk_free_queue(struct request_queue *q)
  *
  * Decrements the refcount of the request_queue and free it when the refcount
  * reaches 0.
- *
- * Context: Can sleep.
  */
 void blk_put_queue(struct request_queue *q)
 {
-	might_sleep();
 	if (refcount_dec_and_test(&q->refs))
 		blk_free_queue(q);
 }



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux