linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Zi Yan <ziy@nvidia.com>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: linux-mm@kvack.org
Subject: Re: [bug report] mm: huge_memory: enable debugfs to split huge pages to any order
Date: Thu, 07 Mar 2024 09:41:17 -0500	[thread overview]
Message-ID: <5520C6FB-9ED1-439C-8F61-5BD99B4788E3@nvidia.com> (raw)
In-Reply-To: <f23c753c-5fb6-4aaf-bd99-39dafe058ed3@moroto.mountain>

[-- Attachment #1: Type: text/plain, Size: 1262 bytes --]

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.

--
Best Regards,
Yan, Zi

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 854 bytes --]

  reply	other threads:[~2024-03-07 14:41 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 [this message]
2024-03-07 14:44       ` Dan Carpenter

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=5520C6FB-9ED1-439C-8F61-5BD99B4788E3@nvidia.com \
    --to=ziy@nvidia.com \
    --cc=dan.carpenter@linaro.org \
    --cc=linux-mm@kvack.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