[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a0dbf913-2bd0-b032-596e-520e678d5b5b@nvidia.com>
Date: Tue, 23 Jun 2020 10:05:19 -0700
From: Ralph Campbell <rcampbell@...dia.com>
To: Christoph Hellwig <hch@....de>
CC: <linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>,
Jerome Glisse <jglisse@...hat.com>,
John Hubbard <jhubbard@...dia.com>,
Jason Gunthorpe <jgg@...lanox.com>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [RESEND PATCH] mm: fix migrate_vma_setup() src_owner and normal
pages
On 6/23/20 4:40 AM, Christoph Hellwig wrote:
> On Mon, Jun 22, 2020 at 03:20:08PM -0700, Ralph Campbell wrote:
>> The caller of migrate_vma_setup() does not know what type of page is
>> stored in the CPU's page tables. Pages within the specified range are
>> free to be swapped out, migrated, or freed until after migrate_vma_setup()
>> returns. The caller needs to set struct migrate_vma.src_owner in case a
>> page is a ZONE device private page that the device owns and might want to
>> migrate. However, the current code skips normal anonymous pages if
>> src_owner is set, thus preventing those pages from being migrated.
>> Remove the src_owner check for normal pages since src_owner only applies
>> to device private pages and allow a range of normal and device private
>> pages to be migrated.
>
> src_owner being set means we want to migrate from device private
> memory to normal host DRAM. What kind of problem do you see of
> not touching already present pages in that path?
>
The problem is that migrate_vma_setup() invalidates the address range so any
previously migrated pages to device private memory have to be faulted in
again. By having the PFN of those device private pages in the src array, the
driver can reinstate the device MMU mappings and avoid the page faults.
Powered by blists - more mailing lists