From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 833ABC433F5 for ; Thu, 29 Sep 2022 12:11:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1B2FE8D0002; Thu, 29 Sep 2022 08:11:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 163308D0001; Thu, 29 Sep 2022 08:11:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0031C8D0002; Thu, 29 Sep 2022 08:11:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id E591E8D0001 for ; Thu, 29 Sep 2022 08:11:17 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id B7C29A0F06 for ; Thu, 29 Sep 2022 12:11:17 +0000 (UTC) X-FDA: 79965007794.16.58208BD Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) by imf22.hostedemail.com (Postfix) with ESMTP id 2B336C0006 for ; Thu, 29 Sep 2022 12:11:15 +0000 (UTC) Received: by mail-pj1-f48.google.com with SMTP id u59-20020a17090a51c100b00205d3c44162so5757216pjh.2 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=iV27ezWfop7S4H657CkzbBVG0Mtx4XiiVv+36CzNKEZeVxNUl2RXAYSl57TmrvjSbt 6C7y/Tr3nV6zp2nvAUyzfKzJhbsFTB+MakAgaoQzUeWj/i7DjmjS1nYJJ1uKNxYr+eQR HXPsLciyuCgXnYMDC7TpMRLjQtycGJz1205gj7zWWuVhpr/K5kJfTsoGIFcNSIAvFLCL IIlVL4Z7unX5ApWqd5WUX9E/XVibZpoG+99+0cW1QH+f9PtTrvhNk+lVdU9VIBN2t2H3 SRLr+dzyn5+xZYhPq24HUPFCrvs5aCLnfqru70HxaxEC8IpHcBWlOeqjTLccbapYU+72 gPwg== X-Gm-Message-State: ACrzQf2P1S/LTKu9yCtygiHQ90P14vXxIisGrjgfFflswVTTAuaVyRfo 2z6TTeUoUvL86TLRwHWmMiWDrg== X-Google-Smtp-Source: AMsMyM7EwImswx7nxZ3yFvW+mGYZbG+faPF83VvMPRxgDAtIWY4pVSQysYvPcLUq3C9ilt8FacfQeA== 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 ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=ehoboS0Q; spf=pass (imf22.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.216.48 as permitted sender) smtp.mailfrom=zhengqi.arch@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1664453477; a=rsa-sha256; cv=none; b=IXGpRKnzhrC7yGYKcKWDDcDUUj5zyIzkMgfpJS/lNRQdswkvVPDegdElZw9F7EAnUufKSX REqHvP02NNRsCr+ny+GD1CjEBvC1GHuMYor4g4u/fU++eAanMpVRsiDM5/dO7ffE1a098P fIOiPtVkSUkIxtDkJrr+bxDGtiT8N1U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1664453477; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Z7XuW+AFa1zSdV3jkS4YCJs3LGjfYYr9+c27k89oPls=; b=uX5xwmxeWCWh5G/5kpbKIyyy0CsXJGDmhQYCm52SuaF0KVhckpdqUOXeaPnofDBx8sQy18 Y9q+VJvD/RQwZa+z7kel232FartI7/hHQvOT/HEYSeBz1DQ/AaZ+UIcfYUyc1rJoHSZ33u XhjtrMyHOtBQFU3kzyj2VeMgcHQ9WhY= Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=ehoboS0Q; spf=pass (imf22.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.216.48 as permitted sender) smtp.mailfrom=zhengqi.arch@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-Rspam-User: X-Stat-Signature: e19axxi3azb8aidep357nb7tjzxrw6tf X-Rspamd-Queue-Id: 2B336C0006 X-Rspamd-Server: rspam05 X-HE-Tag: 1664453475-442525 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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