[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87czra9c8b.fsf@yhuang6-desk2.ccr.corp.intel.com>
Date: Fri, 23 Jul 2021 07:10:12 +0800
From: "Huang, Ying" <ying.huang@...el.com>
To: Christian Borntraeger <borntraeger@...ibm.com>
Cc: Sean Christopherson <seanjc@...gle.com>,
Yang Shi <shy828301@...il.com>, Zi Yan <ziy@...dia.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Linux MM <linux-mm@...ck.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Dan Carpenter <dan.carpenter@...cle.com>,
Mel Gorman <mgorman@...e.de>,
Gerald Schaefer <gerald.schaefer@...ux.ibm.com>,
Heiko Carstens <hca@...ux.ibm.com>,
Hugh Dickins <hughd@...gle.com>,
Andrea Arcangeli <aarcange@...hat.com>,
"Kirill A . Shutemov" <kirill.shutemov@...ux.intel.com>,
Michal Hocko <mhocko@...e.com>,
Vasily Gorbik <gor@...ux.ibm.com>,
Paolo Bonzini <pbonzini@...hat.com>,
kvm list <kvm@...r.kernel.org>
Subject: Re: [PATCH] mm,do_huge_pmd_numa_page: remove unnecessary TLB
flushing code
Christian Borntraeger <borntraeger@...ibm.com> writes:
> On 22.07.21 02:26, Huang, Ying wrote:
>> Sean Christopherson <seanjc@...gle.com> 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
Powered by blists - more mailing lists