Re: [PATCH v2] selftests/mm: Simplify byte pattern checking in mremap_test
From: David Laight
Date: Wed Apr 15 2026 - 05:16:31 EST
On Wed, 15 Apr 2026 14:05:01 +0530
Dev Jain <dev.jain@xxxxxxx> wrote:
...
> >
> > c) Remove any randomization from the test. There is no need for random
> > patterns, just fill pages with increasing numbers.
>
> Agreed.
I'd start from (say) 0x123456789abcdef0 rather than zero to avoid lots
of zero bytes.
> > d) Just always verify the whole regions. Without the rand() magic this
> > will probably be just ... fairly fast?
>
> Yeah we are doing a simple memcmp() so it is fine.
You don't need a copy of the buffer, just compare against the pattern
that filled it.
David
>
> I'll implement these changes.
>
> >
>
>