diff mbox series

[for-next] brd: use cond_resched instead of cond_resched_rcu

Message ID 20230614133538.1279369-1-p.raghav@samsung.com (mailing list archive)
State New, archived
Headers show
Series [for-next] brd: use cond_resched instead of cond_resched_rcu | expand

Commit Message

Pankaj Raghav June 14, 2023, 1:35 p.m. UTC
The body of the loop is run without RCU lock held. Use the regular
cond_resched() instead of cond_resched_rcu().

Fixes: 786bb0245881 ("brd: use XArray instead of radix-tree to index backing pages")
Suggested-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
---
 drivers/block/brd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Hannes Reinecke June 14, 2023, 1:36 p.m. UTC | #1
On 6/14/23 15:35, Pankaj Raghav wrote:
> The body of the loop is run without RCU lock held. Use the regular
> cond_resched() instead of cond_resched_rcu().
> 
> Fixes: 786bb0245881 ("brd: use XArray instead of radix-tree to index backing pages")
> Suggested-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
> ---
>   drivers/block/brd.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/block/brd.c b/drivers/block/brd.c
> index 2f71376afc71..970bd6ff38c4 100644
> --- a/drivers/block/brd.c
> +++ b/drivers/block/brd.c
> @@ -111,7 +111,7 @@ static void brd_free_pages(struct brd_device *brd)
>   
>   	xa_for_each(&brd->brd_pages, idx, page) {
>   		__free_page(page);
> -		cond_resched_rcu();
> +		cond_resched();
>   	}
>   
>   	xa_destroy(&brd->brd_pages);

Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
Jens Axboe June 14, 2023, 5:15 p.m. UTC | #2
On Wed, 14 Jun 2023 15:35:38 +0200, Pankaj Raghav wrote:
> The body of the loop is run without RCU lock held. Use the regular
> cond_resched() instead of cond_resched_rcu().
> 
> 

Applied, thanks!

[1/1] brd: use cond_resched instead of cond_resched_rcu
      commit: 6dd4423f3f247b6f0ecb828cf62ea2bc4604f0b5

Best regards,
diff mbox series

Patch

diff --git a/drivers/block/brd.c b/drivers/block/brd.c
index 2f71376afc71..970bd6ff38c4 100644
--- a/drivers/block/brd.c
+++ b/drivers/block/brd.c
@@ -111,7 +111,7 @@  static void brd_free_pages(struct brd_device *brd)
 
 	xa_for_each(&brd->brd_pages, idx, page) {
 		__free_page(page);
-		cond_resched_rcu();
+		cond_resched();
 	}
 
 	xa_destroy(&brd->brd_pages);