Re: [PATCH v14 062/138] mm/migrate: Add folio_migrate_copy()

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

 



22.07.2021 15:29, Matthew Wilcox пишет:
> On Thu, Jul 22, 2021 at 02:52:28PM +0300, Dmitry Osipenko wrote:
...
> The obvious solution is just to change folio_copy():
> 
>  {
> -       unsigned i, nr = folio_nr_pages(src);
> +       unsigned i = 0;
> +       unsigned nr = folio_nr_pages(src);
> 
> -       for (i = 0; i < nr; i++) {
> -               cond_resched();
> +       for (;;) {
>                 copy_highpage(folio_page(dst, i), folio_page(src, i));
> +               if (i++ == nr)

This works with the ++i precedence change. Thanks!

> +                       break;
> +               cond_resched();
>         }
>  }
> 
> now it only calls cond_resched() for multi-page folios.

...

Thank you for the explanation and for the fix!

The fs/ and mm/ are mostly outside of my scope, hope you'll figure out
the buffer-head case soon.



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux