lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BBC5BC50-C32A-4609-A235-AFB0ADA30B52@nvidia.com>
Date: Fri, 28 Feb 2025 12:05:49 -0500
From: Zi Yan <ziy@...dia.com>
To: Matthew Wilcox <willy@...radead.org>
Cc: Liu Shixin <liushixin2@...wei.com>,
 Baolin Wang <baolin.wang@...ux.alibaba.com>, linux-mm@...ck.org,
 Andrew Morton <akpm@...ux-foundation.org>, Barry Song <baohua@...nel.org>,
 David Hildenbrand <david@...hat.com>,
 Kefeng Wang <wangkefeng.wang@...wei.com>, Lance Yang <ioworker0@...il.com>,
 Ryan Roberts <ryan.roberts@....com>, Hugh Dickins <hughd@...gle.com>,
 Charan Teja Kalla <quic_charante@...cinc.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/migrate: fix shmem xarray update during migration

On 28 Feb 2025, at 11:35, Matthew Wilcox wrote:

> On Fri, Feb 28, 2025 at 10:42:19AM -0500, Zi Yan wrote:
>> @@ -524,7 +525,11 @@ static int __folio_migrate_mapping(struct address_space *mapping,
>>  			folio_set_swapcache(newfolio);
>>  			newfolio->private = folio_get_private(folio);
>>  		}
>> -		entries = nr;
>> +		/* shmem uses high-order entry */
>> +		if (shmem_mapping(mapping))
>
> It's be cheaper to check folio_test_anon() here, right?

Yes and it gets rid of the new include. Let me send v2.

>
> Also, how did this bug remain unnoticed for almost 4 years?
> Our testing is terrible ;-(

Probably not 4 years. Before fc346d0a70a1 (2023), shmem was right,
swap cache was wrong. After fc346d0a70a1, shmem is wrong, swap cache
is right. And before Baolin’s patch, shmem only has PMD size folio
to use multi-index entries. Maybe getting PMD size folio is
really impossible when compaction runs a lot?

>
>> +			entries = 1;
>> +		else
>> +			entries = nr;
>>  	} else {
>>  		VM_BUG_ON_FOLIO(folio_test_swapcache(folio), folio);
>>  		entries = 1;
>> -- 
>> 2.47.2
>>


Best Regards,
Yan, Zi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ