Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752930AbcKUE52 (ORCPT ); Sun, 20 Nov 2016 23:57:28 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56764 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751870AbcKUE50 (ORCPT ); Sun, 20 Nov 2016 23:57:26 -0500 Date: Sun, 20 Nov 2016 23:57:23 -0500 From: Jerome Glisse To: Balbir Singh Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, John Hubbard , Dan Williams , Ross Zwisler Subject: Re: [HMM v13 04/18] mm/ZONE_DEVICE/free-page: callback when page is freed Message-ID: <20161121045722.GB7872@redhat.com> References: <1479493107-982-1-git-send-email-jglisse@redhat.com> <1479493107-982-5-git-send-email-jglisse@redhat.com> <7ec714d6-6779-5abf-0607-862acddfbd4a@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <7ec714d6-6779-5abf-0607-862acddfbd4a@gmail.com> User-Agent: Mutt/1.7.1 (2016-10-04) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 21 Nov 2016 04:57:26 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 915 Lines: 20 On Mon, Nov 21, 2016 at 12:49:55PM +1100, Balbir Singh wrote: > On 19/11/16 05:18, J?r?me Glisse wrote: > > When a ZONE_DEVICE page refcount reach 1 it means it is free and nobody > > is holding a reference on it (only device to which the memory belong do). > > Add a callback and call it when that happen so device driver can implement > > their own free page management. > > > > Could you give an example of what their own free page management might look like? Well hard to do that, the free management is whatever the device driver want to do. So i don't have any example to give. Each device driver (especialy GPU ones) have their own memory management with little commonality. So how the device driver manage that memory is really not important, at least it is not something for which i want to impose a policy onto driver. I want to leave each device driver decide on how to achieve that. Cheers, J?r?me