All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	bskeggs@redhat.com, j.glisse@redhat.com, thomas@shipmail.org,
	airlied@redhat.com, airlied@linux.ie, alexdeucher@gmail.com
Subject: [RFC PATCH] TTM DMA pool v1
Date: Wed, 24 Aug 2011 13:16:58 -0400	[thread overview]
Message-ID: <1314206224-15304-1-git-send-email-konrad.wilk@oracle.com> (raw)

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 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).

As I mentioned, in the past, the patches I introduced broke certain scenarios
so I've been running compile/runtime tests to make sure I don't repeat my past
mistakes.  Both nouveau and radeon - IGP, PCI-e, and with various IOMMUs -
Calgary, GART, SWIOTLB, Xen SWIOTLB, AMD-VI work correctly (still need to test
Intel VT-d).

My PowerPC has issues with booting a virgin 3.0 kernel (something about
"ELF image not correct") so I don't have that yet covered.

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.5

And the full diffstat is:

 drivers/gpu/drm/nouveau/nouveau_mem.c    |    3 +-
 drivers/gpu/drm/nouveau/nouveau_sgdma.c  |    3 +-
 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 | 1311 ++++++++++++++++++++++++++++++
 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 +-
 16 files changed, 1499 insertions(+), 30 deletions(-)

             reply	other threads:[~2011-08-24 18:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-24 17:16 Konrad Rzeszutek Wilk [this message]
2011-08-24 17:16 ` [PATCH 1/6] ttm/radeon/nouveau: Check the DMA address from TTM against known value Konrad Rzeszutek Wilk
2011-08-24 17:17 ` [PATCH 2/6] ttm: Introduce ttm_page_alloc_func structure Konrad Rzeszutek Wilk
2011-08-24 17:17 ` [PATCH 3/6] ttm: Pass in 'struct device' to TTM so it can do DMA API on behalf of device Konrad Rzeszutek Wilk
2011-08-24 17:17 ` [PATCH 4/6] swiotlb: Expose swiotlb_nr_tlb function to modules as swiotlb_enabled Konrad Rzeszutek Wilk
2011-08-24 17:17 ` [PATCH 5/6] ttm: Provide a DMA aware TTM page pool code Konrad Rzeszutek Wilk
2011-08-24 17:17 ` [PATCH 6/6] ttm: Add 'no_dma' parameter to turn the TTM DMA pool off during runtime Konrad Rzeszutek Wilk
2011-08-25 15:28 ` [RFC PATCH] TTM DMA pool v1 Michel Dänzer
2011-08-25 20:22   ` Konrad Rzeszutek Wilk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1314206224-15304-1-git-send-email-konrad.wilk@oracle.com \
    --to=konrad.wilk@oracle.com \
    --cc=airlied@linux.ie \
    --cc=airlied@redhat.com \
    --cc=alexdeucher@gmail.com \
    --cc=bskeggs@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=j.glisse@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thomas@shipmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.