Re: [PATCH V5 2/2] selftests: vm: Add test for Soft-Dirty PTE bit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux