From: David Hildenbrand <david@redhat.com>
To: Luis Chamberlain <mcgrof@kernel.org>,
akpm@linux-foundation.org, ziy@nvidia.com, linux-mm@kvack.org
Cc: fstests@vger.kernel.org, linux-xfs@vger.kernel.org,
linux-kernel@vger.kernel.org, willy@infradead.org, hare@suse.de,
john.g.garry@oracle.com, p.raghav@samsung.com,
da.gomez@samsung.com
Subject: Re: [PATCH] mm/huge_memory: move writeback and truncation checks early
Date: Thu, 25 Apr 2024 11:40:48 +0200 [thread overview]
Message-ID: <37374089-895f-4c6f-a2f5-33859eb02b13@redhat.com> (raw)
In-Reply-To: <20240424225736.1501030-1-mcgrof@kernel.org>
On 25.04.24 00:57, Luis Chamberlain wrote:
> We should check as early as possible if we should bail due to writeback
> or truncation. This will allow us to add further sanity checks earlier
> as well.
>
> This introduces no functional changes.
>
> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
> ---
> mm/huge_memory.c | 23 +++++++++++------------
> 1 file changed, 11 insertions(+), 12 deletions(-)
>
> While working on min order support for LBS this came up as an improvement
> as we can check for the min order early earlier, so this sets the stage
> up for that.
>
> diff --git a/mm/huge_memory.c b/mm/huge_memory.c
> index 86a8c7b3b8dc..32c701821e0d 100644
> --- a/mm/huge_memory.c
> +++ b/mm/huge_memory.c
> @@ -3055,8 +3055,17 @@ int split_huge_page_to_list_to_order(struct page *page, struct list_head *list,
> if (new_order >= folio_order(folio))
> return -EINVAL;
>
> - /* Cannot split anonymous THP to order-1 */
> - if (new_order == 1 && folio_test_anon(folio)) {
> + if (folio_test_writeback(folio))
> + return -EBUSY;
> +
Why earlier than basic input parameter checks (new_order?
Sorry, but I don't see the reason for that change. It's all happening
extremely early, what are we concerned about?
It's likely better to send that patch with the actual patch "to add
further sanity checks earlier as well", and why they have to be that early.
--
Cheers,
David / dhildenb
next prev parent reply other threads:[~2024-04-25 9:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-24 22:57 Luis Chamberlain
2024-04-25 1:07 ` Zi Yan
2024-04-25 9:40 ` David Hildenbrand [this message]
2024-05-01 22:06 ` Luis Chamberlain
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=37374089-895f-4c6f-a2f5-33859eb02b13@redhat.com \
--to=david@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=da.gomez@samsung.com \
--cc=fstests@vger.kernel.org \
--cc=hare@suse.de \
--cc=john.g.garry@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-xfs@vger.kernel.org \
--cc=mcgrof@kernel.org \
--cc=p.raghav@samsung.com \
--cc=willy@infradead.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