[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2d83eab4-3ba9-6947-690e-2b0fd7de0653@collabora.com>
Date: Wed, 20 Apr 2022 13:25:53 +0500
From: Muhammad Usama Anjum <usama.anjum@...labora.com>
To: Gabriel Krisman Bertazi <krisman@...labora.com>
Cc: usama.anjum@...labora.com,
Andrew Morton <akpm@...ux-foundation.org>,
Shuah Khan <shuah@...nel.org>, kernel@...labora.com,
david@...hat.com, Will Deacon <will@...nel.org>,
linux-kernel@...r.kernel.org, linux-mm@...ck.org,
linux-kselftest@...r.kernel.org
Subject: Re: [PATCH V5 2/2] selftests: vm: Add test for Soft-Dirty PTE bit
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
Powered by blists - more mailing lists