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: <a679502e-0945-c834-9c0a-66cb7b194069@nvidia.com>
Date:   Thu, 8 Dec 2022 11:56:01 -0800
From:   John Hubbard <jhubbard@...dia.com>
To:     Matthew Wilcox <willy@...radead.org>,
        Sidhartha Kumar <sidhartha.kumar@...cle.com>
CC:     <linux-kernel@...r.kernel.org>, <linux-mm@...ck.org>,
        <akpm@...ux-foundation.org>, <songmuchun@...edance.com>,
        <mike.kravetz@...cle.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 11:33, Matthew Wilcox wrote:
> None of the above!
> 
> Whatever we're calling this function *it does not belong* in mm.h.
> Anything outside the MM calling it is going to be a disaster -- can you
> imagine what will happen if a filesystem or device driver is handed a
> folio and decides "Oh, I'll just change the size of this folio"?  It is
> an attractive nuisance and should be confined to mm/internal.h *at best*.
> 
> Equally, we *must not have* separate folio_set_order() and
> folio_set_nr_pages().  These are the same thing!  They must be kept
> in sync!  If we are to have a folio_set_order() instead of open-coding
> it, then it should also update nr_pages.
> 
> So, given that this is now an internal-to-mm, if not internal-to-hugetlb
> function, I see no reason that it should not handle the case of 0.
> I haven't studied what hugetlb_dissolve does, or why it can't use the
> standard split_folio(), but I'm sure there's a good reason.

Sure, perhaps I overreacted to the "abuse of this function" comment, and
the whole thing could be fixed up with a clean name, hiding it from
the public mm.h API, and...removing comments about abuse! haha :)


thanks,
-- 
John Hubbard
NVIDIA

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ