Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2094174rwb; Thu, 29 Sep 2022 06:14:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4CS7sewmofXgc0mJ/hI0xZNcIvjozMEO/93jSrCUkenRSSg20j0fIwyfwoeqrKYfqhL7vg X-Received: by 2002:a05:6402:3509:b0:452:20c7:5a95 with SMTP id b9-20020a056402350900b0045220c75a95mr3365456edd.427.1664457266222; Thu, 29 Sep 2022 06:14:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664457266; cv=none; d=google.com; s=arc-20160816; b=U696VUZ7bNXzQ8NGJDk24dlSNXtsm6CWzU1/gsMXLXVFEy57NmHN+ZonbghFGhBeuG H7+Yeb+eKinIFUmg1r0RaUj0EvToEvXG0LD2PhmKrSkPYgdu+YyxYDno75igOzaNWPqT ao9BTqV9Mq6KO35bvbanJkT04arMGcBAHsCgrS7bgbffwMLcD5IGyT2oNa6mKeAOS7QP fxALNtR4m4pikEhRqP0QN833t3GqIKfxMvX3926kualPw2gcCG8mNUfTMH8evBfF0K3X p5gMk3Xik74UC1bNYdZVTBP4uAoWPBM9r4cErggv/5WUH9Gbw9jmRjYlYUaXaxhLIjoQ b+2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=Z7XuW+AFa1zSdV3jkS4YCJs3LGjfYYr9+c27k89oPls=; b=aQ58eWgbeU3DBQT3m8/0zsMlBsVsFJHW+DlSvyCXhScxQ0vEnsaDienzGH+MhQfAd3 iHPZJRQrTQriDzbcEHCnVAuxEIa2HxfwyjxdxuDKR9NLUPdXB//6LrbvoJLEpFC7WkVZ u0dWLoL/91IUPyvTwS5JE9nlCoFH/ADQcaaSG1vbTpLya/Lmw8oHLwz/xSNWF2v1k8wK PBiSu6B6iSGQwvgSAWCBo1/JIdip1qwGeUsZsFAUrmYI7dxNVDCgtbVqmdjSa4eCz6Rg cWMuJCzkJErBUct1ttMwRBLtNmm8rAG8GpW8tuW2KU3j/cEf6oZ1Nt01CD8jItYSRsSd 5tlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=ehoboS0Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y17-20020a056402359100b00451e0d930dfsi10143426edc.497.2022.09.29.06.14.01; Thu, 29 Sep 2022 06:14:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=ehoboS0Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235237AbiI2MLj (ORCPT + 99 others); Thu, 29 Sep 2022 08:11:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235605AbiI2MLb (ORCPT ); Thu, 29 Sep 2022 08:11:31 -0400 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6496010B5BA for ; Thu, 29 Sep 2022 05:11:15 -0700 (PDT) Received: by mail-pl1-x633.google.com with SMTP id x1so1085807plv.5 for ; Thu, 29 Sep 2022 05:11:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date; bh=Z7XuW+AFa1zSdV3jkS4YCJs3LGjfYYr9+c27k89oPls=; b=ehoboS0QQDoxfak0jPEZuzA6PZYtVRrkQiUBPgrw1TWIXkHRVuJTacrYPNeuT0fv+f 2SkQyOApLpapjcC5SwNjwgidU91fRWv8xo2sml/vgKFpTkc1sN9hP0qCYNo5namMrn1/ EPWZx25C0+DTo9Pl4F2rUU9MRu8DJZkxMaAS1y1gJog9EujlF/oHXOIIJU9QQK2oZpMH GTESFbtkmdmDj1gQ6isyQswTXd/4AQFDyR6VnUVuJg8CaVItvENWm1Y9IzFlNbnSxeDE KfnUxYWLWsCmYhYArA3mi0HzpE4Gu5qtnugXtkRT9gZwENIPfRy91DyWsaM1bTstBtLu wJ7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date; bh=Z7XuW+AFa1zSdV3jkS4YCJs3LGjfYYr9+c27k89oPls=; b=n4vAnbGPvdzCkuBR/o7nBiQYDE9329iOqjxAeQ/QBwAO9fenlsRa1OEhxq9t4jI8cI Cdev+9swwYJcaEmJ55PLy8I4K2oGaNCoNFuu9mfGT0YolCvrM2a5iDS5+9ZlQMLJwIi6 Y0KwvwyDw6rAi2aggoiDyhoGlxyElbK6ezFnfrFroGaO2Oev7T6J8vr6V3uzVmIYlr99 e8xengdl17HH7/A9bqHmK1U2/euYJEPeEC8ZGn+fod7PJk68ARG0LelJJEj/VOg4FPIk LLJym3mqxxxNwlZ3nbsiO5CzCRED/sw1d+gbxOScm7R/U0S3XrSft8d/l46SbXsck7IW h7xg== X-Gm-Message-State: ACrzQf2A0IyS8sR+4aWl2F367AvrDlBozuSiqic4ZZAz7Rteepb1q7ga XOpW5wHYpILscAFRgy4DG+gdJg== X-Received: by 2002:a17:902:e74c:b0:177:f3be:2812 with SMTP id p12-20020a170902e74c00b00177f3be2812mr3097627plf.123.1664453474898; Thu, 29 Sep 2022 05:11:14 -0700 (PDT) Received: from [10.4.189.225] ([139.177.225.254]) by smtp.gmail.com with ESMTPSA id n26-20020a63971a000000b0043b565cb57csm5389706pge.73.2022.09.29.05.10.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 29 Sep 2022 05:11:06 -0700 (PDT) Message-ID: <1755ade9-9333-4dc2-dd06-eb1f87d6b30d@bytedance.com> Date: Thu, 29 Sep 2022 20:10:42 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.3.0 Subject: Re: [PATCH v3 2/2] LoongArch: update local TLB if PTE entry exists Content-Language: en-US To: Huacai Chen , Andrew Morton Cc: 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 References: <20220929112318.32393-1-zhengqi.arch@bytedance.com> <20220929112318.32393-3-zhengqi.arch@bytedance.com> From: Qi Zheng In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022/9/29 19:42, Huacai Chen wrote: > Hi, all, > > Should this patch go via mm tree or loongarch tree? If via mm tree, then Both are fine for me. Hi Andrew, can you help to apply this patch series? > > Acked-by: Huacai Chen Thanks. :) > > On Thu, Sep 29, 2022 at 7:23 PM Qi Zheng 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 >> Signed-off-by: Qi Zheng >> --- >> 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 >> >> -- Thanks, Qi