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 X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1DDF2C6377D for ; Thu, 22 Jul 2021 07:36:25 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9737861279 for ; Thu, 22 Jul 2021 07:36:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9737861279 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=de.ibm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 081246B0072; Thu, 22 Jul 2021 03:36:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0303B6B0073; Thu, 22 Jul 2021 03:36:23 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E39786B0074; Thu, 22 Jul 2021 03:36:23 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0140.hostedemail.com [216.40.44.140]) by kanga.kvack.org (Postfix) with ESMTP id C5F4C6B0072 for ; Thu, 22 Jul 2021 03:36:23 -0400 (EDT) Received: from smtpin37.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id EACB6181AF5CC for ; Thu, 22 Jul 2021 07:36:21 +0000 (UTC) X-FDA: 78389415762.37.1E9202C Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf27.hostedemail.com (Postfix) with ESMTP id 74F8D70148F2 for ; Thu, 22 Jul 2021 07:36:21 +0000 (UTC) Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16M7XU5s087187; Thu, 22 Jul 2021 03:36:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=zi6INeEFAvvgQooM3qV0R2TsSkLmOjDUY7B73ZJhLyk=; b=hVEmkrm/4tujKP7MG+KYCq9UTDwiqarniCyWUQEW1IJtEuvbPJuepXaaJc4YiSfmQkK0 sQq//15b8kA8CIp2dirkNAAos1CMkOGeC9Wso3oQKESu3Hf0pCDUVH4IbUuRQdx0hByE LRh7m5SL10iTzT1RtufWPUo5IEpJpUDevxqRLj4oC/XwzF7PcH8kriYet5D76nlkAW1q 8XMuzW6DMg4gH4fds3rdoOQ/NI7pI6C7qz4WkUXGuhAp594mM/6FhKIO/oyGXvTju59W iemcMrgqhUHRlvyk0T61EGaU3vVc2bT32d1gzcImoE6u+1nVUEIzEVX33R4rk66A/YqD Vw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 39y476raa0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Jul 2021 03:36:15 -0400 Received: from m0098396.ppops.net (m0098396.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 16M7XmEP088235; Thu, 22 Jul 2021 03:36:15 -0400 Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 39y476ra8x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Jul 2021 03:36:14 -0400 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 16M7Qrv9003356; Thu, 22 Jul 2021 07:36:12 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma04ams.nl.ibm.com with ESMTP id 39xhx48fsy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Jul 2021 07:36:12 +0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 16M7XeeC31654384 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 22 Jul 2021 07:33:41 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DAC374C046; Thu, 22 Jul 2021 07:36:08 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3026C4C050; Thu, 22 Jul 2021 07:36:08 +0000 (GMT) Received: from oc7455500831.ibm.com (unknown [9.145.166.24]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 22 Jul 2021 07:36:08 +0000 (GMT) Subject: Re: [PATCH] mm,do_huge_pmd_numa_page: remove unnecessary TLB flushing code To: "Huang, Ying" , Sean Christopherson Cc: Yang Shi , Zi Yan , Andrew Morton , Linux MM , Linux Kernel Mailing List , Dan Carpenter , Mel Gorman , Gerald Schaefer , Heiko Carstens , Hugh Dickins , Andrea Arcangeli , "Kirill A . Shutemov" , Michal Hocko , Vasily Gorbik , Paolo Bonzini , kvm list References: <20210720065529.716031-1-ying.huang@intel.com> <0D75A92F-E2AA-480C-9E9A-0B6EE7897757@nvidia.com> <87lf5z9osl.fsf@yhuang6-desk2.ccr.corp.intel.com> From: Christian Borntraeger Message-ID: <572f1ddd-9ac6-fb09-9a24-1c667dbd1d03@de.ibm.com> Date: Thu, 22 Jul 2021 09:36:07 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <87lf5z9osl.fsf@yhuang6-desk2.ccr.corp.intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: Xv4Wmc0pneGfLw8xA7K63x6qiUNwssAP X-Proofpoint-ORIG-GUID: 8JO7E1POw03q6scXVxGporOCAuzLvBhi X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.790 definitions=2021-07-22_03:2021-07-22,2021-07-22 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 malwarescore=0 mlxscore=0 bulkscore=0 phishscore=0 spamscore=0 priorityscore=1501 impostorscore=0 suspectscore=0 adultscore=0 clxscore=1015 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2107220047 Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b="hVEmkrm/"; spf=pass (imf27.hostedemail.com: domain of borntraeger@de.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=borntraeger@de.ibm.com; dmarc=pass (policy=none) header.from=ibm.com X-Rspamd-Server: rspam02 X-Stat-Signature: 6shwjbz5xt4tbopboorgskb5jeu64gfh X-Rspamd-Queue-Id: 74F8D70148F2 X-HE-Tag: 1626939381-548362 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 22.07.21 02:26, Huang, Ying wrote: > Sean Christopherson writes: >>> >>> Thanks, I think you are correct. By looking into commit 7066f0f933a1 >>> ("mm: thp: fix mmu_notifier in migrate_misplaced_transhuge_page()"), >>> the tlb flush and mmu notifier invalidate were needed since the old >>> numa fault implementation didn't change PTE to migration entry so it >>> may cause data corruption due to the writes from GPU secondary MMU. >>> >>> The refactor does use the generic migration code which converts PTE to >>> migration entry before copying data to the new page. >> >> That's my understanding as well, based on this blurb from commit 7066f0f933a1. >> >> The standard PAGE_SIZEd migrate_misplaced_page is less accelerated and >> uses the generic migrate_pages which transitions the pte from >> numa/protnone to a migration entry in try_to_unmap_one() and flushes TLBs >> and all mmu notifiers there before copying the page. >> >> That analysis/justification for removing the invalidate_range() call should be >> captured in the changelog. Confirmation from Andrea would be a nice bonus. > > When we flush CPU TLB for a page that may be shared with device/VM TLB, > we will call MMU notifiers for the page to flush the device/VM TLB. > Right? So when we replaced CPU TLB flushing in do_huge_pmd_numa_page() > with that in try_to_migrate_one(), we will replace the MMU notifiers > calling too. Do you agree? Can someone write an updated commit messages that contains this information?