From: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
To: Dave Hansen <dave.hansen@intel.com>, Pedro Falcato <pfalcato@suse.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>,
Andy Lutomirski <luto@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Thomas Gleixner <tglx@kernel.org>, Ingo Molnar <mingo@redhat.com>,
Borislav Petkov <bp@alien8.de>,
x86@kernel.org, "H . Peter Anvin" <hpa@zytor.com>,
Mike Rapoport <rppt@kernel.org>, Lorenzo Stoakes <ljs@kernel.org>,
Toshi Kani <toshi.kani@hpe.com>,
linux-mm@kvack.org, regressions@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86/mm: avoid a reclaiming allocation in pud_free_pmd_page()
Date: Thu, 24 Sep 2026 04:03:50 +0500 [thread overview]
Message-ID: <20260923230350.365304-1-mikhail.v.gavrilov@gmail.com> (raw)
In-Reply-To: <e11449f0-d9ad-4d1b-ab21-2be7d71fe335@intel.com>
On 9/23/26 15:53, Dave Hansen wrote:
> I think that means we can do something like the completely untested
> attached patch.
>
> Looks like Mikhail came to basically the same conclusion.
Yes - v2 does the same thing, and also drops the now-stale NOTE about
the page allocation. It went out about 20 minutes before your mail:
https://lore.kernel.org/all/20260923223116.20090-1-mikhail.v.gavrilov@gmail.com/
It was tested on a box that reaches this path at boot without any
instrumentation (from amdgpu_ttm_init()), plus the TTM shrinker
reproducer; the details are below the scissors there.
Two things in the attached sketch, in case it gets picked up as is:
- The first hunk prepends the patch name to the SPDX line
("pud_free_pmd_page-simplify// SPDX-License-Identifier: ..."),
which will not build.
- Making it return void conflicts with the prototype in
include/linux/pgtable.h, and vmap_try_huge_pud() still does
"if (!pud_free_pmd_page(pud, addr))". The arm64, riscv and powerpc
versions also always return 1, so dropping the return value looks
like a reasonable follow-up across architectures, but I kept v2
x86-only and returning int so that it stays small for stable.
Your comment above the flush explains it better than the "INVLPG to
clear all paging-structure caches" one-liner. If you prefer it, I can
send a v3 with it, or feel free to fold it in when applying.
prev parent reply other threads:[~2026-09-23 23:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-16 6:22 Mikhail Gavrilov
2026-09-23 16:33 ` Mikhail Gavrilov
2026-09-23 18:38 ` Pedro Falcato
2026-09-23 22:26 ` Mikhail Gavrilov
2026-09-23 22:53 ` Dave Hansen
2026-09-23 23:03 ` Mikhail Gavrilov [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=20260923230350.365304-1-mikhail.v.gavrilov@gmail.com \
--to=mikhail.v.gavrilov@gmail.com \
--cc=bp@alien8.de \
--cc=dave.hansen@intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=ljs@kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=pfalcato@suse.de \
--cc=regressions@lists.linux.dev \
--cc=rppt@kernel.org \
--cc=tglx@kernel.org \
--cc=toshi.kani@hpe.com \
--cc=x86@kernel.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
all inboxes | Powered by JetHome®