linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
To: "Garg, Shivank" <shivankg@amd.com>
Cc: Zi Yan <ziy@nvidia.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	David Hildenbrand <david@redhat.com>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	"Liam R . Howlett" <Liam.Howlett@oracle.com>,
	Nico Pache <npache@redhat.com>,
	Ryan Roberts <ryan.roberts@arm.com>, Dev Jain <dev.jain@arm.com>,
	Barry Song <baohua@kernel.org>, Lance Yang <lance.yang@linux.dev>,
	Steven Rostedt <rostedt@goodmis.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Zach O'Keefe <zokeefe@google.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	linux-trace-kernel@vger.kernel.org,
	Branden Moore <Branden.Moore@amd.com>
Subject: Re: [PATCH 1/2] mm/khugepaged: do synchronous writeback for MADV_COLLAPSE
Date: Mon, 10 Nov 2025 19:53:38 +0000	[thread overview]
Message-ID: <ec53bd13-42ce-46d5-a1b8-c4157663b60d@lucifer.local> (raw)
In-Reply-To: <27920b64-240d-40f6-a02a-0a8c433ca9e1@lucifer.local>

On Mon, Nov 10, 2025 at 07:48:33PM +0000, Lorenzo Stoakes wrote:
> On Tue, Nov 11, 2025 at 01:10:03AM +0530, Garg, Shivank wrote:
> > I bisected the crash on mm-unstable
> >
> > b14d61d8fe442b1cc2d7591cf040a6dcd7fe2dd8 is the first bad commit
> > commit b14d61d8fe442b1cc2d7591cf040a6dcd7fe2dd8
> > Author: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
> > Date:   Sat Nov 8 17:08:18 2025 +0000
> >
> >     mm: eliminate is_swap_pte() when softleaf_from_pte() suffices
> >
> >     In cases where we can simply utilise the fact that softleaf_from_pte()
> >     treats present entries as if they were none entries and thus eliminate
> >     spurious uses of is_swap_pte(), do so.
> >
> >     No functional change intended.
>
> Ah fun :)
>
> Thanks, this is very likely a bug that I am about to fix in the series that
> was reported on review.
>
> Could you try the attached fix-patch please?
>
> Note that this might not apply against mm-unstable, in which case replace
> 'softleaf' with 'leafent' :) as there was a rename in v2.
>
> Cheers, Lorenzo
>
> ----8<----
> From ab4d93d299f0a0ca3f1fa5e75b2ac646695b632e Mon Sep 17 00:00:00 2001
> From: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
> Date: Mon, 10 Nov 2025 19:46:55 +0000
> Subject: [PATCH] fixup
>
> Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
> ---
>  include/linux/leafops.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/leafops.h b/include/linux/leafops.h
> index a464a7e08c76..325cc87c3363 100644
> --- a/include/linux/leafops.h
> +++ b/include/linux/leafops.h
> @@ -56,7 +56,7 @@ static inline softleaf_t softleaf_from_pte(pte_t pte)
>  {
>  	softleaf_t arch_entry;
>
> -	if (pte_present(pte))
> +	if (pte_present(pte) || pte_none())

Sorry that should be pte_none(pte)... obviously!

It's late here :)

>  		return softleaf_mk_none();
>
>  	pte = pte_swp_clear_flags(pte);
> @@ -95,7 +95,7 @@ static inline softleaf_t softleaf_from_pmd(pmd_t pmd)
>  {
>  	softleaf_t arch_entry;
>
> -	if (pmd_present(pmd))
> +	if (pmd_present(pmd) || pmd_none(pmd))
>  		return softleaf_mk_none();
>
>  	if (pmd_swp_soft_dirty(pmd))
> --
> 2.51.0
>
> Thanks, Lorenzo

  reply	other threads:[~2025-11-10 19:54 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-10 11:32 [PATCH 1/2] mm/khugepaged: do synchronous writeback for MADV_COLLAPSE Shivank Garg
2025-11-10 11:32 ` [PATCH 2/2] mm/khugepaged: return EAGAIN for transient dirty pages in MADV_COLLAPSE Shivank Garg
2025-11-10 11:56   ` Lorenzo Stoakes
2025-11-19 10:25     ` Garg, Shivank
2025-11-19 18:16       ` Lorenzo Stoakes
2025-11-20  7:03         ` Garg, Shivank
2025-11-10 13:46   ` Dev Jain
2025-11-19  7:00     ` Garg, Shivank
2025-11-10 12:01 ` [PATCH 1/2] mm/khugepaged: do synchronous writeback for MADV_COLLAPSE Lorenzo Stoakes
2025-11-10 13:07   ` Garg, Shivank
2025-11-10 13:22     ` Lorenzo Stoakes
2025-11-10 16:06       ` Lorenzo Stoakes
2025-11-10 16:55         ` Zi Yan
2025-11-10 19:40           ` Garg, Shivank
2025-11-10 19:48             ` Lorenzo Stoakes
2025-11-10 19:53               ` Lorenzo Stoakes [this message]
2025-11-10 21:16                 ` Lorenzo Stoakes
2025-11-10 21:56                   ` Zi Yan
2025-11-10 22:03                     ` Lorenzo Stoakes
2025-11-11  5:26                   ` Garg, Shivank
2025-11-10 13:24   ` Dev Jain
2025-11-10 13:36     ` Lorenzo Stoakes
2025-11-11  3:41       ` Dev Jain
2025-11-10 13:47 ` Matthew Wilcox
2025-11-10 13:52   ` Lorenzo Stoakes
2025-11-10 14:17     ` Matthew Wilcox
2025-11-10 14:20     ` Garg, Shivank
2025-11-10 14:23       ` Lorenzo Stoakes
2025-11-10 14:28       ` Matthew Wilcox
2025-11-11  5:58         ` Garg, Shivank
2025-11-13 15:30           ` David Hildenbrand (Red Hat)
2025-11-10 14:00   ` David Hildenbrand (Red Hat)
2025-11-10 14:03     ` Matthew Wilcox
2025-11-10 14:05       ` Lorenzo Stoakes
2025-11-10 14:54         ` David Hildenbrand (Red Hat)
2025-11-13 14:21 ` kernel test robot

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=ec53bd13-42ce-46d5-a1b8-c4157663b60d@lucifer.local \
    --to=lorenzo.stoakes@oracle.com \
    --cc=Branden.Moore@amd.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=baohua@kernel.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=david@redhat.com \
    --cc=dev.jain@arm.com \
    --cc=lance.yang@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=npache@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=ryan.roberts@arm.com \
    --cc=shivankg@amd.com \
    --cc=ziy@nvidia.com \
    --cc=zokeefe@google.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;
as well as URLs for NNTP newsgroup(s).