From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qa0-f48.google.com (mail-qa0-f48.google.com [209.85.216.48]) by kanga.kvack.org (Postfix) with ESMTP id B4F806B003A for ; Mon, 7 Jul 2014 06:43:50 -0400 (EDT) Received: by mail-qa0-f48.google.com with SMTP id x12so3308252qac.7 for ; Mon, 07 Jul 2014 03:43:50 -0700 (PDT) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1blp0189.outbound.protection.outlook.com. [207.46.163.189]) by mx.google.com with ESMTPS id p4si50931015qab.8.2014.07.07.03.43.49 for (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 07 Jul 2014 03:43:49 -0700 (PDT) Message-ID: <1404729783.31606.1.camel@tlv-gabbay-ws.amd.com> Subject: Re: [PATCH 1/6] mmput: use notifier chain to call subsystem exit handler. From: Oded Gabbay Date: Mon, 7 Jul 2014 13:43:03 +0300 In-Reply-To: <20140707101158.GD1958@8bytes.org> References: <20140630183556.GB3280@gmail.com> <20140701091535.GF26537@8bytes.org> <019CCE693E457142B37B791721487FD91806DD8B@storexdag01.amd.com> <20140701110018.GH26537@8bytes.org> <20140701193343.GB3322@gmail.com> <20140701210620.GL26537@8bytes.org> <20140701213208.GC3322@gmail.com> <20140703183024.GA3306@gmail.com> <20140703231541.GR26537@8bytes.org> <019CCE693E457142B37B791721487FD918085329@storexdag01.amd.com> <20140707101158.GD1958@8bytes.org> Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: "joro@8bytes.org" Cc: "dpoole@nvidia.com" , "linux-kernel@vger.kernel.org" , "peterz@infradead.org" , "jweiner@redhat.com" , "mhairgrove@nvidia.com" , "torvalds@linux-foundation.org" , "linux-mm@kvack.org" , "j.glisse@gmail.com" , "Bridgman, John" , "Deucher, Alexander" , "Lewycky, Andrew" , "sgutti@nvidia.com" , "akpm@linux-foundation.org" , "hpa@zytor.com" , "aarcange@redhat.com" , "iommu@lists.linux-foundation.org" , "riel@redhat.com" , "arvindg@nvidia.com" , "SCheung@nvidia.com" , "jakumar@nvidia.com" , "jhubbard@nvidia.com" , "Cornwall, Jay" , "mgorman@suse.de" , "cabuschardt@nvidia.com" , "ldunning@nvidia.com" On Mon, 2014-07-07 at 12:11 +0200, joro@8bytes.org wrote: > On Sun, Jul 06, 2014 at 07:25:18PM +0000, Gabbay, Oded wrote: > > Once we can agree on that, than I think we can agree that kfd and hmm > > can and should be bounded to mm struct and not file descriptors. > > The file descriptor concept is the way it works in the rest of the > kernel. It works for numerous drivers and subsystems (KVM, VFIO, UIO, > ...), when you close a file descriptor handed out from any of those > drivers (already in the kernel) all related resources will be freed. I > don't see a reason why HSA drivers should break these expectations and > be different. > > > Joerg > > As Jerome pointed out, there are a couple of subsystems/drivers who don't rely on file descriptors but on the tear-down of mm struct, e.g. aio, ksm, uprobes, khugepaged So, based on this fact, I don't think that the argument of "The file descriptor concept is the way it works in the rest of the kernel" and only HSA/HMM now wants to change the rules, is a valid argument. Jerome and I are saying that HMM and HSA, respectively, are additional use cases of binding to mm struct. If you don't agree with that, than I would like to hear why, but you can't say that no one else in the kernel needs notification of mm struct tear-down. As for the reasons why HSA drivers should follow aio,ksm,etc. and not other drivers, I will repeat that our ioctls operate on a process context and not on a device context. Moreover, the calling process actually is sometimes not aware on which device it runs! A prime example of why HSA is not a regular device-driver, and operates in context of a process and not a specific device is the fact that in the near future (3-4 months), kfd_open() will actually bind a process address space to a *set* of devices, each of which could have its *own* device driver (eg radeon for the CI device, other amd drivers for future devices). I Assume HMM can be considered in the same way. Oded -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oded Gabbay Subject: Re: [PATCH 1/6] mmput: use notifier chain to call subsystem exit handler. Date: Mon, 7 Jul 2014 13:43:03 +0300 Message-ID: <1404729783.31606.1.camel@tlv-gabbay-ws.amd.com> References: <20140630183556.GB3280@gmail.com> <20140701091535.GF26537@8bytes.org> <019CCE693E457142B37B791721487FD91806DD8B@storexdag01.amd.com> <20140701110018.GH26537@8bytes.org> <20140701193343.GB3322@gmail.com> <20140701210620.GL26537@8bytes.org> <20140701213208.GC3322@gmail.com> <20140703183024.GA3306@gmail.com> <20140703231541.GR26537@8bytes.org> <019CCE693E457142B37B791721487FD918085329@storexdag01.amd.com> <20140707101158.GD1958@8bytes.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20140707101158.GD1958@8bytes.org> Sender: owner-linux-mm@kvack.org To: "joro@8bytes.org" Cc: "dpoole@nvidia.com" , "linux-kernel@vger.kernel.org" , "peterz@infradead.org" , "jweiner@redhat.com" , "mhairgrove@nvidia.com" , "torvalds@linux-foundation.org" , "linux-mm@kvack.org" , "j.glisse@gmail.com" , "Bridgman, John" , "Deucher, Alexander" , "Lewycky, Andrew" , "sgutti@nvidia.com" , "akpm@linux-foundation.org" , "hpa@zytor.com" , "aarcange@redhat.com" , "iommu@lists.linux-foundation.org" , "riel@redhat.com" , "arvindg@nvidia.com" , "SCheung@nvidia.com" List-Id: iommu@lists.linux-foundation.org On Mon, 2014-07-07 at 12:11 +0200, joro@8bytes.org wrote: > On Sun, Jul 06, 2014 at 07:25:18PM +0000, Gabbay, Oded wrote: > > Once we can agree on that, than I think we can agree that kfd and hmm > > can and should be bounded to mm struct and not file descriptors. > > The file descriptor concept is the way it works in the rest of the > kernel. It works for numerous drivers and subsystems (KVM, VFIO, UIO, > ...), when you close a file descriptor handed out from any of those > drivers (already in the kernel) all related resources will be freed. I > don't see a reason why HSA drivers should break these expectations and > be different. > > > Joerg > > As Jerome pointed out, there are a couple of subsystems/drivers who don't rely on file descriptors but on the tear-down of mm struct, e.g. aio, ksm, uprobes, khugepaged So, based on this fact, I don't think that the argument of "The file descriptor concept is the way it works in the rest of the kernel" and only HSA/HMM now wants to change the rules, is a valid argument. Jerome and I are saying that HMM and HSA, respectively, are additional use cases of binding to mm struct. If you don't agree with that, than I would like to hear why, but you can't say that no one else in the kernel needs notification of mm struct tear-down. As for the reasons why HSA drivers should follow aio,ksm,etc. and not other drivers, I will repeat that our ioctls operate on a process context and not on a device context. Moreover, the calling process actually is sometimes not aware on which device it runs! A prime example of why HSA is not a regular device-driver, and operates in context of a process and not a specific device is the fact that in the near future (3-4 months), kfd_open() will actually bind a process address space to a *set* of devices, each of which could have its *own* device driver (eg radeon for the CI device, other amd drivers for future devices). I Assume HMM can be considered in the same way. Oded -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org