Re: [PATCH v3] dm-bufio: don't schedule in atomic context

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

 



On Wed, Apr 16, 2025 at 8:07 PM LongPing Wei <weilongping@xxxxxxxx> wrote:
> diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c
> index 9c8ed65cd87e..3088f9f9169a 100644
> --- a/drivers/md/dm-bufio.c
> +++ b/drivers/md/dm-bufio.c
> @@ -2424,8 +2426,13 @@ static void __scan(struct dm_bufio_client *c)
>
>                         atomic_long_dec(&c->need_shrink);
>                         freed++;
> -                       cond_resched();
> -               }
> +
> +                       if (unlikely(freed % SCAN_RESCHED_CYCLE == 0)) {
> +                               dm_bufio_unlock(c);
> +                               cond_resched();
> +                               dm_bufio_lock(c);
> +                       }
> +       }
>         }
>  }

I realize this has been queued by the maintainer, but in
cherry-picking it for the Android kernel, I noticed there's a
whitespace oddity with the closing bracket indentation. Might deserve
a followup fix.

thanks
-john





[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux