public inbox for linux-alpha@vger.kernel.org
 help / color / mirror / Atom feed
From: Ivan Kokshaysky <ink@unseen.parts>
To: Magnus Lindholm <linmag7@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org,
	hch@infradead.org, macro@orcam.me.uk,
	glaubitz@physik.fu-berlin.de, mattst88@gmail.com,
	richard.henderson@linaro.org
Subject: Re: [PATCH 1/1] alpha: fix user-space corruption during memory compaction
Date: Sat, 3 Jan 2026 14:41:44 +0100	[thread overview]
Message-ID: <aVkcmDm1z5PGZNg6@minute> (raw)
In-Reply-To: <20260102173603.18247-2-linmag7@gmail.com>

On Fri, Jan 02, 2026 at 06:30:43PM +0100, Magnus Lindholm wrote:
> Alpha systems can suffer sporadic user-space crashes and heap
> corruption when memory compaction is enabled.
> 
> Symptoms include SIGSEGV, glibc allocator failures (e.g. "unaligned
> tcache chunk"), and compiler internal errors. The failures disappear
> when compaction is disabled or when using global TLB invalidation.
> 
> The root cause is insufficient TLB shootdown during page migration.
> Alpha relies on ASN-based MM context rollover for instruction cache
> coherency, but this alone is not sufficient to prevent stale data or
> instruction translations from surviving migration.
> 
> Fix this by introducing a migration-specific helper that combines:
>   - MM context invalidation (ASN rollover),
>   - immediate per-CPU TLB invalidation (TBI),
>   - synchronous cross-CPU shootdown when required.
> 
> The helper is used only by migration/compaction paths to avoid changing
> global TLB semantics.
> 
> Additionally, update flush_tlb_other(), pte_clear(), to use
> READ_ONCE()/WRITE_ONCE() for correct SMP memory ordering.
> 
> This fixes observed crashes on both UP and SMP Alpha systems.
> 
> Signed-off-by: Magnus Lindholm <linmag7@gmail.com>

Impressive work! Spot on, I guess.

Reviewed-by: Ivan Kokshaysky <ink@unseen.parts>

Ivan.

  reply	other threads:[~2026-01-03 14:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-02 17:30 [PATCH 0/1] alpha: fix user-space corruption during memory compaction Magnus Lindholm
2026-01-02 17:30 ` [PATCH 1/1] " Magnus Lindholm
2026-01-03 13:41   ` Ivan Kokshaysky [this message]
2026-01-10 23:50   ` matoro
2026-01-02 17:57 ` [PATCH 0/1] " John Paul Adrian Glaubitz
2026-01-20  7:44   ` Michael Cree
2026-01-20 22:44     ` Magnus Lindholm

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=aVkcmDm1z5PGZNg6@minute \
    --to=ink@unseen.parts \
    --cc=glaubitz@physik.fu-berlin.de \
    --cc=hch@infradead.org \
    --cc=linmag7@gmail.com \
    --cc=linux-alpha@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=macro@orcam.me.uk \
    --cc=mattst88@gmail.com \
    --cc=richard.henderson@linaro.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