From: Muhammad Usama Anjum <usama.anjum@collabora.com>
To: Gabriel Krisman Bertazi <krisman@collabora.com>
Cc: usama.anjum@collabora.com,
Andrew Morton <akpm@linux-foundation.org>,
Shuah Khan <shuah@kernel.org>,
kernel@collabora.com, david@redhat.com,
Will Deacon <will@kernel.org>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
linux-kselftest@vger.kernel.org
Subject: Re: [PATCH V5 2/2] selftests: vm: Add test for Soft-Dirty PTE bit
Date: Wed, 20 Apr 2022 13:25:53 +0500 [thread overview]
Message-ID: <2d83eab4-3ba9-6947-690e-2b0fd7de0653@collabora.com> (raw)
In-Reply-To: <87ilsbyshs.fsf@collabora.com>
On 3/19/22 12:23 AM, Gabriel Krisman Bertazi wrote:
>> +static void test_vma_reuse(int pagemap_fd, int pagesize)
>> +{
>> + char *map, *map2;
>> +
>> + map = mmap(NULL, pagesize, (PROT_READ | PROT_WRITE), (MAP_PRIVATE | MAP_ANON), -1, 0);
>> + if (map == MAP_FAILED)
>> + ksft_exit_fail_msg("mmap failed");
>> +
>> + clear_softdirty();
>> +
>> + /* Write to the page before unmapping and map the same size region again to check
>> + * if same memory region is gotten next time and if dirty bit is preserved across
>> + * this type of allocations.
>> + */
> This reads weird. It should *not* be preserved across different
> mappings. Also, we are not testing if the same region is reused, we are
> depending on it to test the sd bit.
>
> /* Ensures the soft-dirty bit is reset accross different mappings on the
> same address. */
Soft dirty bit is always set for new regions (reused or not). I'll
correct the comment and improve this sub test.
--
Muhammad Usama Anjum
next prev parent reply other threads:[~2022-04-20 8:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-17 10:33 [PATCH V5 1/2] selftests: vm: bring common functions to a new file Muhammad Usama Anjum
2022-03-17 10:33 ` [PATCH V5 2/2] selftests: vm: Add test for Soft-Dirty PTE bit Muhammad Usama Anjum
2022-03-18 19:23 ` Gabriel Krisman Bertazi
2022-04-20 8:25 ` Muhammad Usama Anjum [this message]
2022-03-21 16:09 ` [PATCH V5 1/2] selftests: vm: bring common functions to a new file David Hildenbrand
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=2d83eab4-3ba9-6947-690e-2b0fd7de0653@collabora.com \
--to=usama.anjum@collabora.com \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=kernel@collabora.com \
--cc=krisman@collabora.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=shuah@kernel.org \
--cc=will@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox