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 AED3BC433F5 for ; Thu, 29 Sep 2022 11:42:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1F78C8D0002; Thu, 29 Sep 2022 07:42:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 17F7C8D0001; Thu, 29 Sep 2022 07:42:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 01FBA8D0002; Thu, 29 Sep 2022 07:42:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id E3ADA8D0001 for ; Thu, 29 Sep 2022 07:42:49 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 79CE7A039A for ; Thu, 29 Sep 2022 11:42:49 +0000 (UTC) X-FDA: 79964936058.09.40B312A Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf05.hostedemail.com (Postfix) with ESMTP id EB3CD100007 for ; Thu, 29 Sep 2022 11:42:48 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id DAD20B8246A for ; Thu, 29 Sep 2022 11:42:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EDF21C433B5 for ; Thu, 29 Sep 2022 11:42:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664451765; bh=R8C++G9yVjwgvqMjhqRqKMSuZQfilkNzr6uk/kuxuGo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=WH9SOjOmqxgO/Nwf83BfzJWn5pkQQfwFvgx65m+fn9DJDuAcKYQlmTm+C9b/mTtGa 8IbSW0gag5BPck7AsAk066x0N0zBmt6LtVh/ZEFVkkdG80vv3nT0JptzWmr0oa9gTB VD9glJMAcl3uz8Wo66wCjItA04eH3/3MnbP4aWfH1RFKpY9zhQBxkNntPOrbdeY/0H HE6+Wum5r/yAcTKiP8w4aBYb/bZ7Rh49CHnAFbHhPIaA9eWe5dQ71MftDCv9dkAzJm lXkR8CCI+TdXH/Mpmx0fYFjwq/luE+jfNxP6mqkfMmfU/V6gIkGo9n1xFJAnJ79xLt ii18tkDND6oVQ== Received: by mail-vs1-f51.google.com with SMTP id 63so1207371vse.2 for ; Thu, 29 Sep 2022 04:42:44 -0700 (PDT) X-Gm-Message-State: ACrzQf0h/q4+4mVlVvH99JRDIBNWlIfkzC4i8cWkLtQUqwzhyS3Dd96F UxnHyksE0qP+b4ptZlQY+lRrGdzuwSStZ0blKLs= X-Google-Smtp-Source: AMsMyM6Nnt8ZdRe8FMdHl/JPv1eHTDU5Op0EUXbvFWEy78GzfWHyiNuR27dKEVd0bqvRZVt7fePlnxU/4+oWz5pRMMM= X-Received: by 2002:a05:6102:1481:b0:39a:67f5:3096 with SMTP id d1-20020a056102148100b0039a67f53096mr989910vsv.70.1664451763903; Thu, 29 Sep 2022 04:42:43 -0700 (PDT) MIME-Version: 1.0 References: <20220929112318.32393-1-zhengqi.arch@bytedance.com> <20220929112318.32393-3-zhengqi.arch@bytedance.com> In-Reply-To: <20220929112318.32393-3-zhengqi.arch@bytedance.com> From: Huacai Chen Date: Thu, 29 Sep 2022 19:42:32 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 2/2] LoongArch: update local TLB if PTE entry exists To: Qi Zheng 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 Content-Type: text/plain; charset="UTF-8" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1664451769; a=rsa-sha256; cv=none; b=t8NkHnx5RDHx2uYbFZbw3Ii3gxJcRKzzsEXL5gJgJA+fX392CM6u3c6W8UaUMVW8DqZqw2 DoU0D79/pOLBSf37gDXXhM4Ld9cnExYFVbb2fk88w9a85pkeB4y3mTS8UyrelMT+iIbZad eKjT4fobLHXKyTHyn32xUGB8OLwrsR4= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=WH9SOjOm; spf=pass (imf05.hostedemail.com: domain of chenhuacai@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=chenhuacai@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1664451769; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=F+ZA4YsZskSHzxqaf3CkatgmWagHR2RePd/JsUtyf0I=; b=wD4BqDVocNoaBUyAHM1pHaGcuOmhvc1DXPAZB4AVqoNFkjzGSUH4fNJEalbR9KZWn604wa YtFebKkACJ1kYZ+swfe62HO1Rkb1y+j5VeJ0/7j6taii4tZ+B0fimcdggD8EhFCSTweGdB K0RraUMAgrAYcwEw3ZEYvnsvxGU5WG0= X-Stat-Signature: c7nkfdazaa514yb3oj1bi8sb9ehjohnu X-Rspamd-Queue-Id: EB3CD100007 X-Rspam-User: Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=WH9SOjOm; spf=pass (imf05.hostedemail.com: domain of chenhuacai@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=chenhuacai@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-Rspamd-Server: rspam01 X-HE-Tag: 1664451768-59732 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: Hi, all, Should this patch go via mm tree or loongarch tree? If via mm tree, then Acked-by: Huacai Chen 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 > >