Re: io resources and cached mappings (was: [git pull] drm patches for 2.6.27-rc1)

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Eric Anholt
Date: Sunday, October 19, 2008 - 12:07 pm

On Sun, 2008-10-19 at 19:53 +0200, Ingo Molnar wrote:
fset);

This API needs the cacheability control, which I don't see in it
currently.  In the past we've been relying on an MTRR over the GTT
resulting in all of our UC- mappings getting us the correct WC behavior,
but now there aren't enough MTRRs to go around and graphics loses out
(at about a 20% CPU cost as a conservative estimate).  The primary goal
of the new API is to let us eat PAT costs up front so we don't have to
at runtime.

Second, we need to know when we're doing a mapping whether we're
affected by atomic scheduling restrictions.  Right now our plan has been
to try doing page-by-page
io_map_atomic_wc()/copy_from_user_inatomic()/io_unmap_atomic(), and if
we fail at that at some point (map returns NULL or we get a partial
completion from copy_from_user_inatomic) then fall back to io_map_wc()
and copy_from_user() the whole thing at once.  That gets us good
performance on both x86 with highmem and x86-64, and not too shabby
performance on x86 non-highmem.

Also, while it's rare, there have been graphics cards (looking at you,
S3) where BARs were expensive for some reason and they stuffed both the
framebuffer and registers into one PCI BAR, where you want the FB to be
WC and the registers to be UC.  Not sure if they would be supportable
with this API or not.  And if it's not, I'm not sure how much we care to
design for them, but it's something to potentially consider.

Finally, I'm confused by the pfn and offset args to io_resource_map,
when I expected something parallel to ioremap but with our resource arg
added.


--=20
Eric Anholt
eric@anholt.net                         eric.anholt@intel.com
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[git pull] drm patches for 2.6.27-rc1, Dave Airlie, (Fri Oct 17, 2:29 pm)
Re: [git pull] drm patches for 2.6.27-rc1, Linus Torvalds, (Fri Oct 17, 3:43 pm)
Re: [git pull] drm patches for 2.6.27-rc1, Nick Piggin, (Fri Oct 17, 6:37 pm)
Re: [git pull] drm patches for 2.6.27-rc1, Eric Anholt, (Fri Oct 17, 7:10 pm)
Re: [git pull] drm patches for 2.6.27-rc1, Linus Torvalds, (Fri Oct 17, 7:47 pm)
Re: [git pull] drm patches for 2.6.27-rc1, Keith Packard, (Fri Oct 17, 8:49 pm)
Re: [git pull] drm patches for 2.6.27-rc1, Corbin Simpson, (Fri Oct 17, 11:44 pm)
Re: [git pull] drm patches for 2.6.27-rc1, Eric Anholt, (Sat Oct 18, 12:49 am)
Re: [git pull] drm patches for 2.6.27-rc1, Dave Airlie, (Sat Oct 18, 2:11 am)
Re: [git pull] drm patches for 2.6.27-rc1, Keith Packard, (Sat Oct 18, 12:11 pm)
Re: [git pull] drm patches for 2.6.27-rc1, Linus Torvalds, (Sat Oct 18, 12:31 pm)
Re: [git pull] drm patches for 2.6.27-rc1, Thomas Hellström, (Sat Oct 18, 1:07 pm)
Re: [git pull] drm patches for 2.6.27-rc1, Keith Packard, (Sat Oct 18, 1:20 pm)
Re: [git pull] drm patches for 2.6.27-rc1, Ingo Molnar, (Sat Oct 18, 1:37 pm)
Re: [git pull] drm patches for 2.6.27-rc1, Keith Packard, (Sat Oct 18, 2:51 pm)
Re: [git pull] drm patches for 2.6.27-rc1, Ingo Molnar, (Sat Oct 18, 3:32 pm)
Re: [git pull] drm patches for 2.6.27-rc1, Jon Smirl, (Sat Oct 18, 3:47 pm)
Re: [git pull] drm patches for 2.6.27-rc1, Linus Torvalds, (Sat Oct 18, 3:53 pm)
Re: [git pull] drm patches for 2.6.27-rc1, Keith Packard, (Sat Oct 18, 5:38 pm)
Re: [git pull] drm patches for 2.6.27-rc1, Arjan van de Ven, (Sat Oct 18, 6:06 pm)
Re: [git pull] drm patches for 2.6.27-rc1, Keith Packard, (Sat Oct 18, 6:15 pm)
Re: [git pull] drm patches for 2.6.27-rc1, Nick Piggin, (Sat Oct 18, 8:14 pm)
Re: [git pull] drm patches for 2.6.27-rc1, Keith Packard, (Sat Oct 18, 9:14 pm)
Re: [git pull] drm patches for 2.6.27-rc1, Yinghai Lu, (Sat Oct 18, 9:28 pm)
Re: [git pull] drm patches for 2.6.27-rc1, Keith Packard, (Sat Oct 18, 11:41 pm)
Re: [git pull] drm patches for 2.6.27-rc1, Peter Zijlstra, (Sun Oct 19, 10:52 am)
Re: io resources and cached mappings (was: [git pull] drm ..., Arjan van de Ven, (Sun Oct 19, 11:00 am)
Re: io resources and cached mappings (was: [git pull] drm ..., Eric Anholt, (Sun Oct 19, 12:07 pm)
Re: [git pull] drm patches for 2.6.27-rc1, Steven J Newbury, (Sun Oct 19, 9:17 pm)
Re: [git pull] drm patches for 2.6.27-rc1, Ingo Molnar, (Mon Oct 20, 3:01 am)
Re: [git pull] drm patches for 2.6.27-rc1, Linus Torvalds, (Mon Oct 20, 9:31 am)
Re: [git pull] drm patches for 2.6.27-rc1, Jesse Barnes, (Mon Oct 20, 1:04 pm)
Re: Adding kmap_atomic_prot_pfn (was: [git pull] drm patc ..., Benjamin Herrenschmidt, (Thu Oct 23, 8:21 pm)
Re: Adding kmap_atomic_prot_pfn (was: [git pull] drm patc ..., Benjamin Herrenschmidt, (Thu Oct 23, 8:24 pm)
Re: Adding kmap_atomic_prot_pfn , Thomas Hellström, (Fri Oct 24, 12:33 am)
Re: Adding kmap_atomic_prot_pfn, Ingo Molnar, (Fri Oct 24, 1:38 am)
Re: Adding kmap_atomic_prot_pfn, Thomas Hellström, (Fri Oct 24, 2:19 am)
Re: Adding kmap_atomic_prot_pfn, Ingo Molnar, (Fri Oct 24, 2:32 am)
Re: Adding kmap_atomic_prot_pfn, Thomas Hellström, (Fri Oct 24, 3:18 am)
Re: Adding kmap_atomic_prot_pfn, Thomas Hellström, (Fri Oct 24, 4:04 am)
Re: Adding kmap_atomic_prot_pfn, Keith Packard, (Fri Oct 24, 8:48 am)
[git pull] IO mappings, #2, Ingo Molnar, (Mon Nov 3, 10:29 am)
Re: [git pull] IO mappings, #2, Jonathan Corbet, (Tue Nov 4, 3:36 pm)
Re: [git pull] IO mappings, #2, Ingo Molnar, (Wed Nov 5, 2:01 am)