From: Dev Jain <dev.jain@arm.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: shuah@kernel.org, linux-mm@kvack.org,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
Anshuman.Khandual@arm.com
Subject: Re: [PATCH] selftests/mm: Confirm VA exhaustion without reliance on correctness of mmap()
Date: Fri, 22 Mar 2024 10:42:47 +0530 [thread overview]
Message-ID: <d91c8c36-b01d-48f9-b0f6-8faa58edaed0@arm.com> (raw)
In-Reply-To: <20240321145146.a3ce8a1e247371e33a437978@linux-foundation.org>
On 3/22/24 03:21, Andrew Morton wrote:
> On Thu, 21 Mar 2024 16:05:22 +0530 Dev Jain <dev.jain@arm.com> wrote:
>
>> Currently, VA exhaustion is being checked by passing a hint to mmap() and
>> expecting it to fail. This patch makes a stricter test by successful write()
>> calls from /proc/self/maps to a dump file, confirming that a free chunk is
>> indeed not available.
> What's wrong with the current approach?
While populating the lower VA space, mmap() fails because we have
exhausted the space.
Then, in validate_lower_address_hint(), because mmap() fails, we confirm
that we have
indeed exhausted the space. There is a circular logic involved here.
Assume that there is a bug in mmap(), also assume that it exists
independent of whether
you pass a hint address or not; that for some reason it is not able to
find a 1GB chunk.
My idea is to assert the exhaustion against some other method.
Also, in the following line in validate_complete_va_space():
if (start_addr - prev_end_addr >= SZ_1GB)
I made a small error, I forgot to use MAP_CHUNK_SIZE instead of SZ_1GB.
next prev parent reply other threads:[~2024-03-22 5:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-21 10:35 [PATCH] selftests/mm: Confirm VA exhaustion without reliance on correctness of mmap() Dev Jain
2024-03-21 21:51 ` Andrew Morton
2024-03-22 5:12 ` Dev Jain [this message]
2024-03-22 19:19 ` Andrew Morton
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=d91c8c36-b01d-48f9-b0f6-8faa58edaed0@arm.com \
--to=dev.jain@arm.com \
--cc=Anshuman.Khandual@arm.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=shuah@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.