From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932951AbdAJPbN (ORCPT ); Tue, 10 Jan 2017 10:31:13 -0500 Received: from hqemgate15.nvidia.com ([216.228.121.64]:19313 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752650AbdAJPbK (ORCPT ); Tue, 10 Jan 2017 10:31:10 -0500 X-PGP-Universal: processed; by hqnvupgp07.nvidia.com on Mon, 09 Jan 2017 19:27:08 -0800 Subject: Re: [HMM v15 13/16] mm/hmm/migrate: new memory migration helper for use with device memory v2 To: Jerome Glisse References: <1483721203-1678-1-git-send-email-jglisse@redhat.com> <1483721203-1678-14-git-send-email-jglisse@redhat.com> <20170106171300.GA3804@redhat.com> CC: , , , John Hubbard , Evgeny Baskakov , Mark Hairgrove , Sherry Cheung , Subhash Gutti , Cameron Buschardt , Zi Yan , Anshuman Khandual From: David Nellans Message-ID: <9642114e-3093-cff0-e177-1071b478f27f@nvidia.com> Date: Tue, 10 Jan 2017 09:30:30 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20170106171300.GA3804@redhat.com> X-Originating-IP: [10.20.174.107] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) To HQMAIL103.nvidia.com (172.20.187.11) Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > You are mischaracterizing patch 11-14. Patch 11-12 adds new flags and > modify existing functions so that they can be share. Patch 13 implement > new migration helper while patch 14 optimize this new migration helper. > > hmm_migrate() is different from existing migration code because it works > on virtual address range of a process. Existing migration code works > from page. The only difference with existing code is that we collect > pages from virtual address and we allow use of dma engine to perform > copy. You're right, but why not just introduce a new general migration interface that works on vma range first, then case all the normal migration paths for HMM and then DMA? Being able to migrate based on vma range certainly makes user level control of memory placement/migration less complicated than page interfaces. > There is nothing that ie hmm_migrate() to HMM. If that make you feel better > i can drop the hmm_ prefix but i would need another name than migrate() as > it is already taken. I can probably name it vma_range_dma_migrate() or > something like that. > > The only think that is HMM specific in this code is understanding HMM special > page table entry and handling those. Such entry can only be migrated by DMA > and not by memcpy hence why i do not modify existing code to support those. I'd be happier if there was a vma_migrate proposed independently, I think it would find users outside the HMM sandbox. In the IBM migration case, they might want the vma interface but choose to use CPU based migration rather than this DMA interface, It certainly would make testing of the vma_migrate interface easier.