linux-parisc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John David Anglin <dave.anglin@bell.net>
To: Helge Deller <deller@gmx.de>,
	linux-parisc@vger.kernel.org,
	James Bottomley <James.Bottomley@hansenpartnership.com>
Subject: Re: [PATCH][RFC] parisc: Use local tlb purges only on UP machines
Date: Sun, 25 Sep 2022 10:33:02 -0400	[thread overview]
Message-ID: <d195aae3-b76b-1365-6e53-28c6791c77e3@bell.net> (raw)
In-Reply-To: <Yy/7g0NzOi/igNi7@p100>

I believe this change is wrong and will reduce performance.  The TLB setup for a TMPALIAS
flush is local to any given CPU.  So, we should only need a local TLB purge.

A local TLB purge doesn't require locking to serialize PxTLB broadcasts.  It is also  faster than
a global TLB purges

Indeed, the case that might be wrong is the one that uses pdtlb. It potentially needs serialization
on SMP machines.  See comment in pgtable.h.

Dave

On 2022-09-25 2:56 a.m., Helge Deller wrote:
> Limit usage of CPU-local tlb flushes in pacache.S to non-SMP machines.
> On 32-bit kernels this was the case already, with this patch this
> behaviour is used on 64-bit kernels now too.
>
> Signed-off-by: Helge Deller <deller@gmx.de>
>
> diff --git a/arch/parisc/kernel/pacache.S b/arch/parisc/kernel/pacache.S
> index 9a0018f1f42c..920f6ef5c3e5 100644
> --- a/arch/parisc/kernel/pacache.S
> +++ b/arch/parisc/kernel/pacache.S
> @@ -539,15 +539,10 @@ ENTRY_CFI(copy_user_page_asm)
>
>   	/* Purge any old translations */
>
> -#ifdef CONFIG_PA20
> -	pdtlb,l		%r0(%r28)
> -	pdtlb,l		%r0(%r29)
> -#else
>   0:	pdtlb		%r0(%r28)
>   1:	pdtlb		%r0(%r29)
>   	ALTERNATIVE(0b, 0b+4, ALT_COND_NO_SMP, INSN_PxTLB)
>   	ALTERNATIVE(1b, 1b+4, ALT_COND_NO_SMP, INSN_PxTLB)
> -#endif
>
>   #ifdef CONFIG_64BIT
>   	/* PA8x00 CPUs can consume 2 loads or 1 store per cycle.
> @@ -670,12 +665,8 @@ ENTRY_CFI(clear_user_page_asm)
>
>   	/* Purge any old translation */
>
> -#ifdef CONFIG_PA20
> -	pdtlb,l		%r0(%r28)
> -#else
>   0:	pdtlb		%r0(%r28)
>   	ALTERNATIVE(0b, 0b+4, ALT_COND_NO_SMP, INSN_PxTLB)
> -#endif
>
>   #ifdef CONFIG_64BIT
>   	ldi		(PAGE_SIZE / 128), %r1
> @@ -736,12 +727,8 @@ ENTRY_CFI(flush_dcache_page_asm)
>
>   	/* Purge any old translation */
>
> -#ifdef CONFIG_PA20
> -	pdtlb,l		%r0(%r28)
> -#else
>   0:	pdtlb		%r0(%r28)
>   	ALTERNATIVE(0b, 0b+4, ALT_COND_NO_SMP, INSN_PxTLB)
> -#endif
>
>   88:	ldil		L%dcache_stride, %r1
>   	ldw		R%dcache_stride(%r1), r31
> @@ -785,12 +772,8 @@ ENTRY_CFI(purge_dcache_page_asm)
>
>   	/* Purge any old translation */
>
> -#ifdef CONFIG_PA20
> -	pdtlb,l		%r0(%r28)
> -#else
>   0:	pdtlb		%r0(%r28)
>   	ALTERNATIVE(0b, 0b+4, ALT_COND_NO_SMP, INSN_PxTLB)
> -#endif
>
>   88:	ldil		L%dcache_stride, %r1
>   	ldw		R%dcache_stride(%r1), r31
> @@ -837,17 +820,11 @@ ENTRY_CFI(flush_icache_page_asm)
>   	 * have a flat address space, it's not clear which TLB will be
>   	 * used.  So, we purge both entries.  */
>
> -#ifdef CONFIG_PA20
> -	pdtlb,l		%r0(%r28)
> -1:	pitlb,l         %r0(%sr4,%r28)
> -	ALTERNATIVE(1b, 1b+4, ALT_COND_NO_SPLIT_TLB, INSN_NOP)
> -#else
>   0:	pdtlb		%r0(%r28)
>   1:	pitlb           %r0(%sr4,%r28)
>   	ALTERNATIVE(0b, 0b+4, ALT_COND_NO_SMP, INSN_PxTLB)
>   	ALTERNATIVE(1b, 1b+4, ALT_COND_NO_SMP, INSN_PxTLB)
>   	ALTERNATIVE(1b, 1b+4, ALT_COND_NO_SPLIT_TLB, INSN_NOP)
> -#endif
>
>   88:	ldil		L%icache_stride, %r1
>   	ldw		R%icache_stride(%r1), %r31

-- 
John David Anglin  dave.anglin@bell.net


  reply	other threads:[~2022-09-25 14:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-25  6:56 [PATCH][RFC] parisc: Use local tlb purges only on UP machines Helge Deller
2022-09-25 14:33 ` John David Anglin [this message]
2022-09-25 17:51   ` Helge Deller
2022-09-25 18:19     ` John David Anglin
2022-09-25 18:44       ` John David Anglin
2022-09-25 18:58         ` Helge Deller
2022-09-25 19:27           ` John David Anglin
2022-09-25 20:00             ` Helge Deller
2022-09-25 20:21               ` John David Anglin

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=d195aae3-b76b-1365-6e53-28c6791c77e3@bell.net \
    --to=dave.anglin@bell.net \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=deller@gmx.de \
    --cc=linux-parisc@vger.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;
as well as URLs for NNTP newsgroup(s).