[00/12] A minor flurry of selftest/mm fixes

Message ID 20230602013358.900637-1-jhubbard@nvidia.com
Headers
Series A minor flurry of selftest/mm fixes |

Message

John Hubbard June 2, 2023, 1:33 a.m. UTC
  It turned out that an even dozen patches were required in order to get the
selftests building cleanly, and all running, once again. I made it worse on
myself by insisting on using clang, which seems to uncover a few more warnings
than gcc these days.

So I still haven't gotten to my original goal of running a new HMM test that
Alistair handed me (it's not here yet), but at least this fixes everything I ran
into just now.

John Hubbard (12):
  selftests/mm: fix uffd-stress unused function warning
  selftests/mm: fix unused variable warning in hugetlb-madvise.c
  selftests/mm: fix unused variable warning in migration.c
  selftests/mm: fix a char* assignment in mlock2-tests.c
  selftests/mm: fix invocation of tests that are run via shell scripts
  selftests/mm: .gitignore: add mkdirty, va_high_addr_switch
  selftests/mm: set -Wno-format-security to avoid uffd build warnings
  selftests/mm: fix a "possibly uninitialized" warning in pkey-x86.h
  selftests/mm: move psize(), pshift() into vm_utils.c
  selftests/mm: move uffd* routines from vm_util.c to uffd-common.c
  selftests/mm: fix missing UFFDIO_CONTINUE_MODE_WP and similar build
    failures
  selftests/mm: fix uffd-unit-tests.c build failure due to missing
    MADV_COLLAPSE

 tools/testing/selftests/mm/.gitignore         |   2 +
 tools/testing/selftests/mm/Makefile           |   9 +-
 tools/testing/selftests/mm/cow.c              |   7 --
 tools/testing/selftests/mm/hugepage-mremap.c  |   2 +-
 tools/testing/selftests/mm/hugetlb-madvise.c  |   2 +-
 tools/testing/selftests/mm/khugepaged.c       |  10 --
 .../selftests/mm/ksm_functional_tests.c       |   2 +-
 tools/testing/selftests/mm/migration.c        |   2 +-
 tools/testing/selftests/mm/mlock2-tests.c     |   2 +-
 tools/testing/selftests/mm/pkey-x86.h         |   2 +-
 tools/testing/selftests/mm/run_vmtests.sh     |   6 +-
 tools/testing/selftests/mm/uffd-common.c      | 105 +++++++++++++++++
 tools/testing/selftests/mm/uffd-common.h      |  29 ++++-
 tools/testing/selftests/mm/uffd-stress.c      |  10 --
 tools/testing/selftests/mm/vm_util.c          | 106 ++----------------
 tools/testing/selftests/mm/vm_util.h          |  36 ++----
 16 files changed, 170 insertions(+), 162 deletions(-)


base-commit: 929ed21dfdb6ee94391db51c9eedb63314ef6847
  

Comments

David Hildenbrand June 2, 2023, 9:32 a.m. UTC | #1
On 02.06.23 03:33, John Hubbard wrote:
> It turned out that an even dozen patches were required in order to get the
> selftests building cleanly, and all running, once again. I made it worse on
> myself by insisting on using clang, which seems to uncover a few more warnings
> than gcc these days.
> 
> So I still haven't gotten to my original goal of running a new HMM test that
> Alistair handed me (it's not here yet), but at least this fixes everything I ran
> into just now.

Thanks, now I can stop commenting out some (IIRC primarily uffd-related) 
tests when just wanting to run some specific tests on some of odd 
installations :D

I assume this round you only consideres 64bit builds, right? My last 
attempts with 32bit revealed a lot of issues, and I only fixed what I 
really wanted to test (COW).
  
John Hubbard June 2, 2023, 5:51 p.m. UTC | #2
On 6/2/23 02:32, David Hildenbrand wrote:
> On 02.06.23 03:33, John Hubbard wrote:
>> It turned out that an even dozen patches were required in order to get the
>> selftests building cleanly, and all running, once again. I made it worse on
>> myself by insisting on using clang, which seems to uncover a few more warnings
>> than gcc these days.
>>
>> So I still haven't gotten to my original goal of running a new HMM test that
>> Alistair handed me (it's not here yet), but at least this fixes everything I ran
>> into just now.
> 
> Thanks, now I can stop commenting out some (IIRC primarily uffd-related) tests when just wanting to run some specific tests on some of odd installations :D

aha! :)

> 
> I assume this round you only consideres 64bit builds, right? My last attempts with 32bit revealed a lot of issues, and I only fixed what I really wanted to test (COW).
> 

Yes, that's correct. I only tested on 64-bit. I've drifted into a
"32 bit is mostly just for embedded systems" sort of mindset lately,
and don't have anything set up for testing those locally.


thanks,