From: Catalin Marinas <catalin.marinas@arm.com>
To: "Christoph Lameter (Ampere)" <cl@gentwo.org>
Cc: Yang Shi <yang@os.amperecomputing.com>,
muchun.song@linux.dev, osalvador@suse.de, david@redhat.com,
akpm@linux-foundation.org, will@kernel.org,
carl@os.amperecomputing.com, linux-mm@kvack.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: hugetlb: avoid soft lockup when mprotect with PROT_MTE
Date: Fri, 26 Sep 2025 17:56:21 +0100 [thread overview]
Message-ID: <aNbFtaVr8f2klqdD@arm.com> (raw)
In-Reply-To: <1038c7c7-81d6-f273-6fa1-93eb7206d5ed@gentwo.org>
On Fri, Sep 26, 2025 at 09:29:54AM -0700, Christoph Lameter (Ampere) wrote:
> On Fri, 26 Sep 2025, Yang Shi wrote:
> > When calling mprotect() with PROT_MTE, kernel will initialize MTE tags
> > for every single page in the affected area. Soft lockup was observed
> > when doing this for large HugeTLB memory area in our customer's workload
> > (~300GB memory):
>
> AFAICT this is a bug fix. The hugetlb path should be doing a
> cond_resched() like the base page code does.
>
> It is not MTE specific. If other processing takes a long time in the loop
> (setting up terabyte size mappings for hugetlb for example) then the
> softlockup could also be triggered on non MTE workloads.
Yeah, with MTE set_huge_pte_at() isn't just setting a pte but also
clearing the tags. So it can take considerable time.
The fix is indeed not related to MTE, so I don't think the Fixes tag
should mention MTE (but I'm fine with a cc stable). Let's say we change
a hugetlb from RW to RX and have to do cache maintenance, we'd trigger a
similar soft lockup, depending on how fast the system is.
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
next prev parent reply other threads:[~2025-09-26 16:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-26 16:20 Yang Shi
2025-09-26 16:29 ` Christoph Lameter (Ampere)
2025-09-26 16:56 ` Catalin Marinas [this message]
2025-09-26 17:51 ` Yang Shi
2025-09-29 8:29 ` David Hildenbrand
2025-09-29 16:15 ` Yang Shi
2025-09-29 9:27 ` Oscar Salvador
2025-09-29 9:55 ` Anshuman Khandual
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=aNbFtaVr8f2klqdD@arm.com \
--to=catalin.marinas@arm.com \
--cc=akpm@linux-foundation.org \
--cc=carl@os.amperecomputing.com \
--cc=cl@gentwo.org \
--cc=david@redhat.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=muchun.song@linux.dev \
--cc=osalvador@suse.de \
--cc=will@kernel.org \
--cc=yang@os.amperecomputing.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