From: Catalin Marinas <catalin.marinas@arm.com>
To: Christoph Lameter <cl@gentwo.org>
Cc: linux-arm-kernel@lists.infradead.org,
"tokamoto@jp.fujitsu.com" <tokamoto@jp.fujitsu.com>,
"qi.fuli@fujitsu.com" <qi.fuli@fujitsu.com>,
Takao Indoh <indou.takao@fujitsu.com>,
Will Deacon <will.deacon@arm.com>,
Jon Masters <jcm@jonmasters.org>
Subject: Re: [RFC 3/8] ARM64: Base TLB functions
Date: Mon, 4 Mar 2024 18:15:25 +0000 [thread overview]
Message-ID: <ZeYPvbKdtFBf97Dl@arm.com> (raw)
In-Reply-To: <20231207035712.933420164@gentwo.org>
Hi Christoph,
I don't think any of these patches made it to the list for some reason,
only the cover letter. I'll add some general comments below in case you
plan to repost.
On Wed, Dec 06, 2023 at 07:57:06PM -0800, Christoph Lameter wrote:
> Add a series of TLB function that allow TLB flushing in a variety of
> ways depending on the mode encoded in enum tlb_state:
>
> TLB_BROADCOAST -> Use single TLBI propagated to all units via the mesh
> TLB_LOCAL -> Use TLBI that only perform local flushes
> TLB_IPI -> Use TLBIs that perform local flushes on multiple cpus
> TLB_NONE -> Suppress TLBI because there are no users of the address space
TLB_IPI - I really don't want this on arm64, irrespective of the
performance improvement on specific hardware. IPIs need additional care
to avoid deadlocking, e.g. don't do a TLBI with interrupts disabled. I'd
rather not have to care about this.
TLB_LOCAL and TLB_NONE - these are potentially useful _but_ they don't
take the SMMU with SVA into account (another potential issue below). The
mm_cpumask() does not track other non-CPU contexts but they do need the
broadcast TLBI.
> +static enum tlb_state tlbstat(struct cpumask *mask)
> +{
> + unsigned int weight = cpumask_weight(mask);
> + bool present = cpumask_test_cpu(smp_processor_id(), mask);
Is this guaranteed to be called in a non-preemptible context? My biggest
concern with the cpumask tracking is that the thread is migrated in the
middle of a TLB flush and it would wrongly assume that only a local TLBI
is needed. On arm64 we don't flush the TLBs on context switch. I don't
think we can solve this without additional locking around mm_cpumask()
or at least preemption disabling.
--
Catalin
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2024-03-04 18:15 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-07 3:57 [RFC 0/8] ARM64 TLB logic revision for more control and enhanced diagnostics Christoph Lameter
[not found] ` <20231207035712.933420164@gentwo.org>
2024-03-04 18:15 ` Catalin Marinas [this message]
2024-03-05 19:08 ` [RFC 3/8] ARM64: Base TLB functions Christoph Lameter (Ampere)
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=ZeYPvbKdtFBf97Dl@arm.com \
--to=catalin.marinas@arm.com \
--cc=cl@gentwo.org \
--cc=indou.takao@fujitsu.com \
--cc=jcm@jonmasters.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=qi.fuli@fujitsu.com \
--cc=tokamoto@jp.fujitsu.com \
--cc=will.deacon@arm.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.