linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: Zi Yan <ziy@nvidia.com>
Cc: linux-mm@kvack.org
Subject: Re: [bug report] mm: huge_memory: enable debugfs to split huge pages to any order
Date: Thu, 7 Mar 2024 17:44:11 +0300	[thread overview]
Message-ID: <8984dce7-7538-47e6-b770-213e344451ab@moroto.mountain> (raw)
In-Reply-To: <5520C6FB-9ED1-439C-8F61-5BD99B4788E3@nvidia.com>

On Thu, Mar 07, 2024 at 09:41:17AM -0500, Zi Yan wrote:
> On 7 Mar 2024, at 9:31, Dan Carpenter wrote:
> 
> > On Thu, Mar 07, 2024 at 09:20:09AM -0500, Zi Yan wrote:
> >>
> >> Can you check if the patch below fixes the issue? I checked the inputs from
> >> debugfs and also inside split_huge_page_to_list_to_order().
> >>
> >> diff --git a/mm/huge_memory.c b/mm/huge_memory.c
> >> index a81a09236c16..4d21e57a7d07 100644
> >> --- a/mm/huge_memory.c
> >> +++ b/mm/huge_memory.c
> >> @@ -3052,6 +3052,9 @@ int split_huge_page_to_list_to_order(struct page *page, struct list_head *list,
> >>         VM_BUG_ON_FOLIO(!folio_test_locked(folio), folio);
> >>         VM_BUG_ON_FOLIO(!folio_test_large(folio), folio);
> >>
> >> +       if (new_order >= folio_order(folio))
> >> +               return -EINVAL;
> >> +
> >>         /* Cannot split anonymous THP to order-1 */
> >>         if (new_order == 1 && folio_test_anon(folio)) {
> >>                 VM_WARN_ONCE(1, "Cannot split to order-1 folio");
> >
> > From a static analysis perspective I think just this is sufficient?  But
> > I don't really know the code and don't object to the other parts of
> > this path either.
> 
> You are right. The other two changes are in debugfs to avoid unnecessary
> folio locking operations. They are more like an optimization.

Fantastic.  Thanks!

regards,
dan carpenter



      reply	other threads:[~2024-03-07 14:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-07 13:49 Dan Carpenter
2024-03-07 14:20 ` Zi Yan
2024-03-07 14:31   ` Dan Carpenter
2024-03-07 14:41     ` Zi Yan
2024-03-07 14:44       ` Dan Carpenter [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=8984dce7-7538-47e6-b770-213e344451ab@moroto.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=linux-mm@kvack.org \
    --cc=ziy@nvidia.com \
    /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