From patchwork Sat Sep 24 05:32:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qi Zheng X-Patchwork-Id: 12987406 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 3F3ECC07E9D for ; Sat, 24 Sep 2022 05:32:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4C3418003C; Sat, 24 Sep 2022 01:32:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 471AA80016; Sat, 24 Sep 2022 01:32:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3398D8003C; Sat, 24 Sep 2022 01:32:52 -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 2390380016 for ; Sat, 24 Sep 2022 01:32:52 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id EA9E01C5EB1 for ; Sat, 24 Sep 2022 05:32:51 +0000 (UTC) X-FDA: 79945859742.29.293DE72 Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) by imf17.hostedemail.com (Postfix) with ESMTP id A10C44000D for ; Sat, 24 Sep 2022 05:32:50 +0000 (UTC) Received: by mail-pf1-f179.google.com with SMTP id l65so1934207pfl.8 for ; Fri, 23 Sep 2022 22:32:50 -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=ofRIdt4Yhn8493O1b+qincRsVy8aGo1I4bdAZlajeSt3acCaRr5DPfdFu/KNVykMhj ATSyJsezxRBLO7W8PSoV7sfzcAmhT0RmxRTghuez1y57Arselgxa7vrfsAsL3PfEJ7aQ bzTcUdqp34FZV8f00OlYhyIy95vLzvQmwZol7e9SufopMjSQL4sTSseQmU8kmQldtu5P r9AxToHmAN8LAdVqewzqBGHcEMmq/BYjSqlZ/WLW9bD4XPx7g5uJoIjjW+7qUH5B1dFL 16pxXTYhhz6tHvnD/Ndu49N5rIkVG/WBs5ZvnUNcCs6LZnY3EQIj1rXNpXhHlh290yIH 6T4g== X-Gm-Message-State: ACrzQf0YL/iLrdCB3doCp7FmVqdixuBUnDNRc/8IFnJoKbA24f2srv+j hT+XaXIaPXoi7maCik7oNvN+rw== X-Google-Smtp-Source: AMsMyM6LGPHxG2C+f4vPGJkM1QFrFfn359mompHONvT3eNnhaVU7H7f+IIaVHDNIzZYZ4ivtInm36Q== 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 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663997571; a=rsa-sha256; cv=none; b=RoRLmZ9ayYIebQcyyTaclw7aipCxMlaDJXPO0gBe05XgPsWrdoHyedzwJBqf915GkuZFDk PQRmCkdAICjzeQkHx2eRjuw61FflSM/uQPm9Yvm5s72UXKU1XjIEEDmyZ1b/xkFaacEl07 MtTaC0KDXgH3VsNZUPLTJEMhITjPxe8= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b="WR/3s7wd"; dmarc=pass (policy=none) header.from=bytedance.com; spf=pass (imf17.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.210.179 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=1663997571; 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:references:dkim-signature; bh=hp/42N2i6PuccgU715Y/Xc7PBBOuVEDoQVUXTCti5SA=; b=4mpm/I/lO5KY9fSIL9S9w8+i4k47SR+/2gGX33xuaMklyP7WhNwlRixgH4OP330YH80ZrE 4ViJfvCJ5SD2LQ9uCrWylRTjfmIuKYMOoKtMiKzsxvA8HEExqbQxL2WGNGggScHSufhgbC ZpPW5M/P2e5dCj7t2mJD8v8zim2qc+Q= Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b="WR/3s7wd"; dmarc=pass (policy=none) header.from=bytedance.com; spf=pass (imf17.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.210.179 as permitted sender) smtp.mailfrom=zhengqi.arch@bytedance.com X-Rspam-User: X-Stat-Signature: u38589gppbqc5o1jjzemzpoh4cagmr75 X-Rspamd-Queue-Id: A10C44000D X-Rspamd-Server: rspam09 X-HE-Tag: 1663997570-438871 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 fix the misuse of update_mmu_cache() by using update_mmu_tlb() in the do_anonymous_page(). Signed-off-by: Qi Zheng Reviewed-by: Muchun Song --- 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; }