All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] TTM DMA v1.8
@ 2011-09-13 14:12 ` Konrad Rzeszutek Wilk
  0 siblings, 0 replies; 20+ messages in thread
From: Konrad Rzeszutek Wilk @ 2011-09-13 14:12 UTC (permalink / raw)
  To: thellstrom, linux-kernel, xen-devel, dri-devel, thomas
  Cc: Pekka Paalanen, bskeggs, j.glisse, airlied, airlied, alexdeucher

Since v1.7: [https://lkml.org/lkml/2011/8/30/460]
 - Fixed checking the DMA address in radeon/nouveau code.
Since v1: [http://lwn.net/Articles/456246/]
 - Ran it through the gauntlet of SubmitChecklist and fixed issues
 - Made radeon/nouveau driver set coherent_dma (which is required for dmapool)

[.. and this is what I said in v1 post]:

Way back in January this patchset:
http://lists.freedesktop.org/archives/dri-devel/2011-January/006905.html
was merged in, but pieces of it had to be reverted b/c they did not
work properly under PowerPC, ARM, and when swapping out pages to disk.

After a bit of discussion on the mailing list
http://marc.info/?i=4D769726.2030307@shipmail.org I started working on it, but
got waylaid by other things .. and finally I am able to post the RFC patches.

There was a lot of discussion about it and I am not sure if I captured
everybody's thoughts - if I did not - that is _not_ intentional - it has just
been quite some time..

Anyhow .. the patches explore what the "lib/dmapool.c" does - which is to have a
DMA pool that the device has associated with. I kind of married that code
along with drivers/gpu/drm/ttm/ttm_page_alloc.c to create a TTM DMA pool code.
The end result is DMA pool with extra features: can do write-combine, uncached,
writeback (and tracks them and sets back to WB when freed); tracks "cached"
pages that don't really need to be returned to a pool; and hooks up to
the shrinker code so that the pools can be shrunk.

If you guys think this set of patches make sense  - my future plans were
 1) Get this in large crowd of testing .. and if it works for a kernel release
 2) to move a bulk of this in the lib/dmapool.c (I spoke with Matthew Wilcox
    about it and he is OK as long as I don't introduce performance regressions).

But before I do any of that a second set of eyes taking a look at these
patches would be most welcome.

In regards to testing, I've been running them non-stop for the last two weeks
(and found some issues which I've fixed up) - and been quite happy with how
they work. I finally got my Intel VT-d box online so will test that shortly.

Michel (thanks!) took a spin of the patches on his PowerPC and they did not
cause any regressions (wheew).

The patches are also located in a git tree:

 git://oss.oracle.com/git/kwilk/xen.git devel/ttm.dma_pool.v1.8

 drivers/gpu/drm/nouveau/nouveau_mem.c    |    8 +-
 drivers/gpu/drm/nouveau/nouveau_sgdma.c  |    3 +-
 drivers/gpu/drm/radeon/radeon_device.c   |    6 +
 drivers/gpu/drm/radeon/radeon_gart.c     |    4 +-
 drivers/gpu/drm/radeon/radeon_ttm.c      |    3 +-
 drivers/gpu/drm/ttm/Makefile             |    3 +
 drivers/gpu/drm/ttm/ttm_bo.c             |    4 +-
 drivers/gpu/drm/ttm/ttm_memory.c         |    5 +
 drivers/gpu/drm/ttm/ttm_page_alloc.c     |   63 ++-
 drivers/gpu/drm/ttm/ttm_page_alloc_dma.c | 1317 ++++++++++++++++++++++++++++++
 drivers/gpu/drm/ttm/ttm_tt.c             |    5 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.c      |    4 +-
 drivers/xen/swiotlb-xen.c                |    2 +-
 include/drm/ttm/ttm_bo_driver.h          |    7 +-
 include/drm/ttm/ttm_page_alloc.h         |  100 +++-
 include/linux/swiotlb.h                  |    7 +-
 lib/swiotlb.c                            |    5 +-
 17 files changed, 1516 insertions(+), 30 deletions(-)

^ permalink raw reply	[flat|nested] 20+ messages in thread
* [PATCH] TTM DMA pool v1.7
@ 2011-08-31  2:41 Konrad Rzeszutek Wilk
  2011-08-31  2:41   ` Konrad Rzeszutek Wilk
  0 siblings, 1 reply; 20+ messages in thread
From: Konrad Rzeszutek Wilk @ 2011-08-31  2:41 UTC (permalink / raw)
  To: thellstrom, linux-kernel, dri-devel, bskeggs, j.glisse, thomas,
	airlied, airlied, alexdeucher

Since v1: [http://lwn.net/Articles/456246/]
 - Ran it through the gauntlet of SubmitChecklist and fixed issues
 - Made radeon/nouveau driver set coherent_dma (which is required for dmapool)

[.. and this is what I said in v1 post]:

Way back in January this patchset:
http://lists.freedesktop.org/archives/dri-devel/2011-January/006905.html
was merged in, but pieces of it had to be reverted b/c they did not
work properly under PowerPC, ARM, and when swapping out pages to disk.

After a bit of discussion on the mailing list
http://marc.info/?i=4D769726.2030307@shipmail.org I started working on it, but
got waylaid by other things .. and finally I am able to post the RFC patches.

There was a lot of discussion about it and I am not sure if I captured
everybody's thoughts - if I did not - that is _not_ intentional - it has just
been quite some time..

Anyhow .. the patches explore what the "lib/dmapool.c" does - which is to have a
DMA pool that the device has associated with. I kind of married that code
along with drivers/gpu/drm/ttm/ttm_page_alloc.c to create a TTM DMA pool code.
The end result is DMA pool with extra features: can do write-combine, uncached,
writeback (and tracks them and sets back to WB when freed); tracks "cached"
pages that don't really need to be returned to a pool; and hooks up to
the shrinker code so that the pools can be shrunk.

If you guys think this set of patches make sense  - my future plans were
 1) Get this in large crowd of testing .. and if it works for a kernel release
 2) to move a bulk of this in the lib/dmapool.c (I spoke with Matthew Wilcox
    about it and he is OK as long as I don't introduce performance regressions).

But before I do any of that a second set of eyes taking a look at these
patches would be most welcome.

In regards to testing, I've been running them non-stop for the last two weeks
(and found some issues which I've fixed up) - and been quite happy with how
they work. I finally got my Intel VT-d box online so will test that shortly.

Michel (thanks!) took a spin off the patches on his PowerPC and they did not
cause any regressions (wheew).

The patches are also located in a git tree:

 git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen.git devel/ttm.dma_pool.v1.7

And the full diffstat is:

 drivers/gpu/drm/nouveau/nouveau_mem.c    |    8 +-
 drivers/gpu/drm/nouveau/nouveau_sgdma.c  |    3 +-
 drivers/gpu/drm/radeon/radeon_device.c   |    6 +
 drivers/gpu/drm/radeon/radeon_gart.c     |    4 +-
 drivers/gpu/drm/radeon/radeon_ttm.c      |    3 +-
 drivers/gpu/drm/ttm/Makefile             |    3 +
 drivers/gpu/drm/ttm/ttm_bo.c             |    4 +-
 drivers/gpu/drm/ttm/ttm_memory.c         |    5 +
 drivers/gpu/drm/ttm/ttm_page_alloc.c     |   63 ++-
 drivers/gpu/drm/ttm/ttm_page_alloc_dma.c | 1317 ++++++++++++++++++++++++++++++
 drivers/gpu/drm/ttm/ttm_tt.c             |    5 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.c      |    4 +-
 drivers/xen/swiotlb-xen.c                |    2 +-
 include/drm/ttm/ttm_bo_driver.h          |    7 +-
 include/drm/ttm/ttm_page_alloc.h         |  100 +++-
 include/linux/swiotlb.h                  |    7 +-
 lib/swiotlb.c                            |    5 +-
 17 files changed, 1516 insertions(+), 30 deletions(-)

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2011-09-16 20:55 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-13 14:12 [PATCH] TTM DMA v1.8 Konrad Rzeszutek Wilk
2011-09-13 14:12 ` Konrad Rzeszutek Wilk
2011-09-13 14:12 ` [PATCH 1/7] ttm/radeon/nouveau: Check the DMA address from TTM against known value Konrad Rzeszutek Wilk
2011-09-13 14:12 ` [PATCH 2/7] ttm: Introduce ttm_page_alloc_func structure Konrad Rzeszutek Wilk
2011-09-13 14:12   ` Konrad Rzeszutek Wilk
2011-09-13 14:12 ` [PATCH 3/7] ttm: Pass in 'struct device' to TTM so it can do DMA API on behalf of device Konrad Rzeszutek Wilk
2011-09-13 14:12   ` Konrad Rzeszutek Wilk
2011-09-13 14:12 ` [PATCH 4/7] swiotlb: Expose swiotlb_nr_tlb function to modules as swiotlb_enabled Konrad Rzeszutek Wilk
2011-09-16 19:05   ` FUJITA Tomonori
2011-09-16 19:05     ` FUJITA Tomonori
2011-09-16 20:54     ` [Xen-devel] " Konrad Rzeszutek Wilk
2011-09-16 20:54       ` Konrad Rzeszutek Wilk
2011-09-13 14:12 ` [PATCH 5/7] ttm: Provide a DMA aware TTM page pool code Konrad Rzeszutek Wilk
2011-09-13 14:12 ` [PATCH 6/7] ttm: Add 'no_dma' parameter to turn the TTM DMA pool off during runtime Konrad Rzeszutek Wilk
2011-09-13 14:12 ` [PATCH 7/7] nouveau/radeon: Set coherent DMA mask Konrad Rzeszutek Wilk
  -- strict thread matches above, loose matches on Subject: below --
2011-08-31  2:41 [PATCH] TTM DMA pool v1.7 Konrad Rzeszutek Wilk
2011-08-31  2:41 ` [PATCH 1/7] ttm/radeon/nouveau: Check the DMA address from TTM against known value Konrad Rzeszutek Wilk
2011-08-31  2:41   ` Konrad Rzeszutek Wilk
2011-08-31  6:33   ` Pekka Paalanen
2011-08-31 12:02     ` Konrad Rzeszutek Wilk
2011-08-31 12:02       ` Konrad Rzeszutek Wilk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.