Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp920986pxv; Thu, 22 Jul 2021 16:11:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJySEMBhMTZUEKnBDtEyeyJSbXAZuk11gZoFCc8d1tKikKiaNNi2j6jvJPV+pBG3TuVyWsxY X-Received: by 2002:a5d:9585:: with SMTP id a5mr1693213ioo.28.1626995470269; Thu, 22 Jul 2021 16:11:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626995470; cv=none; d=google.com; s=arc-20160816; b=Nrb9cKI5SsXOiRycHo6VirLqMV6OQh6+yQaFYy1NGXX0S4pEBWDbH7WfsR+JkJxABa LnbUNBmHloF0cs2gzZm3BNG6l2x5SyCpyHyqMkPFx0aJP7inSPATapXGFtg9fwyF8+cY dVk/cZXaE7Xv/E8bceOiH+IGhvI9C+89a0f6232MvLFGcPvSbKu0jDYlyG0uAiocoXG+ 0zYCRpUysjk4REp0lu8j/A49lbX99zgej4C0H06SFLoRwo+Vy0+y+zu/KmM86ecM+dBL BUsIThAFYgOqon/PIhDX7djjBx89EX05pq3bHD0wpQ1mBMRjDWc65389qv8MC+NDOK7Q LxeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from; bh=KawrcMW1ooRnVdsACX+g/X4P1SVj8eSJfcszz6sVlMY=; b=vFC6fjsbqB640XTujPUw42Pp6LTA53i7bHLE5Ar+NZN9vVwOA3pW7RTgtGXCxGSxhK WVIzo/d2RNVvWedX2br6Kt+DF8lM92yGq7gCtMEsn/cCCsxeBKIf2vJFdPNw6xF6ENlI 1sfoej8x8nzNWFm07fxjf6SZ/yASF1CMlm7AL9F6BgRgNMDKAkJeKY2H1vQDy1cz36rZ Bu3nMIHZQinKBlNxioMgL6wWTAKNyjTVwoRi3bjjMHJ1bYpyBuG9LLO6jmluwzKRI0k8 0qVq0BanrTcK5NArjtdhjekE7HW4X4BQSy705LgHLwW0vRE8CkJVWVkSRBp9lE+3Noyi +mdQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t17si33255569jal.112.2021.07.22.16.10.59; Thu, 22 Jul 2021 16:11:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232531AbhGVW3o (ORCPT + 99 others); Thu, 22 Jul 2021 18:29:44 -0400 Received: from mga11.intel.com ([192.55.52.93]:23079 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232024AbhGVW3o (ORCPT ); Thu, 22 Jul 2021 18:29:44 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10053"; a="208656082" X-IronPort-AV: E=Sophos;i="5.84,262,1620716400"; d="scan'208";a="208656082" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jul 2021 16:10:17 -0700 X-IronPort-AV: E=Sophos;i="5.84,262,1620716400"; d="scan'208";a="502084173" Received: from yhuang6-desk2.sh.intel.com (HELO yhuang6-desk2.ccr.corp.intel.com) ([10.239.159.119]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jul 2021 16:10:13 -0700 From: "Huang, Ying" To: Christian Borntraeger Cc: Sean Christopherson , 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 Subject: Re: [PATCH] mm,do_huge_pmd_numa_page: remove unnecessary TLB flushing code References: <20210720065529.716031-1-ying.huang@intel.com> <0D75A92F-E2AA-480C-9E9A-0B6EE7897757@nvidia.com> <87lf5z9osl.fsf@yhuang6-desk2.ccr.corp.intel.com> <572f1ddd-9ac6-fb09-9a24-1c667dbd1d03@de.ibm.com> Date: Fri, 23 Jul 2021 07:10:12 +0800 In-Reply-To: <572f1ddd-9ac6-fb09-9a24-1c667dbd1d03@de.ibm.com> (Christian Borntraeger's message of "Thu, 22 Jul 2021 09:36:07 +0200") Message-ID: <87czra9c8b.fsf@yhuang6-desk2.ccr.corp.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=ascii Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Christian Borntraeger writes: > 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? OK. I will update the patch description to add MMU notifiers description. Best Regards, Huang, Ying