All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Rapoport <rppt@kernel.org>
To: "David Hildenbrand (Red Hat)" <david@kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	mm-commits@vger.kernel.org, jgg@nvidia.com,
	baolu.lu@linux.intel.com, yuan1.liu@intel.com,
	Dave Hansen <dave.hansen@linux.intel.com>
Subject: Re: + mm-fix-huge-page-table-not-free-after-memory-unplug.patch added to mm-hotfixes-unstable branch
Date: Tue, 23 Dec 2025 22:05:27 +0200	[thread overview]
Message-ID: <aUr2B5RXmnWQab0a@kernel.org> (raw)
In-Reply-To: <8f111584-51ab-4df2-a7f4-966ec400139d@kernel.org>

On Tue, Dec 23, 2025 at 09:27:52AM +0100, David Hildenbrand (Red Hat) wrote:
> On 12/23/25 02:15, Andrew Morton wrote:
>
> > From: Yuan Liu <yuan1.liu@intel.com>
> > Subject: mm: fix huge page table not free after memory unplug
> > Date: Sun, 21 Dec 2025 23:11:17 -0500
> > 
> > Newly plugged memory is marked as prot_sethuge via phys_pmd_init without
> > setting PG_head.  During memory unplug, free_hugepage_table frees the page
> > table as 2M, but pagetable_free handles it as 4K.
> > 
> > Link: https://lkml.kernel.org/r/20251222041117.44865-1-yuan1.liu@intel.com
> > Fixes: bf9e4e30f353 ("x86/mm: use pagetable_free()")
> > Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
> > Cc: Jason Gunthorpe <jgg@nvidia.com>
> > Cc: Baolu Lu <baolu.lu@linux.intel.com>
> > Cc: David Hildenbrand <david@redhat.com>
> > Cc: Mike Rapoport <rppt@kernel.org>
> > Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> > ---
> > 
> >   arch/x86/mm/init_64.c |    2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > --- a/arch/x86/mm/init_64.c~mm-fix-huge-page-table-not-free-after-memory-unplug
> > +++ a/arch/x86/mm/init_64.c
> > @@ -1028,7 +1028,7 @@ static void __meminit free_pagetable(str
> >   		free_reserved_pages(page, nr_pages);
> >   #endif
> >   	} else {
> > -		pagetable_free(page_ptdesc(page));
> > +		__free_pages(page, order);
> 
> Hm, but this way we are skipping deconstructors, no?
> 
> In particular, clearing the kernel flag (ptdesc_clear_kernel()) and not
> handling ASYNC_KERNEL_PGTABLE_FREE correctly.

And it seems to be x86 material at any rate.

-- 
Sincerely yours,
Mike.

      reply	other threads:[~2025-12-23 20:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-23  1:15 + mm-fix-huge-page-table-not-free-after-memory-unplug.patch added to mm-hotfixes-unstable branch Andrew Morton
2025-12-23  8:27 ` David Hildenbrand (Red Hat)
2025-12-23 20:05   ` Mike Rapoport [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=aUr2B5RXmnWQab0a@kernel.org \
    --to=rppt@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=baolu.lu@linux.intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=david@kernel.org \
    --cc=jgg@nvidia.com \
    --cc=mm-commits@vger.kernel.org \
    --cc=yuan1.liu@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.