From: John Hubbard <jhubbard@nvidia.com>
To: Matthew Wilcox <willy@infradead.org>,
Sidhartha Kumar <sidhartha.kumar@oracle.com>
Cc: <linux-kernel@vger.kernel.org>, <linux-mm@kvack.org>,
<akpm@linux-foundation.org>, <songmuchun@bytedance.com>,
<mike.kravetz@oracle.com>, <tsahu@linux.ibm.com>,
<david@redhat.com>
Subject: Re: [PATCH mm-unstable] mm: clarify folio_set_compound_order() zero support
Date: Thu, 8 Dec 2022 11:56:01 -0800 [thread overview]
Message-ID: <a679502e-0945-c834-9c0a-66cb7b194069@nvidia.com> (raw)
In-Reply-To: <Y5I78soNmAFv7pi8@casper.infradead.org>
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
next prev parent reply other threads:[~2022-12-08 19:56 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-07 22:37 Sidhartha Kumar
2022-12-08 0:38 ` John Hubbard
2022-12-08 1:42 ` Sidhartha Kumar
2022-12-08 2:27 ` John Hubbard
2022-12-08 4:41 ` Muchun Song
2022-12-08 18:06 ` Sidhartha Kumar
2022-12-08 19:32 ` Mike Kravetz
2022-12-08 19:33 ` Matthew Wilcox
2022-12-08 19:56 ` John Hubbard [this message]
2022-12-08 20:01 ` Mike Kravetz
2022-12-08 21:58 ` Sidhartha Kumar
2022-12-08 22:01 ` John Hubbard
2022-12-08 22:12 ` Sidhartha Kumar
2022-12-08 22:14 ` John Hubbard
2022-12-08 22:33 ` Sidhartha Kumar
2022-12-08 22:39 ` John Hubbard
2022-12-09 14:27 ` Muchun Song
2022-12-09 21:10 ` John Hubbard
2022-12-09 21:20 ` John Hubbard
2022-12-14 3:00 ` Muchun Song
2022-12-08 22:04 ` Matthew Wilcox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a679502e-0945-c834-9c0a-66cb7b194069@nvidia.com \
--to=jhubbard@nvidia.com \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mike.kravetz@oracle.com \
--cc=sidhartha.kumar@oracle.com \
--cc=songmuchun@bytedance.com \
--cc=tsahu@linux.ibm.com \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox