From: John Hubbard Subject: Re: [PATCH 13/16] mm: support THP migration to device private memory Date: Mon, 22 Jun 2020 16:01:50 -0700 Message-ID: References: <20200619215649.32297-1-rcampbell@nvidia.com> <20200619215649.32297-14-rcampbell@nvidia.com> <4C364E23-0716-4D59-85A1-0C293B86BC2C@nvidia.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: Content-Language: en-US Sender: linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Yang Shi , Zi Yan Cc: Ralph Campbell , nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org, linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Linux MM , linux-kselftest-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Linux Kernel Mailing List , Jerome Glisse , Christoph Hellwig , Jason Gunthorpe , Ben Skeggs , Andrew Morton , Shuah Khan , "Huang, Ying" List-Id: nouveau.vger.kernel.org On 2020-06-22 15:33, Yang Shi wrote: > On Mon, Jun 22, 2020 at 3:30 PM Yang Shi wrote: >> On Mon, Jun 22, 2020 at 2:53 PM Zi Yan wrote: >>> On 22 Jun 2020, at 17:31, Ralph Campbell wrote: >>>> On 6/22/20 1:10 PM, Zi Yan wrote: >>>>> On 22 Jun 2020, at 15:36, Ralph Campbell wrote: >>>>>> On 6/21/20 4:20 PM, Zi Yan wrote: >>>>>>> On 19 Jun 2020, at 17:56, Ralph Campbell wrote: ... >>> Ying(cc=E2=80=99d) developed the code to swapout and swapin THP in one = piece: https://lore.kernel.org/linux-mm/20181207054122.27822-1-ying.huang@i= ntel.com/. >>> I am not sure whether the patchset makes into mainstream or not. It cou= ld be a good technical reference >>> for swapping in device private pages, although swapping in pages from d= isk and from device private >>> memory are two different scenarios. >>> >>> Since the device private memory swapin impacts core mm performance, we = might want to discuss your patches >>> with more people, like the ones from Ying=E2=80=99s patchset, in the ne= xt version. >> >> I believe Ying will give you more insights about how THP swap works. >> >> But, IMHO device memory migration (migrate to system memory) seems >> like THP CoW more than swap. A fine point: overall, the desired behavior is "migrate", not CoW. That's important. Migrate means that you don't leave a page behind, even a read-only one. And that's exactly how device private migration is specified. We should try to avoid any erosion of clarity here. Even if somehow (really?) the underlying implementation calls this THP CoW, the actual goal is to migrate pages over to the device (and back). >> >> When migrating in: >=20 > Sorry for my fat finger, hit sent button inadvertently, let me finish her= e. >=20 > When migrating in: >=20 > - if THP is enabled: allocate THP, but need handle allocation > failure by falling back to base page > - if THP is disabled: fallback to base page >=20 OK, but *all* page entries (base and huge/large pages) need to be cleared, when migrating to device memory, unless I'm really confused here. So: not CoW. thanks, --=20 John Hubbard NVIDIA