Re: [PATCH v2 08/11] selftests/mm: fix uffd-unit-tests.c build failure due to missing MADV_COLLAPSE

From: David Hildenbrand
Date: Tue Jun 20 2023 - 06:19:13 EST


On 20.06.23 12:17, Muhammad Usama Anjum wrote:
On 6/20/23 6:17 AM, John Hubbard wrote:
MADV_PAGEOUT, MADV_POPULATE_READ, MADV_COLLAPSE are conditionally
defined as necessary. However, that was being done in .c files, and a
new build failure came up that would have been automatically avoided had
these been in a common header file.

So consolidate and move them all to vm_util.h, which fixes the build
failure.

An alternative approach from Muhammad Usama Anjum was: rely on "make
headers" being required, and include asm-generic/mman-common.h. This
works in the sense that it builds, but it still generates warnings about
duplicate MADV_* symbols, and the goal here is to get a fully clean (no
warnings) build here.
I've not looked in detail. But it seems like your first revision was merged
and after that my cleanup has also been merged. My cleanup patch is adding
correct header files and removing these duplicate defines: It is in
mm-stable now.
https://lore.kernel.org/all/20230619232244.81CB3C433C0@xxxxxxxxxxxxxxx

See

https://lkml.kernel.org/r/0379db8e-744d-2876-7304-2a6db8c9cac0@xxxxxxxxxx

--
Cheers,

David / dhildenb