[PATCH 2/2] drm/ttm: track kmap io_reserve(), only unreserve on unmap where needed

2010-11-09 Thread Ben Skeggs
On Thu, 2010-11-04 at 19:34 +0100, Thomas Hellstrom wrote: > Ben, > > I had something like the attached in mind, although it might be more > beneficial to do the actual refcounting in drivers that needs it. Atomic > incs and decs are expensive, but I'm not sure how expensive relative to >

[PATCH 2/2] drm/ttm: track kmap io_reserve(), only unreserve on unmap where needed

2010-11-09 Thread Jerome Glisse
On Tue, Nov 9, 2010 at 2:18 AM, Thomas Hellstrom wrote: > On 11/09/2010 04:03 AM, Ben Skeggs wrote: >> >> On Thu, 2010-11-04 at 19:34 +0100, Thomas Hellstrom wrote: >> >>> >>> Ben, >>> >>> I had something like the attached in mind, although it might be more >>> beneficial to do the actual

[PATCH 2/2] drm/ttm: track kmap io_reserve(), only unreserve on unmap where needed

2010-11-09 Thread Thomas Hellstrom
On 11/09/2010 04:03 AM, Ben Skeggs wrote: > On Thu, 2010-11-04 at 19:34 +0100, Thomas Hellstrom wrote: > >> Ben, >> >> I had something like the attached in mind, although it might be more >> beneficial to do the actual refcounting in drivers that needs it. Atomic >> incs and decs are

Re: [PATCH 2/2] drm/ttm: track kmap io_reserve(), only unreserve on unmap where needed

2010-11-08 Thread Ben Skeggs
On Thu, 2010-11-04 at 19:34 +0100, Thomas Hellstrom wrote: Ben, I had something like the attached in mind, although it might be more beneficial to do the actual refcounting in drivers that needs it. Atomic incs and decs are expensive, but I'm not sure how expensive relative to function

Re: [PATCH 2/2] drm/ttm: track kmap io_reserve(), only unreserve on unmap where needed

2010-11-08 Thread Thomas Hellstrom
On 11/09/2010 04:03 AM, Ben Skeggs wrote: On Thu, 2010-11-04 at 19:34 +0100, Thomas Hellstrom wrote: Ben, I had something like the attached in mind, although it might be more beneficial to do the actual refcounting in drivers that needs it. Atomic incs and decs are expensive, but I'm not

[PATCH 2/2] drm/ttm: track kmap io_reserve(), only unreserve on unmap where needed

2010-11-04 Thread Thomas Hellstrom
Ben, I had something like the attached in mind, although it might be more beneficial to do the actual refcounting in drivers that needs it. Atomic incs and decs are expensive, but I'm not sure how expensive relative to function pointer calls. Patch is only compile-tested /Thomas On

[PATCH 2/2] drm/ttm: track kmap io_reserve(), only unreserve on unmap where needed

2010-11-04 Thread Thomas Hellstrom
On 11/04/2010 01:03 AM, Ben Skeggs wrote: > From: Ben Skeggs > > If the driver kmaps an object userspace is expecting to be mapped, the > unmap would have called down into the drivers io_unreserve() function > and potentially unmapped the pages from its BARs (for example) and they'd > no longer be

[PATCH 2/2] drm/ttm: track kmap io_reserve(), only unreserve on unmap where needed

2010-11-04 Thread Ben Skeggs
From: Ben Skeggs If the driver kmaps an object userspace is expecting to be mapped, the unmap would have called down into the drivers io_unreserve() function and potentially unmapped the pages from its BARs (for example) and they'd no longer be accessible for the userspace

Re: [PATCH 2/2] drm/ttm: track kmap io_reserve(), only unreserve on unmap where needed

2010-11-04 Thread Thomas Hellstrom
On 11/04/2010 01:03 AM, Ben Skeggs wrote: From: Ben Skeggsbske...@redhat.com If the driver kmaps an object userspace is expecting to be mapped, the unmap would have called down into the drivers io_unreserve() function and potentially unmapped the pages from its BARs (for example) and they'd no

Re: [PATCH 2/2] drm/ttm: track kmap io_reserve(), only unreserve on unmap where needed

2010-11-04 Thread Thomas Hellstrom
Ben, I had something like the attached in mind, although it might be more beneficial to do the actual refcounting in drivers that needs it. Atomic incs and decs are expensive, but I'm not sure how expensive relative to function pointer calls. Patch is only compile-tested /Thomas On

[PATCH 2/2] drm/ttm: track kmap io_reserve(), only unreserve on unmap where needed

2010-11-03 Thread Ben Skeggs
From: Ben Skeggs bske...@redhat.com If the driver kmaps an object userspace is expecting to be mapped, the unmap would have called down into the drivers io_unreserve() function and potentially unmapped the pages from its BARs (for example) and they'd no longer be accessible for the userspace