Re: Adding kmap_atomic_prot_pfn (was: [git pull] drm patches for2.6.27-rc1)

From: Keith Packard
Date: Thu Oct 23 2008 - 21:50:39 EST


On Thu, 2008-10-23 at 14:24 -0700, Linus Torvalds wrote:

> The whole point of that function has absolutely nothing to do with
> highmem, and it *must* be useful on non-highmem configurations to be
> appropriate.

Right, I'd just like my io_mapping_map_atomic_wc to be able to rapidly
map random pages from my PCI BAR in WC mode. The code in your tree uses
kmap_atomic_pfn, which does the mapping, but use the wrong prot bits. On
a system with MTRR failure, this all ends badly, with factors of 20
performance drops for copying data from the CPU to the aperture.

> So I'd much rather create a new <linux/kmap.h> or something. Or just
> expose this from to <asm/fixmap.h> or something. Let's not confuse this
> with highmem, even if the implementation _historically_ was due to that.

Sure, we readily admit that we're abusing the highmem API. So we wrapped
that abusive code in a pretty package that can be re-implemented however
you desire.

How (and when) would you like to see this fixed?

--
keith.packard@xxxxxxxxx

Attachment: signature.asc
Description: This is a digitally signed message part