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: <20cc2088-b66e-28d1-a529-414e82146336@nvidia.com>
Date:   Thu, 8 Dec 2022 14:14:43 -0800
From:   John Hubbard <jhubbard@...dia.com>
To:     Sidhartha Kumar <sidhartha.kumar@...cle.com>,
        Mike Kravetz <mike.kravetz@...cle.com>,
        Matthew Wilcox <willy@...radead.org>
CC:     <linux-kernel@...r.kernel.org>, <linux-mm@...ck.org>,
        <akpm@...ux-foundation.org>, <songmuchun@...edance.com>,
        <tsahu@...ux.ibm.com>, <david@...hat.com>
Subject: Re: [PATCH mm-unstable] mm: clarify folio_set_compound_order() zero
 support

On 12/8/22 14:12, Sidhartha Kumar wrote:
> On 12/8/22 2:01 PM, John Hubbard wrote:
>> On 12/8/22 13:58, Sidhartha Kumar wrote:
>>> Thanks John, Mike, Matthew, and Muchun for the feedback.
>>>
>>> To summarize this discussion and outline the next version of this patch, the changes I'll make include:
>>>
>>> 1) change the name of folio_set_compound_order() to folio_set_order()
>>> 2) change the placement of this function from mm.h to mm/internal.h
>>> 3) folio_set_order() will set both _folio_order and _folio_nr_pages and handle the zero order case correctly.
>>> 4) remove the comment about hugetlb's specific use for zero orders
>>> 5) improve the style of folio_set_order() by removing ifdefs from inside the function to doing
>>>
>>> #ifdef CONFIG_64BIT
>>>   static inline void folio_set_order(struct folio *folio,
>>>                   unsigned int order)
>>>   {
>>>       VM_BUG_ON_FOLIO(!folio_test_large(folio), folio);
>>
>> Sounds good, except for this part: why is a function named
>> folio_set_order() BUG-ing on a non-large folio? The naming
>> is still wrong, perhaps?
>>
> 
> This is because the _folio_nr_pages and _folio_order fields are part of the first tail page in the folio. folio_test_large returns if the folio is larger than one page which would be required for setting the fields.

OK, but then as I said, the name is wrong. One can either:

a) handle the non-large case, or

b) rename the function to indicate that it only works on large folios.


thanks,
-- 
John Hubbard
NVIDIA

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ