lkml.org 
[lkml]   [2020]   [Mar]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] btrfs: implement migratepage callback
On Wed, Mar 04, 2020 at 02:53:21PM -0500, Chris Mason wrote:
>
>
> On 4 Mar 2020, at 14:50, Roman Gushchin wrote:
>
> > Currently btrfs doesn't provide a migratepage callback. It means that
> > fallback_migrate_page() is used to migrate btrfs pages.
> >
> > fallback_migrate_page() cannot move dirty pages, instead it tries to
> > flush them (in sync mode) or just fails (in async mode).
> >
> > In the sync mode pages which are scheduled to be processed by
> > btrfs_writepage_fixup_worker() can't be effectively flushed by the
> > migration code, because there is no established way to wait for the
> > completion of the delayed work.
> >
> > It all leads to page migration failures.
> >
> > To fix it the patch implements a btrs-specific migratepage callback,
> > which is similar to iomap_migrate_page() used by some other fs, except
> > it does take care of the PagePrivate2 flag which is used for data
> > ordering purposes.
>
> Since the default migratepage didn’t copy PagePrivate2, didn’t you find it
> was also causing pages to get funneled into the fixup worker flow?

A good question.

I've definitely seen a lot of fixup worker activity.

On the other hand the default (fallback) migration path is flushing
the page first (if dirty), so it should not move dirty pages.
If PagePrivate2 can outlive PageDirty, then the answer is yes.

Thanks!

\
 
 \ /
  Last update: 2020-03-04 21:36    [W:0.074 / U:7.940 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site