mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Xi Ruoyao <xry111@xry111.site>
To: Huacai Chen <chenhuacai@loongson.cn>,
	Huacai Chen <chenhuacai@kernel.org>
Cc: loongarch@lists.linux.dev, linux-arch@vger.kernel.org,
	Xuefeng Li <lixuefeng@loongson.cn>, Guo Ren <guoren@kernel.org>,
	Xuerui Wang <kernel@xen0n.name>,
	Jiaxun Yang <jiaxun.yang@flygoat.com>,
	linux-kernel@vger.kernel.org, loongson-kernel@lists.loongnix.cn,
	Jun Yi <yijun@loongson.cn>
Subject: Re: [PATCH] LoongArch: Support dbar with different hints
Date: Tue, 16 May 2023 21:19:56 +0800	[thread overview]
Message-ID: <2ce668fc3384691cf08d70e36c25e754aab5042a.camel@xry111.site> (raw)
In-Reply-To: <20230516124536.535343-1-chenhuacai@loongson.cn>

On Tue, 2023-05-16 at 20:45 +0800, Huacai Chen wrote:
> Traditionally, LoongArch uses "dbar 0" (full completion barrier) for
> everything. But the full completion barrier is a performance killer, so
> Loongson-3A6000 and newer processors introduce different hints:
> 
> Bit4: ordering or completion (0: completion, 1: ordering)
> Bit3: barrier for previous read (0: true, 1: false)
> Bit2: barrier for previous write (0: true, 1: false)
> Bit1: barrier for succeeding read (0: true, 1: false)
> Bit0: barrier for succedding write (0: true, 1: false)
> 
> Hint 0x700: barrier for "read after read" from the same address, which
> is needed by LL-SC loops.

Great!  I guess Xuerui would add this into his weekly news :).

I don't really understand these C++-memory-model-like concepts so I'll
not review the "orwrw" parts, but...

/* snip */

> diff --git a/arch/loongarch/mm/tlbex.S b/arch/loongarch/mm/tlbex.S
> index 244e2f5aeee5..240ced55586e 100644
> --- a/arch/loongarch/mm/tlbex.S
> +++ b/arch/loongarch/mm/tlbex.S
> @@ -184,7 +184,7 @@ tlb_huge_update_load:
>         ertn
>  
>  nopage_tlb_load:
> -       dbar            0
> +       dbar            0x700

There is no LL/SC loop here.  I guess this shares a same internal uarch
logic as the LL/SC loop, but there should be a clarification for 0x700
in the commit message.

>         csrrd           ra, EXCEPTION_KS2
>         la_abs          t0, tlb_do_page_fault_0
>         jr              t0
> @@ -333,7 +333,7 @@ tlb_huge_update_store:
>         ertn
>  
>  nopage_tlb_store:
> -       dbar            0
> +       dbar            0x700
>         csrrd           ra, EXCEPTION_KS2
>         la_abs          t0, tlb_do_page_fault_1
>         jr              t0
> @@ -480,7 +480,7 @@ tlb_huge_update_modify:
>         ertn
>  
>  nopage_tlb_modify:
> -       dbar            0
> +       dbar            0x700
>         csrrd           ra, EXCEPTION_KS2
>         la_abs          t0, tlb_do_page_fault_1
>         jr              t0

-- 
Xi Ruoyao <xry111@xry111.site>
School of Aerospace Science and Technology, Xidian University

  reply	other threads:[~2023-05-16 13:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-16 12:45 Huacai Chen
2023-05-16 13:19 ` Xi Ruoyao [this message]
2023-05-16 13:24 ` WANG Xuerui
2023-05-17  6:51   ` Huacai Chen

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=2ce668fc3384691cf08d70e36c25e754aab5042a.camel@xry111.site \
    --to=xry111@xry111.site \
    --cc=chenhuacai@kernel.org \
    --cc=chenhuacai@loongson.cn \
    --cc=guoren@kernel.org \
    --cc=jiaxun.yang@flygoat.com \
    --cc=kernel@xen0n.name \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lixuefeng@loongson.cn \
    --cc=loongarch@lists.linux.dev \
    --cc=loongson-kernel@lists.loongnix.cn \
    --cc=yijun@loongson.cn \
    /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®