Re: [PATCH v2 6/8] selftests/mm: fix faulting-in code in pagemap_ioctl test

From: David Hildenbrand (Red Hat)

Date: Mon Jan 19 2026 - 06:09:12 EST


On 1/7/26 17:48, Kevin Brodsky wrote:
One of the pagemap_ioctl tests attempts to fault in pages by
memcpy()'ing them to an unused buffer. This probably worked
originally, but since commit 46036188ea1f ("selftests/mm: build with
-O2") the compiler is free to optimise away that unused buffer and
the memcpy() with it. As a result there might not be any resident
page in the mapping and the test may fail.

Yes, I assume so. Using FORCE_READ() etc is the way to go.


Should we add

Fixes: 46036188ea1f ("selftests/mm: build with -O2")

?

Acked-by: David Hildenbrand (Red Hat) <david@xxxxxxxxxx>

--
Cheers

David