[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240109214731.a7694ae4a575be838b40e9ea@linux-foundation.org>
Date: Tue, 9 Jan 2024 21:47:31 -0800
From: Andrew Morton <akpm@...ux-foundation.org>
To: Breno Leitao <leitao@...ian.org>
Cc: riel@...riel.com, linux-mm@...ck.org, Shuah Khan <shuah@...nel.org>,
vegard.nossum@...cle.com, rppt@...nel.org, songmuchun@...edance.com,
shy828301@...il.com, linux-kselftest@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] selftests/mm: new test that steals pages
On Fri, 5 Jan 2024 07:54:19 -0800 Breno Leitao <leitao@...ian.org> wrote:
> This test stresses the race between of madvise(DONTNEED), a page fault
> and a parallel huge page mmap, which should fail due to lack of
> available page available for mapping.
>
> This test case must run on a system with one and only one huge page
> available.
>
> # echo 1 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
Can't the test framework perform this configuration prior to running
the test?
> During setup, the test allocates the only available page, and starts
> three threads:
>
> - thread 1:
> * madvise(MADV_DONTNEED) on the allocated huge page
> - thread 2:
> * Write to the allocated huge page
> - thread 3:
> * Tries to allocated (steal) an extra huge page (which is not
> available)
>
> thread 3 should never succeed in the allocation, since the only huge
> page was never unmapped, and should be reserved.
>
> Touching the old page after thread3 allocation will raise a SIGBUS.
>
It's a bit strange to merge a selftest which is expected to fail
because of a known but unfixed kernel bug. But I'll toss the test
in there anyway, as we deserve to get bug reports ;)
Powered by blists - more mailing lists