Re: [RFC PATCH 15/18] cgroup: Introduce ioasids controller

2021-03-05 Thread Jacob Pan
Hi Jean-Philippe, On Fri, 5 Mar 2021 09:30:49 +0100, Jean-Philippe Brucker wrote: > On Thu, Mar 04, 2021 at 09:46:03AM -0800, Jacob Pan wrote: > > Hi Jean-Philippe, > > > > On Thu, 4 Mar 2021 10:49:37 +0100, Jean-Philippe Brucker > > wrote: > > > > > On Wed, Mar 03, 2021 at 04:02:05PM -0800

Re: [RFC PATCH 15/18] cgroup: Introduce ioasids controller

2021-03-05 Thread Jean-Philippe Brucker
On Fri, Mar 05, 2021 at 09:30:49AM +0100, Jean-Philippe Brucker wrote: > That works but isn't perfect, because the hardware resource of shared > address spaces can be much lower that PID limit - 16k ASIDs on Arm. To Sorry I meant 16-bit here - 64k Thanks, Jean

Re: [RFC PATCH 15/18] cgroup: Introduce ioasids controller

2021-03-05 Thread Jean-Philippe Brucker
On Thu, Mar 04, 2021 at 09:46:03AM -0800, Jacob Pan wrote: > Hi Jean-Philippe, > > On Thu, 4 Mar 2021 10:49:37 +0100, Jean-Philippe Brucker > wrote: > > > On Wed, Mar 03, 2021 at 04:02:05PM -0800, Jacob Pan wrote: > > > Hi Jacob, > > > > > > On Wed, 3 Mar 2021 13:17:26 -0800, Jacob Pan > > > w

Re: [RFC PATCH 15/18] cgroup: Introduce ioasids controller

2021-03-04 Thread Jacob Pan
Hi Jason, On Thu, 4 Mar 2021 15:02:53 -0400, Jason Gunthorpe wrote: > On Thu, Mar 04, 2021 at 11:01:44AM -0800, Jacob Pan wrote: > > > > For something like qemu I'd expect to put the qemu process in a cgroup > > > with 1 PASID. Who cares what qemu uses the PASID for, or how it was > > > allocat

Re: [RFC PATCH 15/18] cgroup: Introduce ioasids controller

2021-03-04 Thread Jason Gunthorpe
On Thu, Mar 04, 2021 at 11:01:44AM -0800, Jacob Pan wrote: > > For something like qemu I'd expect to put the qemu process in a cgroup > > with 1 PASID. Who cares what qemu uses the PASID for, or how it was > > allocated? > > For vSVA, we will need one PASID per guest process. But that is up to th

Re: [RFC PATCH 15/18] cgroup: Introduce ioasids controller

2021-03-04 Thread Jacob Pan
Hi Jason, On Thu, 4 Mar 2021 13:54:02 -0400, Jason Gunthorpe wrote: > On Thu, Mar 04, 2021 at 09:46:03AM -0800, Jacob Pan wrote: > > > Right, I was assuming have three use cases of IOASIDs: > > 1. host supervisor SVA (not a concern, just one init_mm to bind) > > 2. host user SVA, either one IOA

Re: [RFC PATCH 15/18] cgroup: Introduce ioasids controller

2021-03-04 Thread Jason Gunthorpe
On Thu, Mar 04, 2021 at 09:46:03AM -0800, Jacob Pan wrote: > Right, I was assuming have three use cases of IOASIDs: > 1. host supervisor SVA (not a concern, just one init_mm to bind) > 2. host user SVA, either one IOASID per process or perhaps some private > IOASID for private address space > 3. V

Re: [RFC PATCH 15/18] cgroup: Introduce ioasids controller

2021-03-04 Thread Jacob Pan
Hi Jean-Philippe, On Thu, 4 Mar 2021 10:49:37 +0100, Jean-Philippe Brucker wrote: > On Wed, Mar 03, 2021 at 04:02:05PM -0800, Jacob Pan wrote: > > Hi Jacob, > > > > On Wed, 3 Mar 2021 13:17:26 -0800, Jacob Pan > > wrote: > > > > > Hi Tejun, > > > > > > On Wed, 3 Mar 2021 10:44:28 -0500, Te

Re: [RFC PATCH 15/18] cgroup: Introduce ioasids controller

2021-03-04 Thread Jean-Philippe Brucker
On Wed, Mar 03, 2021 at 04:02:05PM -0800, Jacob Pan wrote: > Hi Jacob, > > On Wed, 3 Mar 2021 13:17:26 -0800, Jacob Pan > wrote: > > > Hi Tejun, > > > > On Wed, 3 Mar 2021 10:44:28 -0500, Tejun Heo wrote: > > > > > On Sat, Feb 27, 2021 at 02:01:23PM -0800, Jacob Pan wrote: > > > > IOASIDs a

Re: [RFC PATCH 15/18] cgroup: Introduce ioasids controller

2021-03-03 Thread Jacob Pan
Hi Jacob, On Wed, 3 Mar 2021 13:17:26 -0800, Jacob Pan wrote: > Hi Tejun, > > On Wed, 3 Mar 2021 10:44:28 -0500, Tejun Heo wrote: > > > On Sat, Feb 27, 2021 at 02:01:23PM -0800, Jacob Pan wrote: > > > IOASIDs are used to associate DMA requests with virtual address > > > spaces. They are a s

Re: [RFC PATCH 15/18] cgroup: Introduce ioasids controller

2021-03-03 Thread Jason Gunthorpe
On Wed, Mar 03, 2021 at 04:02:05PM -0800, Jacob Pan wrote: > > The interface definitely can be reused. But IOASID has a different > > behavior in terms of migration and ownership checking. I guess SEV key > > IDs are not tied to a process whereas IOASIDs are. Perhaps this can be > > solved by addin

Re: [RFC PATCH 15/18] cgroup: Introduce ioasids controller

2021-03-03 Thread Jacob Pan
Hi Tejun, On Wed, 3 Mar 2021 10:44:28 -0500, Tejun Heo wrote: > On Sat, Feb 27, 2021 at 02:01:23PM -0800, Jacob Pan wrote: > > IOASIDs are used to associate DMA requests with virtual address spaces. > > They are a system-wide limited resource made available to the userspace > > applications. Let

Re: [RFC PATCH 15/18] cgroup: Introduce ioasids controller

2021-03-03 Thread Tejun Heo
On Sat, Feb 27, 2021 at 02:01:23PM -0800, Jacob Pan wrote: > IOASIDs are used to associate DMA requests with virtual address spaces. > They are a system-wide limited resource made available to the userspace > applications. Let it be VMs or user-space device drivers. > > This RFC patch introduces a

[RFC PATCH 15/18] cgroup: Introduce ioasids controller

2021-02-27 Thread Jacob Pan
IOASIDs are used to associate DMA requests with virtual address spaces. They are a system-wide limited resource made available to the userspace applications. Let it be VMs or user-space device drivers. This RFC patch introduces a cgroup controller to address the following problems: 1. Some user ap