linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Breno Leitao <leitao@debian.org>
Cc: riel@surriel.com, linux-mm@kvack.org,
	Shuah Khan <shuah@kernel.org>,
	vegard.nossum@oracle.com, rppt@kernel.org,
	songmuchun@bytedance.com, shy828301@gmail.com,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/1] selftests/mm: new test that steals pages
Date: Tue, 9 Jan 2024 21:47:31 -0800	[thread overview]
Message-ID: <20240109214731.a7694ae4a575be838b40e9ea@linux-foundation.org> (raw)
In-Reply-To: <20240105155419.1939484-2-leitao@debian.org>

On Fri,  5 Jan 2024 07:54:19 -0800 Breno Leitao <leitao@debian.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 ;)


  reply	other threads:[~2024-01-10  5:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-05 15:54 [PATCH 0/1] selftest/mm/hugetlb: SIGBUS on stolen page Breno Leitao
2024-01-05 15:54 ` [PATCH 1/1] selftests/mm: new test that steals pages Breno Leitao
2024-01-10  5:47   ` Andrew Morton [this message]
2024-01-10  9:18     ` Breno Leitao
2024-01-05 16:42 ` [PATCH 0/1] selftest/mm/hugetlb: SIGBUS on stolen page Andrew Morton
2024-01-05 17:40   ` Breno Leitao
2024-01-05 19:00   ` Rik van Riel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240109214731.a7694ae4a575be838b40e9ea@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=leitao@debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=riel@surriel.com \
    --cc=rppt@kernel.org \
    --cc=shuah@kernel.org \
    --cc=shy828301@gmail.com \
    --cc=songmuchun@bytedance.com \
    --cc=vegard.nossum@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox