From patchwork Thu Sep 29 11:23:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qi Zheng X-Patchwork-Id: 12993932 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 EFF03C433FE for ; Thu, 29 Sep 2022 11:23:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8A60E8D0003; Thu, 29 Sep 2022 07:23:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 856518D0001; Thu, 29 Sep 2022 07:23:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 71E3F8D0003; Thu, 29 Sep 2022 07:23:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 63A9D8D0001 for ; Thu, 29 Sep 2022 07:23:35 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 4072580E3B for ; Thu, 29 Sep 2022 11:23:35 +0000 (UTC) X-FDA: 79964887590.09.5584DFB Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) by imf23.hostedemail.com (Postfix) with ESMTP id E049F140008 for ; Thu, 29 Sep 2022 11:23:34 +0000 (UTC) Received: by mail-pj1-f54.google.com with SMTP id x1-20020a17090ab00100b001fda21bbc90so5633687pjq.3 for ; Thu, 29 Sep 2022 04:23:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=xxtjUzETZH9DEkady7grPZMHSOc1w1fLwuVdzuJOa7k=; b=F0vnTbakLMMLXNr4+EoGBwJ7euaiMM3zQ1iPMnIFzbzTDT+UedxfCF+nzZ8Pu1dxgo jFnRRQ87mG9ETqHrCRPJ8tYtFphSYYI02spSlat9EK0B813gSaIgau9lC8HO2TnfioyA U5z6aLF8grpUiBTUr+XtFfpPaJYP9p4wA8DQKcjo3sr2dGe0NeM6Fxc/VWkqDOtlnnzg pSkuwm2hb2k8o1a08Un+gZ94hmONuRKnxJltHdPaQsfHBaJZptn+qowTGYNvF6D/Q9Zt 8uDtYYjW2vdcVCbGIPWPG9Hu3SNsD27KC0RvbFFKymk5xhXut/fT0TtX9i9M5v8aewJA XeaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=xxtjUzETZH9DEkady7grPZMHSOc1w1fLwuVdzuJOa7k=; b=fQD/sF6sIa+fy3BpYlbN9SIoinOrs7gi04c6deIbOUKBK9JgNyLr8k0omY1tGGe36E CRP6F08UrrTNdIGS4i0pEzaB6bBZdxKwafTVnMTgR80f28DKIXVbhHyulJdNHIt3l1JH yTyTOLR052H8+di5+gtF74UaymerXRwimjlEkAqet+VyKhPmW85/Pl+sBGDDLcTH8C4r AyTl/l1MHPNf/FvkH0JkDtYqtsC5+dPWyAb3flffSkLUvoFVAKMvez/gmThasWBE/YHg NNFYkOpUYobjyTYo5kcW2M1JpzMMTiv3losHqkRCGhgGRlLmtR5HnSc7wZ+zYHO/ApoG 5Wbw== X-Gm-Message-State: ACrzQf1VXoGcSueo9rui9NHoRp3kQvrAyFyWiMmdPH/I42n86DD/L9GL ChDF4Wbz4xrfoxFPtv9QK3LMmw== X-Google-Smtp-Source: AMsMyM53p08RePYQc/tpM4G6W0IClpl/1lZvEDpnTKE1I+fFxmkZIodX6//T3hVBYwLf82XMjWa5Lw== X-Received: by 2002:a17:90b:180e:b0:202:e725:19e2 with SMTP id lw14-20020a17090b180e00b00202e72519e2mr15923391pjb.163.1664450613800; Thu, 29 Sep 2022 04:23:33 -0700 (PDT) Received: from C02DW0BEMD6R.bytedance.net ([139.177.225.254]) by smtp.gmail.com with ESMTPSA id i8-20020a655b88000000b00434651f9a96sm5225401pgr.15.2022.09.29.04.23.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Sep 2022 04:23:33 -0700 (PDT) From: Qi Zheng To: akpm@linux-foundation.org, maobibo@loongson.cn, chenhuacai@loongson.cn, songmuchun@bytedance.com, david@redhat.com Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, loongarch@lists.linux.dev, chris@zankel.net, jcmvbkbc@gmail.com, Qi Zheng Subject: [PATCH v3 1/2] mm: use update_mmu_tlb() on the second thread Date: Thu, 29 Sep 2022 19:23:17 +0800 Message-Id: <20220929112318.32393-2-zhengqi.arch@bytedance.com> X-Mailer: git-send-email 2.24.3 (Apple Git-128) In-Reply-To: <20220929112318.32393-1-zhengqi.arch@bytedance.com> References: <20220929112318.32393-1-zhengqi.arch@bytedance.com> MIME-Version: 1.0 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1664450614; a=rsa-sha256; cv=none; b=vBfWvfj5A8WULOf7mJIsm8yl1RHhr9tkkKhif0jo20kp8BVRpr5RnwZrvn+d9yAAdW3/7m CoVDZ9BCFtTkeWn1ykzv0VQxCriFpm1KOrTQQMkZORWgtZM7nR8j9fu/DQeCqT9WGyGwLK ifuVBG/6beObx7z3hQpIYiz/2TD8p7o= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=F0vnTbak; dmarc=pass (policy=none) header.from=bytedance.com; spf=pass (imf23.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.216.54 as permitted sender) smtp.mailfrom=zhengqi.arch@bytedance.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1664450614; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=xxtjUzETZH9DEkady7grPZMHSOc1w1fLwuVdzuJOa7k=; b=twLkmBii0ggIGNzKMW6VY0hInFCiDVd1a+aBJH+9P4OzBPJPKj8g++rCSnLJlNXqjxrp84 j4+pFffXgLIbEa6w5a2aaqQ545+ZXcviRV6zrU3AIuCisAz9RPe6O55DM2RrjRORmgiP5j zSwPjBY0r+QGeqNuERwPJ+cUYg2LKcs= X-Stat-Signature: qe8mhooq9ph7uy1hxzkcppou65emphoi X-Rspamd-Queue-Id: E049F140008 X-Rspamd-Server: rspam04 Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=F0vnTbak; dmarc=pass (policy=none) header.from=bytedance.com; spf=pass (imf23.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.216.54 as permitted sender) smtp.mailfrom=zhengqi.arch@bytedance.com X-Rspam-User: X-HE-Tag: 1664450614-342481 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: As message in commit 7df676974359 ("mm/memory.c: Update local TLB if PTE entry exists") said, we should update local TLB only on the second thread. So in the do_anonymous_page() here, we should use update_mmu_tlb() instead of update_mmu_cache() on the second thread. Signed-off-by: Qi Zheng Reviewed-by: Muchun Song Acked-by: David Hildenbrand Signed-off-by: Qi Zheng Reviewed-by: Muchun Song Acked-by: David Hildenbrand Signed-off-by: Andrew Morton --- mm/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memory.c b/mm/memory.c index 118e5f023597..9e11c783ba0e 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -4122,7 +4122,7 @@ static vm_fault_t do_anonymous_page(struct vm_fault *vmf) vmf->pte = pte_offset_map_lock(vma->vm_mm, vmf->pmd, vmf->address, &vmf->ptl); if (!pte_none(*vmf->pte)) { - update_mmu_cache(vma, vmf->address, vmf->pte); + update_mmu_tlb(vma, vmf->address, vmf->pte); goto release; }