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 C358CC32771 for ; Thu, 29 Sep 2022 03:07:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 57A458D0002; Wed, 28 Sep 2022 23:07:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 52AE68D0001; Wed, 28 Sep 2022 23:07:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3CAAD8D0002; Wed, 28 Sep 2022 23:07:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 2F6738D0001 for ; Wed, 28 Sep 2022 23:07:33 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id EF39D1C6615 for ; Thu, 29 Sep 2022 03:07:32 +0000 (UTC) X-FDA: 79963637544.30.3D1FFC8 Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) by imf26.hostedemail.com (Postfix) with ESMTP id A7D68140007 for ; Thu, 29 Sep 2022 03:07:30 +0000 (UTC) Received: by mail-pj1-f46.google.com with SMTP id l9-20020a17090a4d4900b00205e295400eso115646pjh.4 for ; Wed, 28 Sep 2022 20:07:30 -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:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date; bh=nlPYCYLrKf8BOWfnFv9EjPVqcb26DzV5stt4LLI2CDM=; b=4L2laas/SoKdhxhVxl+/F8y6nx9qUa1Huiffa6tBPNFMIWEshndl3pqLfSpRqDQX/3 IEUbaHhzvvSwyrF2h3r6e/9CqzsUMPfgDFweV7jXUEQqZzNYI6ZNcs0y1kDpQSlRntuw CK8MM9zPBQ+ImfI6fiCJFVD0/pnRIy6ZKaBwndKQ1ZGlJq0gSnU7t6ezF0jjR1rjnpKK 7tmNJZT6UeI6bSuNMWaa3fz7NFKSD4I/XvZW1/WM1/aeMgYkkNASUOaRSzYhPRm5Yfil L420uq+cr/JX02fGUPK6ss1k1OTUmO1g96WH78aI5ondO9OmAw5KWdGXuXmhsjbKIKRw 0KFA== 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:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date; bh=nlPYCYLrKf8BOWfnFv9EjPVqcb26DzV5stt4LLI2CDM=; b=p/QeIyU7yaYAK+76UwA3ed2k2hesM4YyJBXTs1xL+Bm+oSwb7BFnjSZT02RUpBJxAD INChioeAjizjGGkfYVm0NJ5QNzAMFUD2x20fAqBftq0yBkhDXGRFq2Ncx1CjMAV3/C6V CJrIQvkssVXigw4GDxGejUWGnNxBflCkdrNTJsGYqBwGPHc+7eWupmDTHEiXxXQ+CaaR Mu4/slPgvv11Skg0/aCr1ipA96Mv19TE44sB7Nl2tCsVBp9ItN2w82wYACAClgM0pNwE yXzwyrPJJn7ytCzwQtlmyjFAHlyU/M8C3jCcOrZ7J/m3D/toupEvsL9SULQh/8yrZCdI z5Pg== X-Gm-Message-State: ACrzQf1zE1HIz9FV5YPoz1Yhytrp3z5ddmZH+DJYWvsBH+da928l8knq 8fOUVujuM8GslJhAsFf54YiFbqrXVVcu6VdY X-Google-Smtp-Source: AMsMyM4LKaaEF0SWBwjnD1Ml7WKbUkhBqq+WBwyz0b04D1NRDj/GROspVOFfMIMEBWLmwBw4fHkakA== X-Received: by 2002:a17:902:7c11:b0:178:a6ca:4850 with SMTP id x17-20020a1709027c1100b00178a6ca4850mr1213656pll.111.1664420849420; Wed, 28 Sep 2022 20:07:29 -0700 (PDT) Received: from [10.4.189.225] ([139.177.225.254]) by smtp.gmail.com with ESMTPSA id m10-20020a62a20a000000b0053ebafa7c42sm4820102pff.79.2022.09.28.20.07.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 28 Sep 2022 20:07:28 -0700 (PDT) Message-ID: Date: Thu, 29 Sep 2022 11:07:22 +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 v2] mm: use update_mmu_tlb() on the second thread To: David Hildenbrand , akpm@linux-foundation.org, muchun.song@linux.dev, maobibo@loongson.cn Cc: chris@zankel.net, jcmvbkbc@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Muchun Song References: <20220926115621.13849-1-zhengqi.arch@bytedance.com> Content-Language: en-US From: Qi Zheng In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b="4L2laas/"; spf=pass (imf26.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.216.46 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=1664420852; a=rsa-sha256; cv=none; b=Y5wiDvemjqKYrSIYGKKOOTqdjcp3ndQXb0pGM/V6kzjJEh4fqnu82VaBpGBOCOVERxVzmI 1UFH4+Qqy2/ck7a48zOnQqlPspKN4PVK+0QCJB9XwMq5vs9sxPj5yA+c4Hwce7oDkRwBoF BGWflVyHqWM4UkueJuDOLA7MZLk47hQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1664420852; 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=nlPYCYLrKf8BOWfnFv9EjPVqcb26DzV5stt4LLI2CDM=; b=p/ocUaXxYiDw3sFfYufBmEiidftUMzKq3ERKE2cAuWFNkA3hbq4bbEAOSKfahsq1GjYnCV aiMP3lb6IbiFHuq0Pbpe145kd3OY821EvbgAYntcHps/CwC+KYClIdW5BUle2Wg9+dnJ9J VxoZbuqGRCDoDAOFE1tm/JSZaiX52Kw= X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: A7D68140007 X-Rspam-User: Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b="4L2laas/"; spf=pass (imf26.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.216.46 as permitted sender) smtp.mailfrom=zhengqi.arch@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-Stat-Signature: ca37sry6kjjqoiirj5f7y41oka653kk7 X-HE-Tag: 1664420850-441588 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/26 22:34, David Hildenbrand wrote: > On 26.09.22 13:56, Qi Zheng wrote: >> 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 >> --- >> v1: >> https://lore.kernel.org/lkml/20220924053239.91661-1-zhengqi.arch@bytedance.com/ >> >> Changelog in v1 -> v2: >>   - change the subject and commit message (David) >> >>   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; >>       } > > > Staring at 7df676974359, it indeed looks like an accidental use [nothing > else in that patch uses update_mmu_cache]. > > So it looks good to me, but a confirmation from Bibo Mao might be good. Thanks, and Hi Bibo, any comments here? :) > -- Thanks, Qi