Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1917239rwb; Fri, 23 Sep 2022 22:51:48 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5whBdvofttOxr7nX/yDb2OrFDYJHQIJT0XwsRmHJI7EgoGDYSuplxT00YdQGYhoZw3lfHw X-Received: by 2002:a17:907:d07:b0:72e:ec79:ad0f with SMTP id gn7-20020a1709070d0700b0072eec79ad0fmr10288531ejc.296.1663998708672; Fri, 23 Sep 2022 22:51:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663998708; cv=none; d=google.com; s=arc-20160816; b=du66RQ+bs+0aar4OuPHXyhyw+kyKFLBRUZfqEIQcA4x/JxU584vk6iazFdfLZQw1wm g1PzXPdqJ+P7DeiN0RiO6G2K81cGUcIHKY9glp6Jv3cToZtOAzuh/5BvPt+LdtdjtTRv g4uzXU/uzQLpKd3r/wDEtY5esC1IoWiu4P3BGmnRy1JJ49cX2lyGfmF8myvmnRRPAeRG /+84BJ3Ve2LrSvnnVz6PYsxOme93XvrR5Xn9ZCAap1cY4Gyj1M10iIeGHgBefmDo0xRm +3WSkl08jcPF5FsIU0xAz+HGCsnrkHpkum5WQWVuDN5dN1SXqwlIvy2gdnl7oPxkTeL2 /eJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=hp/42N2i6PuccgU715Y/Xc7PBBOuVEDoQVUXTCti5SA=; b=plhpV8UjZQvOJQY9WIRDN1q+amOK1x8KKlCFx5Xshv8QtRJrLYPjUAgxeFNzq1QXw8 oWmV/WlRUO9ByEZ564wS45BHZURwaNmZJsjuk9cHyiqAnOPs/dyJlcP5UYY5A+jmLafJ f9EoR6WfDX5wmqs4V5a6h/a3e9d/XLa6q2zp2EbtJBYg0fF6OLr4/LONQp+jAN0prEGh C/XRN5f16f7uAGD5aP9uqV+m+JzuSJqqehT45OlmrxqsRENlnwZQ5A0n581rQiClxJg9 vFV9W90sDScM2jVZilteO6EHTHvk+esh+I/27UgiHT17sW9u3Db8JIyL+irYHO9+Uxic NsNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b="WR/3s7wd"; 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 i22-20020a1709064fd600b0072b7fac8a7asi10243089ejw.926.2022.09.23.22.51.22; Fri, 23 Sep 2022 22:51:48 -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="WR/3s7wd"; 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 S233034AbiIXFcx (ORCPT + 99 others); Sat, 24 Sep 2022 01:32:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229479AbiIXFcu (ORCPT ); Sat, 24 Sep 2022 01:32:50 -0400 Received: from mail-pg1-x533.google.com (mail-pg1-x533.google.com [IPv6:2607:f8b0:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4579EDD3C for ; Fri, 23 Sep 2022 22:32:49 -0700 (PDT) Received: by mail-pg1-x533.google.com with SMTP id c7so2003347pgt.11 for ; Fri, 23 Sep 2022 22:32:49 -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:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=hp/42N2i6PuccgU715Y/Xc7PBBOuVEDoQVUXTCti5SA=; b=WR/3s7wdutz9L7NKJT2aeukFstJukvxtQ9f96CptWWr7r2uEI089yTpxOkUz8+TF7y voSJhNK3vT0jn/klGafu/wq+uzZE0K9eTiU0Ibl01fqhTbbY31hEST3/onDIK6r7zybf rmM3qegOkzGQfBuWY/IjC/tYVIUVw/fpny0JQt4Mbrk01YyIHTTJIYra/ltDlb8llXUy 794PLDNAR7hPweGEsHE9n1OQ/qnYTzxRX+bFTDfevZ0MEhXhBRbLAcfuJRXwKRQqCKZR VP5AMpPONm2GQjedD2WXomp0hrlysemvAp9yZWJE0UzcHFkVx8gEm5UYgjYKLUKc/FeA fUiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=hp/42N2i6PuccgU715Y/Xc7PBBOuVEDoQVUXTCti5SA=; b=ov0UX+e8GeKVOErmaqWUPMx1R93cpH4UBApBh1w3pjO1V1A0ZjZ1Edxt/G26WjrJxc /X8IhcYzSpQAwpctAUuTUTYuuJQ8fYUqKZ81g7TWYgs3PWa322D5c1NndZd0tudgk2l+ +ImQFrV4pfOB8kOMrZ/ZZVoLz7+AMTB6chtqivEyCrANJDRNkbagLTGhVQOjD0w8v1Ye aYPnialfp24RjxhC9H3JmXhYQkwVviMFHG4VKUPGS/2pmMmdgIS+QQrmZMpuUCD5ufDT jRdMCfK8JfCwHIMmu2D3dQf+OJh/Yp/Yz0ztxrRrseha0WZ10Gw4leIWWQfxVp/SpxlT 1SJQ== X-Gm-Message-State: ACrzQf0LxIFlGRUazffBYJFVCj8CcxHnrjOrPwayP6Js4NOscm4IsAMF mo433IybqJ+qCmV89U06FsLfLg== X-Received: by 2002:a62:1bc8:0:b0:546:c62e:e84 with SMTP id b191-20020a621bc8000000b00546c62e0e84mr12486864pfb.45.1663997569341; Fri, 23 Sep 2022 22:32:49 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.232]) by smtp.gmail.com with ESMTPSA id d5-20020a170902cec500b0017286f83fadsm7023852plg.135.2022.09.23.22.32.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Sep 2022 22:32:48 -0700 (PDT) From: Qi Zheng To: akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, muchun.song@linux.dev, Qi Zheng Subject: [PATCH] mm: fix misuse of update_mmu_cache() in do_anonymous_page() Date: Sat, 24 Sep 2022 13:32:39 +0800 Message-Id: <20220924053239.91661-1-zhengqi.arch@bytedance.com> X-Mailer: git-send-email 2.24.3 (Apple Git-128) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 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 fix the misuse of update_mmu_cache() by using update_mmu_tlb() in the do_anonymous_page(). Signed-off-by: Qi Zheng --- 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; } -- 2.20.1