Re: [PATCH] generic/764: fsstress + migrate_pages() test

Jan Kara
2025-03-27T11:53:32Z

On Wed 26-03-25 11:50:55, Luis Chamberlain wrote:
> 0-day reported a page migration kernel warning with folios which happen
> to be buffer-heads [0]. I'm having a terribly hard time reproducing the bug
> and so I wrote this test to force page migration filesystems.
>
> It turns out we have have no tests for page migration on fstests or ltp,
> and its no surprise, other than compaction covered by generic/750 there
> is no easy way to trigger page migration right now unless you have a
> numa system.
>
> We should evaluate if we want to help stress test page migration
> artificially by later implementing a way to do page migration on simple
> systems to an artificial target.
>
> So far, this doesn't trigger any kernel splats, not even warnings for me.
>
> Reported-by: kernel test robot <oliver.sang@intel.com>
> Link: https://lore.kernel.org/r/202503101536.27099c77-lkp@intel.com # [0]
> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>

So when I was testing page migration in the past MM guys advised me to use
THP compaction as a way to trigger page migration. You can manually
trigger compaction by:

echo 1 >/proc/sys/vm/compact_memory

So you first mess with the page cache a bit to fragment memory and then
call the above to try to compact it back...

Honza
--
Jan Kara <jack@suse.com>
SUSE Labs, CR