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: <a3a6afe9-5188-42a8-937e-54aa495b380a@nvidia.com>
Date: Tue, 8 Jul 2025 17:40:32 +1000
From: Balbir Singh <balbirs@...dia.com>
To: Alistair Popple <apopple@...dia.com>
Cc: Mika Penttilä <mpenttil@...hat.com>, linux-mm@...ck.org,
 akpm@...ux-foundation.org, linux-kernel@...r.kernel.org,
 Karol Herbst <kherbst@...hat.com>, Lyude Paul <lyude@...hat.com>,
 Danilo Krummrich <dakr@...nel.org>, David Airlie <airlied@...il.com>,
 Simona Vetter <simona@...ll.ch>, Jérôme Glisse
 <jglisse@...hat.com>, Shuah Khan <shuah@...nel.org>,
 David Hildenbrand <david@...hat.com>, Barry Song <baohua@...nel.org>,
 Baolin Wang <baolin.wang@...ux.alibaba.com>,
 Ryan Roberts <ryan.roberts@....com>, Matthew Wilcox <willy@...radead.org>,
 Peter Xu <peterx@...hat.com>, Zi Yan <ziy@...dia.com>,
 Kefeng Wang <wangkefeng.wang@...wei.com>, Jane Chu <jane.chu@...cle.com>,
 Donet Tom <donettom@...ux.ibm.com>
Subject: Re: [v1 resend 03/12] mm/thp: zone_device awareness in THP handling
 code

On 7/7/25 16:09, Alistair Popple wrote:
> On Sat, Jul 05, 2025 at 10:14:18AM +1000, Balbir Singh wrote:
>> On 7/4/25 21:10, Mika Penttilä wrote:
>>>>  /* Racy check whether the huge page can be split */
>>>> @@ -3543,6 +3594,10 @@ static int __split_unmapped_folio(struct folio *folio, int new_order,
>>>>  					((mapping || swap_cache) ?
>>>>  						folio_nr_pages(release) : 0));
>>>>  
>>>> +			if (folio_is_device_private(release))
>>>> +				percpu_ref_get_many(&release->pgmap->ref,
>>>> +							(1 << new_order) - 1);
>>>
>>> pgmap refcount should not be modified here, count should remain the same after the split also
> 
> Agreed.
> 
>>>
>>>
>>
>> Good point, let me revisit the accounting
> 
> Yes, hopefully we can just delete it.
> 
>> For this patch series, the tests did not catch it since new ref's evaluate to 0
> 
> You may not notice bad accounting here unless you unload the kernel module,
> which can hang during memunmap() pages waiting for the refcount to go to zero.
> 

The tests do have an eviction test, which tests that all pages can indeed be evicted
and I do unload/reload the driver

Balbir Singh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ