From: Frank van der Linden <fvdl@google.com>
To: Mike Kravetz <mike.kravetz@oracle.com>
Cc: linux-mm@kvack.org, muchun.song@linux.dev, akpm@linux-foundation.org
Subject: Re: [PATCH] mm, hugetlb: remove HUGETLB_CGROUP_MIN_ORDER
Date: Thu, 5 Oct 2023 21:00:25 -0700 [thread overview]
Message-ID: <CAPTztWZuAuUeN6u6m13+V0KdQO6gyiWi6R3b6N3_nGMBEQws7w@mail.gmail.com> (raw)
In-Reply-To: <20231006003826.GA251100@monkey>
On Thu, Oct 5, 2023 at 5:53 PM Mike Kravetz <mike.kravetz@oracle.com> wrote:
>
> On 10/04/23 15:32, Frank van der Linden wrote:
> > Originally, hugetlb_cgroup was the only hugetlb user of tail page
> > structure fields. So, the code defined and checked against
> > HUGETLB_CGROUP_MIN_ORDER to make sure pages weren't too small
> > to use.
> >
> > However, by now, tail page #2 is used to store hugetlb
> > hwpoison and subpool information as well. In other words,
> > without that tail page hugetlb doesn't work.
>
> When I first read this, I thought we might be exposed today. But, I see
> that currently order must be > 0 so we are covered.
>
> > Acknowledge this fact by getting rid of HUGETLB_CGROUP_MIN_ORDER
> > and checks against it. Instead, just check for the minimum viable
> > page order at hstate creation time.
>
> IIUC, we do lose the ability to run with an order 1 hstate. Correct?
> The minimum must now be 2.
> I do not think is worth worrying about. And, the code checking for the
> VERY unlikely case where order could be big enough to to be valid, but
> too small for cgroups was strange.
Theoretically, order 1 hstate (without hugetlb cgroup) used to be
possible, since the subpool pointer was in the 1st tail page. But
dad6a5eb55 ("mm,hugetlb: use folio fields in second tail page") moved
everything to fields in the 2nd tail page, so that hasn't worked for a
bit. I guess it would have let you create it, but things would have
gone south pretty quickly..
>
>
> I think this is a nice simplification.
Thanks for the review,
- Frank
prev parent reply other threads:[~2023-10-06 4:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-04 15:32 Frank van der Linden
2023-10-06 0:38 ` Mike Kravetz
2023-10-06 4:00 ` Frank van der Linden [this message]
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=CAPTztWZuAuUeN6u6m13+V0KdQO6gyiWi6R3b6N3_nGMBEQws7w@mail.gmail.com \
--to=fvdl@google.com \
--cc=akpm@linux-foundation.org \
--cc=linux-mm@kvack.org \
--cc=mike.kravetz@oracle.com \
--cc=muchun.song@linux.dev \
/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