From: Keith Packard <keithp@keithp.com>
To: Dave Airlie <airlied@gmail.com>
Cc: keithp@keithp.com, Arjan van de Ven <arjan@infradead.org>,
Jeremy Fitzhardinge <jeremy@goop.org>,
Dave Airlie <airlied@linux.ie>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: kmap_atomic_pfn for PCI BAR access?
Date: Wed, 25 Jun 2008 22:33:13 -0700 [thread overview]
Message-ID: <1214458393.1044.42.camel@koto.keithp.com> (raw)
In-Reply-To: <21d7e9970806252202i10de9c82lb4637d9f1064f0b0@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1828 bytes --]
On Thu, 2008-06-26 at 15:02 +1000, Dave Airlie wrote:
> Thats why keithp wants something like kmap_atomic but for ioremap
> instead of kmaps.
Right, the usage is precisely the same as kmap_atomic -- reading and
writing from a wide range of physical addresses without needing either
permanent map nor taking the huge cost of TLB flushing.
The existing kmap_atomic_pfn is exactly what I need (modulo the lack of
prot bits), except that it only handles non-memory pages on kernels with
CONFIG_HIGHMEM set.
It seems like making this function work on non-HIGHMEM kernels would
require only the reservation of the same few PTEs that HIGHMEM kernels
use, along with suitable hacking to make them work.
> This would be for short temporary ioremaps like kmap_atomic is.
For an integrated graphics device, this is just an optimization. I take
physical pages, map them to the graphics GTT which makes them visible to
the CPU up in I/O space. Then, I map address in the GTT back to the CPU
with kmap_atomic_pfn and viola -- WC mapped access to regular pages, all
without touching the low memory mappings.
Before trying this, we just mapped the 'real' address of the page and
then used clflush to get the contents out to memory where the graphics
device could pick it up. However, the clflush is fairly expensive,
enough so that using the WC mapping turns out to be faster in practice.
Beyond simple integrated graphics performance benefits, we're looking
towards discrete graphics cards where we need to write to VRAM which can
only be made visible through the aperture; in that environment, we're
stuck choosing between ioremap (urf) or the same kmap_atomic_pfn as
above. In this case, there's no question that kmap_atomic_pfn will be a
huge performance benefit.
--
keith.packard@intel.com
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2008-06-26 5:33 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-23 17:34 Keith Packard
2008-06-26 1:18 ` Jeremy Fitzhardinge
2008-06-26 1:23 ` Dave Airlie
2008-06-26 3:11 ` Jeremy Fitzhardinge
2008-07-07 6:53 ` Nick Piggin
2008-07-07 7:05 ` Arjan van de Ven
2008-07-07 11:19 ` Nick Piggin
2008-06-26 4:36 ` Arjan van de Ven
2008-06-26 5:02 ` Dave Airlie
2008-06-26 5:33 ` Keith Packard [this message]
2008-06-26 5:36 ` Keith Packard
2008-06-26 5:59 ` Jeremy Fitzhardinge
2008-06-26 6:02 ` Dave Airlie
2008-06-26 10:36 ` Arjan van de Ven
2008-06-26 13:02 ` Arjan van de Ven
2008-06-26 10:34 ` Arjan van de Ven
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=1214458393.1044.42.camel@koto.keithp.com \
--to=keithp@keithp.com \
--cc=airlied@gmail.com \
--cc=airlied@linux.ie \
--cc=arjan@infradead.org \
--cc=jeremy@goop.org \
--cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®