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] [day] [month] [year] [list]
Date: Wed, 29 May 2024 11:21:12 -0700
From: Sidhartha Kumar <sidhartha.kumar@...cle.com>
To: Matthew Wilcox <willy@...radead.org>
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        akpm@...ux-foundation.org, vishal.moola@...cle.com,
        muchun.song@...ux.dev, david@...hat.com, osalvador@...e.de
Subject: Re: [PATCH] mm/hugetlb: mm/memory_hotplug: use a folio in
 scan_movable_pages()

On 5/28/24 3:47 PM, Matthew Wilcox wrote:
> On Tue, May 28, 2024 at 03:03:21PM -0700, Sidhartha Kumar wrote:
>> @@ -1761,9 +1762,9 @@ static int scan_movable_pages(unsigned long start, unsigned long end,
>>   		 * cases false positives and negatives are possible.  Calling
>>   		 * code must deal with these scenarios.
>>   		 */
>> -		if (HPageMigratable(head))
>> +		if (folio_test_hugetlb_migratable(folio))
>>   			goto found;
>> -		skip = compound_nr(head) - (pfn - page_to_pfn(head));
>> +		skip = folio_nr_pages(folio) - folio_page_idx(folio, page);
>>   		pfn += skip - 1;
> 
> Isn't this an unnecessarily complicated way of writing:
> 
> 		pfn |= folio_nr_pages(folio) - 1;
> ?

Because folio_nr_pages() is a power of 2, I agree this is simpler. I'll make 
this change in a v2.

Thanks,
Sid

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ