[PATCH 0/3] Minor hmm_test fixes and cleanups

Alistair Popple posted 3 patches 1 day, 4 hours ago
lib/test_hmm.c                         | 130 +++++++++++++++----------
tools/testing/selftests/mm/hmm-tests.c |  83 +++-------------
2 files changed, 93 insertions(+), 120 deletions(-)
[PATCH 0/3] Minor hmm_test fixes and cleanups
Posted by Alistair Popple 1 day, 4 hours ago
Just a couple of minor fixups and cleanups for the HMM kernel selftests. These
were mostly reported by Zenghui Yu with special thanks to Lorenzo for analysing
and pointing out the problems.

Alistair Popple (3):
  lib: test_hmm: evict device pages on file close to avoid
    use-after-free
  selftests/mm: hmm-tests: don't hardcode THP size to 2MB
  lib: test_hmm: Implement a device release method

 lib/test_hmm.c                         | 130 +++++++++++++++----------
 tools/testing/selftests/mm/hmm-tests.c |  83 +++-------------
 2 files changed, 93 insertions(+), 120 deletions(-)

-- 
2.53.0
Re: [PATCH 0/3] Minor hmm_test fixes and cleanups
Posted by Andrew Morton 10 hours ago
On Tue, 31 Mar 2026 17:34:42 +1100 Alistair Popple <apopple@nvidia.com> wrote:

> Just a couple of minor fixups and cleanups for the HMM kernel selftests. These
> were mostly reported by Zenghui Yu with special thanks to Lorenzo for analysing
> and pointing out the problems.

Geeze, if a kernel oops and a ugly WARN are "minor" then I'd hate to
see your "major".

I strengthened the [0/N] cover to read "Two bugfixes a cleanup for the
HMM kernel selftests....".

I also slapped cc:stable on [1/3] and [3/3] and queued everything for
the upcoming merge window, OK?

Here I assume that some users of earlier kernels will use that kernel's
in-kernel selftests.  I don't know how accurate that is, but if they are not
using them, they don't care!

[3/3] lacks a Fixes:, but I'm sure the -stable team will figure it out.

Thanks ;)
Re: [PATCH 0/3] Minor hmm_test fixes and cleanups
Posted by Alistair Popple 9 hours ago
On 2026-04-01 at 11:33 +1100, Andrew Morton <akpm@linux-foundation.org> wrote...
> On Tue, 31 Mar 2026 17:34:42 +1100 Alistair Popple <apopple@nvidia.com> wrote:
> 
> > Just a couple of minor fixups and cleanups for the HMM kernel selftests. These
> > were mostly reported by Zenghui Yu with special thanks to Lorenzo for analysing
> > and pointing out the problems.
> 
> Geeze, if a kernel oops and a ugly WARN are "minor" then I'd hate to
> see your "major".

Heh. Yeah fair. It wouldn't literally set fire to anything but maybe that bar is
too high :)

> I strengthened the [0/N] cover to read "Two bugfixes a cleanup for the
> HMM kernel selftests....".

Thanks.
 
> I also slapped cc:stable on [1/3] and [3/3] and queued everything for
> the upcoming merge window, OK?

Sounds good to me.

> Here I assume that some users of earlier kernels will use that kernel's
> in-kernel selftests.  I don't know how accurate that is, but if they are not
> using them, they don't care!
> 
> [3/3] lacks a Fixes:, but I'm sure the -stable team will figure it out.

Sorry, I shouldn't have been so lazy there. This looks like the correct tag:

Fixes: 6a760f58c792 ("mm/hmm/test: use char dev with struct device to get device node")

Added Mika to 'cc as that's his commit.

> Thanks ;)