linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Huacai Chen <chenhuacai@kernel.org>
To: Qi Zheng <zhengqi.arch@bytedance.com>
Cc: akpm@linux-foundation.org, maobibo@loongson.cn,
	chenhuacai@loongson.cn,  songmuchun@bytedance.com,
	david@redhat.com, linux-kernel@vger.kernel.org,
	 linux-mm@kvack.org, loongarch@lists.linux.dev, chris@zankel.net,
	 jcmvbkbc@gmail.com
Subject: Re: [PATCH v3 2/2] LoongArch: update local TLB if PTE entry exists
Date: Thu, 29 Sep 2022 19:42:32 +0800	[thread overview]
Message-ID: <CAAhV-H76pOCs2uAA6y1JB+-uwASDBTWk-zaheGdG+ap-4HUZxA@mail.gmail.com> (raw)
In-Reply-To: <20220929112318.32393-3-zhengqi.arch@bytedance.com>

Hi, all,

Should this patch go via mm tree or loongarch tree? If via mm tree, then

Acked-by: Huacai Chen <chenhuacai@loongson.cn>

On Thu, Sep 29, 2022 at 7:23 PM Qi Zheng <zhengqi.arch@bytedance.com> wrote:
>
> Currently, the implementation of update_mmu_tlb() is empty if
> __HAVE_ARCH_UPDATE_MMU_TLB is not defined. Then if two threads
> concurrently fault at the same page, the second thread that did
> not win the race will give up and do nothing. In the LoongArch
> architecture, this second thread will trigger another fault,
> and only updates its local TLB.
>
> Instead of triggering another fault, it's better to implement
> update_mmu_tlb() to directly update the local TLB of the second
> thread. Just do it.
>
> Suggested-by: Bibo Mao <maobibo@loongson.cn>
> Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com>
> ---
>  arch/loongarch/include/asm/pgtable.h | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/arch/loongarch/include/asm/pgtable.h b/arch/loongarch/include/asm/pgtable.h
> index 8ea57e2f0e04..946704bee599 100644
> --- a/arch/loongarch/include/asm/pgtable.h
> +++ b/arch/loongarch/include/asm/pgtable.h
> @@ -412,6 +412,9 @@ static inline void update_mmu_cache(struct vm_area_struct *vma,
>         __update_tlb(vma, address, ptep);
>  }
>
> +#define __HAVE_ARCH_UPDATE_MMU_TLB
> +#define update_mmu_tlb update_mmu_cache
> +
>  static inline void update_mmu_cache_pmd(struct vm_area_struct *vma,
>                         unsigned long address, pmd_t *pmdp)
>  {
> --
> 2.20.1
>
>


  reply	other threads:[~2022-09-29 11:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-29 11:23 [PATCH v3 0/2] use update_mmu_tlb() on the second thread Qi Zheng
2022-09-29 11:23 ` [PATCH v3 1/2] mm: " Qi Zheng
2022-09-30  8:30   ` David Hildenbrand
2022-09-30  8:43     ` Qi Zheng
2022-09-30  8:44       ` David Hildenbrand
2022-09-30  8:46         ` Qi Zheng
2022-09-30 22:31         ` Andrew Morton
2022-09-30 23:09           ` Qi Zheng
2022-09-29 11:23 ` [PATCH v3 2/2] LoongArch: update local TLB if PTE entry exists Qi Zheng
2022-09-29 11:42   ` Huacai Chen [this message]
2022-09-29 12:10     ` Qi Zheng

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=CAAhV-H76pOCs2uAA6y1JB+-uwASDBTWk-zaheGdG+ap-4HUZxA@mail.gmail.com \
    --to=chenhuacai@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=chenhuacai@loongson.cn \
    --cc=chris@zankel.net \
    --cc=david@redhat.com \
    --cc=jcmvbkbc@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=loongarch@lists.linux.dev \
    --cc=maobibo@loongson.cn \
    --cc=songmuchun@bytedance.com \
    --cc=zhengqi.arch@bytedance.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